diff --git a/.ci/before_install.sh b/.ci/before_install.sh deleted file mode 100755 index 9aac37de12..0000000000 --- a/.ci/before_install.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -o pipefail - -if [[ -n "${CI_TARGET}" ]]; then - exit -fi - -if [[ "${TRAVIS_OS_NAME}" == osx ]]; then - brew update -fi - -echo "Upgrade Python 2 pip." -pip2.7 -q install --user --upgrade pip - -if [[ "${TRAVIS_OS_NAME}" == osx ]]; then - echo "Install Python 3." - brew install python3 - echo "Upgrade Python 3 pip." - pip3 -q install --user --upgrade pip -else - echo "Upgrade Python 3 pip." - pip3 -q install --user --upgrade pip -fi diff --git a/.ci/common/test.sh b/.ci/common/test.sh deleted file mode 100644 index b28e46a4df..0000000000 --- a/.ci/common/test.sh +++ /dev/null @@ -1,148 +0,0 @@ -print_core() { - local app="$1" - local core="$2" - if test "$app" = quiet ; then - echo "Found core $core" - return 0 - fi - echo "======= Core file $core =======" - if [[ "${TRAVIS_OS_NAME}" == osx ]]; then - lldb -Q -o "bt all" -f "${app}" -c "${core}" - else - gdb -n -batch -ex 'thread apply all bt full' "${app}" -c "${core}" - fi -} - -check_core_dumps() { - local del= - if test "$1" = "--delete" ; then - del=1 - shift - fi - local app="${1:-${BUILD_DIR}/bin/nvim}" - if [[ "${TRAVIS_OS_NAME}" == osx ]]; then - local cores="$(find /cores/ -type f -print)" - else - local cores="$(find ./ -type f -name 'core.*' -print)" - fi - - if [ -z "${cores}" ]; then - return - fi - local core - for core in $cores; do - if test "$del" = "1" ; then - print_core "$app" "$core" >&2 - rm "$core" - else - print_core "$app" "$core" - fi - done - if test "$app" = quiet ; then - return 0 - fi - exit 1 -} - -check_logs() { - # Iterate through each log to remove an useless warning. - for log in $(find "${1}" -type f -name "${2}"); do - sed -i "${log}" \ - -e '/Warning: noted but unhandled ioctl/d' \ - -e '/could cause spurious value errors to appear/d' \ - -e '/See README_MISSING_SYSCALL_OR_IOCTL for guidance/d' - done - - # Now do it again, but only consider files with size > 0. - local err="" - for log in $(find "${1}" -type f -name "${2}" -size +0); do - cat "${log}" - err=1 - done - if [[ -n "${err}" ]]; then - echo "Runtime errors detected." - exit 1 - fi -} - -valgrind_check() { - check_logs "${1}" "valgrind-*" -} - -asan_check() { - check_logs "${1}" "*san.*" -} - -run_unittests() { - ulimit -c unlimited - if ! ${MAKE_CMD} -C "${BUILD_DIR}" unittest ; then - check_core_dumps "$(which luajit)" - exit 1 - fi - check_core_dumps "$(which luajit)" -} - -run_functionaltests() { - ulimit -c unlimited - if ! ${MAKE_CMD} -C "${BUILD_DIR}" ${FUNCTIONALTEST}; then - asan_check "${LOG_DIR}" - valgrind_check "${LOG_DIR}" - check_core_dumps - exit 1 - fi - asan_check "${LOG_DIR}" - valgrind_check "${LOG_DIR}" - check_core_dumps -} - -run_oldtests() { - ulimit -c unlimited - if ! make -C "${TRAVIS_BUILD_DIR}/src/nvim/testdir"; then - reset - asan_check "${LOG_DIR}" - valgrind_check "${LOG_DIR}" - check_core_dumps - exit 1 - fi - asan_check "${LOG_DIR}" - valgrind_check "${LOG_DIR}" - check_core_dumps -} - -install_nvim() { - ${MAKE_CMD} -C "${BUILD_DIR}" install - - "${INSTALL_PREFIX}/bin/nvim" --version - "${INSTALL_PREFIX}/bin/nvim" -u NONE -e -c ':help' -c ':qall' || { - echo "Running ':help' in the installed nvim failed." - echo "Maybe the helptags have not been generated properly." - exit 1 - } - - local genvimsynf=syntax/vim/generated.vim - # Check that all runtime files were installed - for file in doc/tags $genvimsynf $( - cd runtime ; git ls-files | grep -e '.vim$' -e '.ps$' -e '.dict$' -e '.py$' -e '.tutor$' - ) ; do - if ! test -e "${INSTALL_PREFIX}/share/nvim/runtime/$file" ; then - echo "It appears that $file is not installed." - exit 1 - fi - done - - # Check that generated syntax file has function names, #5060. - local gpat='syn keyword vimFuncName .*eval' - if ! grep -q "$gpat" "${INSTALL_PREFIX}/share/nvim/runtime/$genvimsynf"; then - echo "It appears that $genvimsynf does not contain $gpat." - exit 1 - fi - - for file in $( - cd runtime ; git ls-files | grep -e '.awk$' -e '.sh$' -e '.bat$' - ) ; do - if ! test -x "${INSTALL_PREFIX}/share/nvim/runtime/$file" ; then - echo "It appears that $file is not installed or is not executable." - exit 1 - fi - done -} diff --git a/.editorconfig b/.editorconfig index b08a27f2a2..ac902ecec5 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,6 +7,10 @@ end_of_line = lf insert_final_newline = true charset = utf_8 +[runtime/doc/*.txt] +indent_style = tab +indent_size = 8 + [Makefile] indent_style = tab tab_width = 4 diff --git a/.gitignore b/.gitignore index 3fb3d62517..ddbcc9c60d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,10 @@ # Build/deps dir /build/ +/cmake-build-debug/ /dist/ /.deps/ /tmp/ -*.rej -*.orig *.mo .*.sw? *~ @@ -18,6 +17,9 @@ tags /src/nvim/po/vim.pot /src/nvim/po/*.ck +# generated by tests with $NVIM_LOG_FILE set. +/.nvimlog + # Files generated by scripts/vim-patch.sh /.vim-src/ @@ -40,9 +42,6 @@ tags # generated by luacheck during `make testlint' /test/.luacheckcache -# luarocks, not added as a subtree because of the large number of blobs -/third-party/luarocks - # local make targets local.mk @@ -50,6 +49,3 @@ local.mk /runtime/doc/*.html /runtime/doc/tags.ref /runtime/doc/errors.log - -# clint errors, generated by `make lint` -/errors.json diff --git a/.travis.yml b/.travis.yml index d28fc9d7f1..2bab1635ad 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ env: # http://docs.travis-ci.com/user/speeding-up-the-build/#Paralellizing-your-build-on-one-VM - MAKE_CMD="make -j2" # Update PATH for pip. - - PATH="$(python2.7 -c 'import site; print(site.getuserbase())')/bin:/usr/lib/llvm-symbolizer-3.8/bin:$PATH" + - PATH="$(python2.7 -c 'import site; print(site.getuserbase())')/bin:/usr/lib/llvm-symbolizer-4.0/bin:$PATH" # Build directory for Neovim. - BUILD_DIR="$TRAVIS_BUILD_DIR/build" # Build directory for third-party dependencies. @@ -21,13 +21,15 @@ env: - INSTALL_PREFIX="$HOME/nvim-install" # Log directory for Clang sanitizers and Valgrind. - LOG_DIR="$BUILD_DIR/log" + # Nvim log file. + - NVIM_LOG_FILE="$BUILD_DIR/.nvimlog" # Default CMake flags. - CMAKE_FLAGS="-DTRAVIS_CI_BUILD=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX - -DBUSTED_OUTPUT_TYPE=gtest + -DBUSTED_OUTPUT_TYPE=nvim -DDEPS_PREFIX=$DEPS_BUILD_DIR/usr - -DMIN_LOG_LEVEL=2" + -DMIN_LOG_LEVEL=3" - DEPS_CMAKE_FLAGS="-DDEPS_DOWNLOAD_DIR:PATH=$DEPS_DOWNLOAD_DIR" # Additional CMake flags for 32-bit builds. - CMAKE_FLAGS_32BIT="-DCMAKE_SYSTEM_LIBRARY_PATH=/lib32:/usr/lib32:/usr/local/lib32 @@ -43,22 +45,20 @@ env: # If this file exists, we know that the cache contains compiled # dependencies and we can use it. - CACHE_MARKER="$HOME/.cache/nvim-deps/.travis_cache_marker" - # Test success marker. If this file exists, we know that all tests - # were successful. Required because we only want to update the cache - # if the tests were successful, but don't have this information - # available in before_cache (which is run before after_success). - - SUCCESS_MARKER="$BUILD_DIR/.tests_successful" # default target name for functional tests - FUNCTIONALTEST=functionaltest + - CI_TARGET=tests -matrix: +jobs: include: - - os: linux - env: CI_TARGET=lint - - os: linux - compiler: gcc-5 - env: GCOV=gcov-5 CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_GCOV=ON" - - os: linux + - stage: sanitizers + os: linux + compiler: clang-4.0 + env: > + CLANG_SANITIZER=ASAN_UBSAN + CMAKE_FLAGS="$CMAKE_FLAGS -DPREFER_LUA=ON" + - stage: normal builds + os: linux compiler: gcc-5 env: FUNCTIONALTEST=functionaltest-lua - os: linux @@ -67,40 +67,45 @@ matrix: # dependencies in a separate cache. compiler: gcc-5 -m32 env: BUILD_32BIT=ON - - os: linux - compiler: clang-3.8 - env: CLANG_SANITIZER=ASAN_UBSAN - - os: linux - compiler: clang-3.8 - env: CLANG_SANITIZER=TSAN - os: osx compiler: clang osx_image: xcode7.3 # macOS 10.11 - os: osx compiler: gcc-4.9 osx_image: xcode7.3 # macOS 10.11 + - stage: lint + os: linux + env: CI_TARGET=lint + - stage: Flaky builds + os: linux + compiler: gcc-5 + env: GCOV=gcov-5 CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_GCOV=ON" + - os: linux + compiler: clang-4.0 + env: CLANG_SANITIZER=TSAN allow_failures: - env: GCOV=gcov-5 CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_GCOV=ON" + - env: CLANG_SANITIZER=TSAN fast_finish: true -before_install: .ci/before_install.sh -install: .ci/install.sh -before_script: .ci/before_script.sh -script: .ci/script.sh -before_cache: .ci/before_cache.sh -after_success: .ci/after_success.sh +before_install: ci/before_install.sh +install: ci/install.sh +before_script: ci/before_script.sh +script: ci/script.sh +before_cache: ci/before_cache.sh +after_success: ci/after_success.sh addons: apt: sources: - ubuntu-toolchain-r-test - - llvm-toolchain-precise-3.8 + - llvm-toolchain-trusty-4.0 packages: - autoconf - automake - apport - build-essential - - clang-3.8 + - clang-4.0 - cmake - cscope - g++-5-multilib @@ -108,9 +113,11 @@ addons: - gcc-5-multilib - gcc-multilib - gdb + - language-pack-tr - libc6-dev-i386 - libtool - - llvm-3.8-dev + - llvm-4.0-dev + - locales - pkg-config - unzip - valgrind diff --git a/BSDmakefile b/BSDmakefile new file mode 100644 index 0000000000..93b7dc7f3d --- /dev/null +++ b/BSDmakefile @@ -0,0 +1,4 @@ +.DONE: + @echo "Please use GNU Make (gmake) to build neovim" +.DEFAULT: + @echo "Please use GNU Make (gmake) to build neovim" diff --git a/CMakeLists.txt b/CMakeLists.txt index 1a058f2bff..cad3ea6786 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,26 +51,26 @@ endif() # Set default build type. if(NOT CMAKE_BUILD_TYPE) - message(STATUS "CMAKE_BUILD_TYPE not given, defaulting to 'Dev'.") - set(CMAKE_BUILD_TYPE "Dev" CACHE STRING "Choose the type of build." FORCE) + message(STATUS "CMAKE_BUILD_TYPE not given, defaulting to 'Debug'.") + set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Choose the type of build." FORCE) endif() # Set available build types for CMake GUIs. # A different build type can still be set by -DCMAKE_BUILD_TYPE=... set_property(CACHE CMAKE_BUILD_TYPE PROPERTY - STRINGS "Debug" "Dev" "Release" "MinSizeRel" "RelWithDebInfo") + STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo") # If not in a git repo (e.g., a tarball) these tokens define the complete # version string, else they are combined with the result of `git describe`. set(NVIM_VERSION_MAJOR 0) set(NVIM_VERSION_MINOR 2) -set(NVIM_VERSION_PATCH 0) +set(NVIM_VERSION_PATCH 3) set(NVIM_VERSION_PRERELEASE "-dev") # for package maintainers # API level -set(NVIM_API_LEVEL 2) # Bump this after any API change. +set(NVIM_API_LEVEL 3) # Bump this after any API change. set(NVIM_API_LEVEL_COMPAT 0) # Adjust this after a _breaking_ API change. -set(NVIM_API_PRERELEASE true) +set(NVIM_API_PRERELEASE false) file(TO_CMAKE_PATH ${CMAKE_CURRENT_LIST_DIR}/.git FORCED_GIT_DIR) include(GetGitRevisionDescription) @@ -96,57 +96,34 @@ if(CMAKE_C_FLAGS_RELEASE MATCHES "-O3") string(REPLACE "-O3" "-O2" CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}") endif() -# Disable logging for release-type builds. -if(NOT CMAKE_C_FLAGS_RELEASE MATCHES DDISABLE_LOG) - set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DDISABLE_LOG") +# Minimize logging for release-type builds. +if(NOT CMAKE_C_FLAGS_RELEASE MATCHES DMIN_LOG_LEVEL) + set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DMIN_LOG_LEVEL=3") endif() -if(NOT CMAKE_C_FLAGS_MINSIZEREL MATCHES DDISABLE_LOG) - set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} -DDISABLE_LOG") +if(NOT CMAKE_C_FLAGS_MINSIZEREL MATCHES DMIN_LOG_LEVEL) + set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} -DMIN_LOG_LEVEL=3") endif() -if(NOT CMAKE_C_FLAGS_RELWITHDEBINFO MATCHES DDISABLE_LOG) - set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -DDISABLE_LOG") +if(NOT CMAKE_C_FLAGS_RELWITHDEBINFO MATCHES DMIN_LOG_LEVEL) + set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -DMIN_LOG_LEVEL=3") endif() -# Enable assertions for RelWithDebInfo. +if(CMAKE_COMPILER_IS_GNUCC) + check_c_compiler_flag(-Og HAS_OG_FLAG) +else() + set(HAS_OG_FLAG 0) +endif() + +# +# Build-type: RelWithDebInfo +# +if(HAS_OG_FLAG) + set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -Og -g") +endif() +# We _want_ assertions in RelWithDebInfo build-type. if(CMAKE_C_FLAGS_RELWITHDEBINFO MATCHES DNDEBUG) string(REPLACE "-DNDEBUG" "" CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO}") endif() -# Set build flags for custom Dev build type. -# -DNDEBUG purposely omitted because we want assertions. -if(MSVC) - SET(CMAKE_C_FLAGS_DEV "" - CACHE STRING "Flags used by the compiler during development (optimized, but with debug info and logging) builds." - FORCE) -else() - if(CMAKE_COMPILER_IS_GNUCC) - check_c_compiler_flag(-Og HAS_OG_FLAG) - else() - set(HAS_OG_FLAG 0) - endif() - - if(HAS_OG_FLAG) - set(CMAKE_C_FLAGS_DEV "-Og -g" - CACHE STRING "Flags used by the compiler during development (optimized, but with debug info and logging) builds." - FORCE) - else() - set(CMAKE_C_FLAGS_DEV "-O2 -g" - CACHE STRING "Flags used by the compiler during development (optimized, but with debug info and logging) builds." - FORCE) - endif() -endif() -SET(CMAKE_EXE_LINKER_FLAGS_DEV "" - CACHE STRING "Flags used for linking binaries during development (optimized, but with debug info and logging) builds." - FORCE) -SET(CMAKE_SHARED_LINKER_FLAGS_DEV "" - CACHE STRING "Flags used by the shared libraries linker during development (optimized, but with debug info and logging) builds." - FORCE) - -MARK_AS_ADVANCED( - CMAKE_C_FLAGS_DEV - CMAKE_EXE_LINKER_FLAGS_DEV - CMAKE_SHARED_LINKER_FLAGS_DEV) - # Enable -Wconversion. if(NOT MSVC) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wconversion") @@ -214,6 +191,16 @@ if(CMAKE_EXE_LINKER_FLAGS MATCHES "--sort-common" OR string(REGEX REPLACE "-Wl($| )" "" CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS}") endif() +check_c_source_compiles(" +#include +int main(void) +{ + void *trace[1]; + int trace_size = backtrace(trace, 1); + return 0; +} +" HAVE_EXECINFO_BACKTRACE) + if(MSVC) # XXX: /W4 gives too many warnings. #3241 add_definitions(/W3 -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE) @@ -221,9 +208,14 @@ else() add_definitions(-Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99) + check_c_compiler_flag(-Wimplicit-fallthrough HAS_WIMPLICIT_FALLTHROUGH_FLAG) + if(HAS_WIMPLICIT_FALLTHROUGH_FLAG) + add_definitions(-Wimplicit-fallthrough) + endif() + # On FreeBSD 64 math.h uses unguarded C11 extension, which taints clang # 3.4.1 used there. - if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") + if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" AND CMAKE_C_COMPILER_ID MATCHES "Clang") add_definitions(-Wno-c11-extensions) endif() endif() @@ -257,6 +249,17 @@ if(HAS_DIAG_COLOR_FLAG) add_definitions(-fdiagnostics-color=auto) endif() +if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.8.5") + # Array-bounds testing is broken in some GCC versions before 4.8.5. + # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56273 + check_c_compiler_flag(-Wno-array-bounds HAS_NO_ARRAY_BOUNDS_FLAG) + if(HAS_NO_ARRAY_BOUNDS_FLAG) + add_definitions(-Wno-array-bounds) + endif() + endif() +endif() + option(TRAVIS_CI_BUILD "Travis/QuickBuild CI. Extra flags will be set." OFF) if(TRAVIS_CI_BUILD) @@ -275,7 +278,6 @@ else() endif() add_definitions(-DINCLUDE_GENERATED_DECLARATIONS) -add_definitions(-DHAVE_CONFIG_H) if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_SYSTEM_NAME STREQUAL "Linux") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--no-undefined") @@ -310,16 +312,55 @@ include_directories(SYSTEM ${LIBUV_INCLUDE_DIRS}) find_package(Msgpack 1.0.0 REQUIRED) include_directories(SYSTEM ${MSGPACK_INCLUDE_DIRS}) -if(UNIX) - option(FEAT_TUI "Enable the Terminal UI" ON) +# Note: The test lib requires LuaJIT; it will be skipped if LuaJIT is missing. +option(PREFER_LUA "Prefer Lua over LuaJIT in the nvim executable." OFF) + +if(PREFER_LUA) + find_package(Lua REQUIRED) + set(LUA_PREFERRED_INCLUDE_DIRS ${LUA_INCLUDE_DIR}) + set(LUA_PREFERRED_LIBRARIES ${LUA_LIBRARIES}) + find_package(LuaJit) else() - option(FEAT_TUI "Enable the Terminal UI" OFF) + find_package(LuaJit REQUIRED) + set(LUA_PREFERRED_INCLUDE_DIRS ${LUAJIT_INCLUDE_DIRS}) + set(LUA_PREFERRED_LIBRARIES ${LUAJIT_LIBRARIES}) endif() +list(APPEND CMAKE_REQUIRED_INCLUDES "${MSGPACK_INCLUDE_DIRS}") +check_c_source_compiles(" +#include + +int +main(void) +{ + return MSGPACK_OBJECT_FLOAT32; +} +" MSGPACK_HAS_FLOAT32) +if(MSGPACK_HAS_FLOAT32) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNVIM_MSGPACK_HAS_FLOAT32") +endif() + +option(FEAT_TUI "Enable the Terminal UI" ON) + if(FEAT_TUI) find_package(Unibilium REQUIRED) include_directories(SYSTEM ${UNIBILIUM_INCLUDE_DIRS}) + list(APPEND CMAKE_REQUIRED_INCLUDES "${UNIBILIUM_INCLUDE_DIRS}") + list(APPEND CMAKE_REQUIRED_LIBRARIES "${UNIBILIUM_LIBRARIES}") + check_c_source_compiles(" + #include + + int + main(void) + { + return unibi_num_from_var(unibi_var_from_num(0)); + } + " UNIBI_HAS_VAR_FROM) + if(UNIBI_HAS_VAR_FROM) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DNVIM_UNIBI_HAS_VAR_FROM") + endif() + find_package(LibTermkey REQUIRED) include_directories(SYSTEM ${LIBTERMKEY_INCLUDE_DIRS}) endif() @@ -327,6 +368,11 @@ endif() find_package(LibVterm REQUIRED) include_directories(SYSTEM ${LIBVTERM_INCLUDE_DIRS}) +if(WIN32) + find_package(Winpty REQUIRED) + include_directories(SYSTEM ${WINPTY_INCLUDE_DIRS}) +endif() + option(CLANG_ASAN_UBSAN "Enable Clang address & undefined behavior sanitizer for nvim binary." OFF) option(CLANG_MSAN "Enable Clang memory sanitizer for nvim binary." OFF) option(CLANG_TSAN "Enable Clang thread sanitizer for nvim binary." OFF) @@ -416,11 +462,7 @@ message(STATUS "Using the Lua interpreter ${LUA_PRG}.") find_program(BUSTED_PRG NAMES busted busted.bat) find_program(BUSTED_LUA_PRG busted-lua) if(NOT BUSTED_OUTPUT_TYPE) - if(WIN32) - set(BUSTED_OUTPUT_TYPE "plainTerminal") - else() - set(BUSTED_OUTPUT_TYPE "utfTerminal") - endif() + set(BUSTED_OUTPUT_TYPE "nvim") endif() find_program(LUACHECK_PRG luacheck) @@ -431,26 +473,24 @@ include(InstallHelpers) file(GLOB MANPAGES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} man/nvim.1) - install_helper( FILES ${MANPAGES} DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) # MIN_LOG_LEVEL for log.h -if(DEFINED MIN_LOG_LEVEL) +if("${MIN_LOG_LEVEL}" MATCHES "^$") + message(STATUS "MIN_LOG_LEVEL not specified") +else() if(NOT MIN_LOG_LEVEL MATCHES "^[0-3]$") - message(FATAL_ERROR "MIN_LOG_LEVEL must be a number 0-3") + message(FATAL_ERROR "invalid MIN_LOG_LEVEL: " ${MIN_LOG_LEVEL}) endif() message(STATUS "MIN_LOG_LEVEL set to ${MIN_LOG_LEVEL}") -else() - message(STATUS "MIN_LOG_LEVEL not specified, defaulting to INFO(1)") endif() # Go down the tree. add_subdirectory(src/nvim) -# Read compilation flags from src/nvim, -# used in config subdirectory below. +# Read compilation flags from src/nvim, used in config subdirectory below. include(GetCompileFlags) get_compile_flags(NVIM_VERSION_CFLAGS) @@ -576,9 +616,26 @@ if(LUACHECK_PRG) add_custom_target(testlint COMMAND ${CMAKE_COMMAND} -DLUACHECK_PRG=${LUACHECK_PRG} - -DTEST_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test + -DLUAFILES_DIR=${CMAKE_CURRENT_SOURCE_DIR}/test + -DIGNORE_PATTERN="*/preload.lua" -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME} - -P ${PROJECT_SOURCE_DIR}/cmake/RunTestsLint.cmake) + -P ${PROJECT_SOURCE_DIR}/cmake/RunLuacheck.cmake) + + add_custom_target( + blobcodelint + COMMAND + ${CMAKE_COMMAND} + -DLUACHECK_PRG=${LUACHECK_PRG} + -DLUAFILES_DIR=${CMAKE_CURRENT_SOURCE_DIR}/src/nvim/lua + -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME} + -DREAD_GLOBALS=vim + -P ${PROJECT_SOURCE_DIR}/cmake/RunLuacheck.cmake + ) + # TODO(ZyX-I): Run linter for all lua code in src + add_custom_target( + lualint + DEPENDS blobcodelint + ) endif() set(CPACK_PACKAGE_NAME "Neovim") diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f7389ece75..20bce8ca62 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,10 +6,16 @@ Getting started If you want to help but don't know where to start, here are some low-risk/isolated tasks: -- Help us [review pull requests](#reviewing)! -- Merge a [Vim patch]. +- [Merge a Vim patch]. - Try a [complexity:low] issue. -- Fix [clang-scan] or [coverity](#coverity) warnings. +- Fix bugs found by [clang scan-build](#clang-scan-build), + [coverity](#coverity), and [PVS](#pvs-studio). + +Developer guidelines +-------------------- + +- Nvim developers should read `:help dev-help`. +- External UI developers should read `:help dev-ui`. Reporting problems ------------------ @@ -17,26 +23,33 @@ Reporting problems - Check the [**FAQ**][wiki-faq]. - Search [existing issues][github-issues] (including closed!) - Update Neovim to the latest version to see if your problem persists. -- If you're using a plugin manager, comment out your plugins, then add them back - in one by one, to narrow down the cause of the issue. -- Crash reports which include a stacktrace are 10x more valuable. -- [Bisecting][git-bisect] to the cause of a regression often leads to an - immediate fix. +- Disable plugins incrementally, to narrow down the cause of the issue. +- When reporting a crash, include a stacktrace. +- [Bisect][git-bisect] to the cause of a regression, if you are able. This is _extremely_ helpful. +- Check `$NVIM_LOG_FILE`, if it exists. +- Include `cmake --system-information` for **build** issues. Pull requests ("PRs") --------------------- -- To avoid duplicate work, you may want to create a `[WIP]` pull request so that - others know what you are working on. -- Avoid cosmetic changes to unrelated files in the same commit: extra noise - makes reviews more difficult. +- To avoid duplicate work, create a `[WIP]` pull request as soon as possible. +- Avoid cosmetic changes to unrelated files in the same commit. - Use a [feature branch][git-feature-branch] instead of the master branch. -- [Rebase your feature branch][git-rebasing] onto (upstream) master before - opening the PR. -- After addressing the review comments, it's fine to rebase and force-push to - your review. -- Try to [tidy your history][git-history-rewriting]: combine related commits - with interactive rebasing, separate monolithic commits, etc. +- Use a **rebase workflow** for small PRs. + - After addressing review comments, it's fine to rebase and force-push. +- Use a **merge workflow** for big, high-risk PRs. + - Merge `master` into your PR when there are conflicts or when master + introduces breaking changes. + - Use the `ri` git alias: + ``` + [alias] + ri = "!sh -c 't=\"${1:-master}\"; s=\"${2:-HEAD}\"; mb=\"$(git merge-base \"$t\" \"$s\")\"; if test \"x$mb\" = x ; then o=\"$t\"; else lm=\"$(git log -n1 --merges \"$t..$s\" --pretty=%H)\"; if test \"x$lm\" = x ; then o=\"$mb\"; else o=\"$lm\"; fi; fi; test $# -gt 0 && shift; test $# -gt 0 && shift; git rebase --interactive \"$o\" \"$@\"'" + ``` + This avoids unnecessary rebases yet still allows you to combine related + commits, separate monolithic commits, etc. + - Do not edit commits that come before the merge commit. +- During a squash/fixup, use `exec make -C build unittest` between each + pick/edit/reword. ### Stages: WIP, RFC, RDY @@ -73,16 +86,18 @@ the VCS/git logs more valuable. ### Automated builds (CI) -Each pull request must pass the automated builds ([travis CI] and [quickbuild]). +Each pull request must pass the automated builds on [travis CI], [quickbuild] +and [AppVeyor]. -- CI builds are compiled with [`-Werror`][gcc-warnings], so if your PR - introduces any compiler warnings, the build will fail. +- CI builds are compiled with [`-Werror`][gcc-warnings], so compiler warnings + will fail the build. - If any tests fail, the build will fail. See [Building Neovim#running-tests][wiki-run-tests] to run tests locally. Passing locally doesn't guarantee passing the CI build, because of the different compilers and platforms tested against. -- CI runs [ASan] and other analyzers. To run valgrind locally: - `VALGRIND=1 make test` +- CI runs [ASan] and other analyzers. + - To run valgrind locally: `VALGRIND=1 make test` + - To run Clang ASan/UBSan locally: `CC=clang make CMAKE_FLAGS="-DCLANG_ASAN_UBSAN=ON"` - The `lint` build ([#3174][3174]) checks modified lines _and their immediate neighbors_. This is to encourage incrementally updating the legacy style to meet our style guidelines. @@ -99,11 +114,19 @@ QuickBuild uses this invocation: VERBOSE=1 nvim unittest-prereqs functionaltest-prereqs +### Clang scan-build + +The auto-generated [clang-scan] report presents walk-throughs of bugs found by +Clang's [scan-build](https://clang-analyzer.llvm.org/scan-build.html) static +analyzer. To verify a fix locally, run `scan-build` like this: + + rm -rf build/ + scan-build --use-analyzer=/usr/bin/clang make + ### Coverity [Coverity](https://scan.coverity.com/projects/neovim-neovim) runs against the -master build. If you want to view the defects, just request access at the -_Contributor_ level. An Admin will grant you permission. +master build. To view the defects, just request access; you will be approved. Use this commit-message format for coverity fixes: @@ -111,6 +134,12 @@ Use this commit-message format for coverity fixes: where `` is the Coverity ID (CID). For example see [#804](https://github.com/neovim/neovim/pull/804). +### PVS-Studio + +View the [PVS analysis report](https://neovim.io/doc/reports/pvs/) to see bugs +found by [PVS Studio](https://www.viva64.com/en/pvs-studio/). +You can run `scripts/pvscheck.sh` locally to run PVS on your machine. + Reviewing --------- @@ -145,6 +174,7 @@ as context, use the `-W` argument as well. [3174]: https://github.com/neovim/neovim/issues/3174 [travis CI]: https://travis-ci.org/neovim/neovim [quickbuild]: http://neovim-qb.szakmeister.net/dashboard -[Vim patch]: https://github.com/neovim/neovim/wiki/Merging-patches-from-upstream-Vim +[AppVeyor]: https://ci.appveyor.com/project/neovim/neovim +[Merge a Vim patch]: https://github.com/neovim/neovim/wiki/Merging-patches-from-upstream-Vim [clang-scan]: https://neovim.io/doc/reports/clang/ [complexity:low]: https://github.com/neovim/neovim/issues?q=is%3Aopen+is%3Aissue+label%3Acomplexity%3Alow diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md index 011739396d..1a7268a51e 100644 --- a/ISSUE_TEMPLATE.md +++ b/ISSUE_TEMPLATE.md @@ -1,16 +1,19 @@ + + - `nvim --version`: - Vim (version: ) behaves differently? - Operating system/version: - Terminal name/version: - `$TERM`: -### Actual behaviour - -### Expected behaviour - ### Steps to reproduce using `nvim -u NORC` ``` nvim -u NORC ``` + +### Actual behaviour + +### Expected behaviour + diff --git a/Makefile b/Makefile index fed84582a9..e349cc4d0f 100644 --- a/Makefile +++ b/Makefile @@ -107,6 +107,9 @@ functionaltest-lua: | nvim testlint: | build/.ran-cmake deps $(BUILD_CMD) -C build testlint +lualint: | build/.ran-cmake deps + $(BUILD_CMD) -C build lualint + unittest: | nvim +$(BUILD_CMD) -C build unittest @@ -126,12 +129,18 @@ distclean: clean install: | nvim +$(BUILD_CMD) -C build install -clint: - $(CMAKE_PRG) -DLINT_PRG=./src/clint.py \ - -DLINT_DIR=src \ - -DLINT_SUPPRESS_URL="$(DOC_DOWNLOAD_URL_BASE)$(CLINT_ERRORS_FILE_PATH)" \ - -P cmake/RunLint.cmake +clint: build/.ran-cmake + +$(BUILD_CMD) -C build clint -lint: clint testlint +clint-full: build/.ran-cmake + +$(BUILD_CMD) -C build clint-full -.PHONY: test testlint functionaltest unittest lint clint clean distclean nvim libnvim cmake deps install +check-single-includes: build/.ran-cmake + +$(BUILD_CMD) -C build check-single-includes + +appimage: + bash scripts/genappimage.sh + +lint: check-single-includes clint testlint lualint + +.PHONY: test testlint lualint functionaltest unittest lint clint clean distclean nvim libnvim cmake deps install appimage diff --git a/README.md b/README.md index dcead08331..454137219f 100644 --- a/README.md +++ b/README.md @@ -8,11 +8,13 @@ [![Travis Build Status](https://travis-ci.org/neovim/neovim.svg?branch=master)](https://travis-ci.org/neovim/neovim) [![AppVeyor Build status](https://ci.appveyor.com/api/projects/status/urdqjrik5u521fac/branch/master?svg=true)](https://ci.appveyor.com/project/neovim/neovim/branch/master) -[![Pull requests waiting for review](https://badge.waffle.io/neovim/neovim.svg?label=RFC&title=RFCs)](https://waffle.io/neovim/neovim) -[![Coverage Status](https://img.shields.io/coveralls/neovim/neovim.svg)](https://coveralls.io/r/neovim/neovim) +[![codecov](https://img.shields.io/codecov/c/github/neovim/neovim.svg)](https://codecov.io/gh/neovim/neovim) [![Coverity Scan Build](https://scan.coverity.com/projects/2227/badge.svg)](https://scan.coverity.com/projects/2227) [![Clang Scan Build](https://neovim.io/doc/reports/clang/badge.svg)](https://neovim.io/doc/reports/clang) -Debian +[![PVS-studio Check](https://neovim.io/doc/reports/pvs/badge.svg)](https://neovim.io/doc/reports/pvs) + +[![Debian CI](https://badges.debian.net/badges/debian/testing/neovim/version.svg)](https://buildd.debian.org/neovim) +[![Downloads](https://img.shields.io/github/downloads/neovim/neovim/total.svg?maxAge=2592000)](https://github.com/neovim/neovim/releases/) Neovim is a project that seeks to aggressively refactor Vim in order to: @@ -32,39 +34,58 @@ Install from source make CMAKE_BUILD_TYPE=RelWithDebInfo sudo make install +To install to a non-default location, specify `CMAKE_INSTALL_PREFIX`: + + make CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX=/full/path/" + make install + See [the wiki](https://github.com/neovim/neovim/wiki/Building-Neovim) for details. Install from package -------------------- -Packages are in [Homebrew], [Debian], [Ubuntu], [Fedora], [Arch Linux], and -[more](https://github.com/neovim/neovim/wiki/Installing-Neovim). +Pre-built packages for Windows, macOS, and Linux are found at the +[Releases](https://github.com/neovim/neovim/releases/) page. + +Managed packages are in [Homebrew], [Debian], [Ubuntu], [Fedora], [Arch Linux], [Gentoo], +and [more](https://github.com/neovim/neovim/wiki/Installing-Neovim)! Project layout -------------- -- `.ci/`: Build server scripts -- `cmake/`: Build scripts -- `runtime/`: Application files -- [`src/`](src/nvim/README.md): Application source code -- `third-party/`: CMake sub-project to build third-party dependencies (if the - `USE_BUNDLED_DEPS` flag is undefined or `USE_BUNDLED` CMake option is false). -- [`test/`](test/README.md): Test files + ├─ ci/ build automation + ├─ cmake/ build scripts + ├─ runtime/ user plugins/docs + ├─ src/ application source code (see src/nvim/README.md) + │ ├─ api/ API subsystem + │ ├─ eval/ VimL subsystem + │ ├─ event/ event-loop subsystem + │ ├─ generators/ code generation (pre-compilation) + │ ├─ lib/ generic data structures + │ ├─ lua/ lua subsystem + │ ├─ msgpack_rpc/ RPC subsystem + │ ├─ os/ low-level platform code + │ └─ tui/ built-in UI + ├─ third-party/ cmake subproject to build dependencies + └─ test/ tests (see test/README.md) -What's been done so far ------------------------ +- To disable `third-party/` specify `USE_BUNDLED_DEPS=NO` or `USE_BUNDLED=NO` + (CMake option). -- RPC API based on [MessagePack](https://msgpack.org) -- Embedded [terminal emulator](https://neovim.io/doc/user/nvim_terminal_emulator.html) +Features +-------- + +- Modern [GUIs](https://github.com/neovim/neovim/wiki/Related-projects#gui) +- [API](https://github.com/neovim/neovim/wiki/Related-projects#api-clients) + access from any language including clojure, lisp, go, haskell, lua, + javascript, perl, python, ruby, rust. +- Embedded, scriptable [terminal emulator](https://neovim.io/doc/user/nvim_terminal_emulator.html) - Asynchronous [job control](https://github.com/neovim/neovim/pull/2247) - [Shared data (shada)](https://github.com/neovim/neovim/pull/2506) among multiple editor instances - [XDG base directories](https://github.com/neovim/neovim/pull/3470) support -- [libuv](https://github.com/libuv/libuv/)-based platform/OS layer -- [Pushdown automaton](https://github.com/neovim/neovim/pull/3413) input model -- 1000s of new tests -- Legacy tests converted to Lua tests +- Compatible with most Vim plugins, including Ruby and Python plugins. -See [`:help nvim-features`][nvim-features] for a comprehensive list. +See [`:help nvim-features`][nvim-features] for the full list! License ------- @@ -95,11 +116,12 @@ See `LICENSE` for details. [license-commit]: https://github.com/neovim/neovim/commit/b17d9691a24099c9210289f16afb1a498a89d803 [nvim-features]: https://neovim.io/doc/user/vim_diff.html#nvim-features [Roadmap]: https://neovim.io/roadmap/ -[advanced UIs]: https://github.com/neovim/neovim/wiki/Related-projects#gui-projects +[advanced UIs]: https://github.com/neovim/neovim/wiki/Related-projects#gui [Homebrew]: https://github.com/neovim/homebrew-neovim#installation [Debian]: https://packages.debian.org/testing/neovim [Ubuntu]: http://packages.ubuntu.com/search?keywords=neovim [Fedora]: https://admin.fedoraproject.org/pkgdb/package/rpms/neovim [Arch Linux]: https://www.archlinux.org/packages/?q=neovim +[Gentoo]: https://packages.gentoo.org/packages/app-editors/neovim diff --git a/appveyor.yml b/appveyor.yml index ed5e06e3ee..2d6135c7a2 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,13 +1,19 @@ version: '{build}' +environment: + APPVEYOR_CACHE_ENTRY_ZIP_ARGS: "-t7z -m0=lzma -mx=9" configuration: - MINGW_64 - MINGW_32 +- MINGW_64-gcov +matrix: + allow_failures: + - configuration: MINGW_64-gcov install: [] build_script: -- call .ci\build.bat +- call ci\build.bat cache: -- C:\msys64\var\cache\pacman\pkg -> .ci\build.bat -- .deps -> third-party/CMakeLists.txt +- C:\msys64\var\cache\pacman\pkg -> ci\build.bat +- .deps -> third-party\** artifacts: - path: build/Neovim.zip - path: build/bin/nvim.exe diff --git a/busted/outputHandlers/TAP.lua b/busted/outputHandlers/TAP.lua new file mode 100644 index 0000000000..ff93a7cc75 --- /dev/null +++ b/busted/outputHandlers/TAP.lua @@ -0,0 +1,92 @@ +-- TODO(jkeyes): remove this and use the upstream version as soon as it is +-- available in a release of busted. + +local pretty = require 'pl.pretty' + +return function(options) + local busted = require 'busted' + local handler = require 'busted.outputHandlers.base'() + + local success = 'ok %u - %s' + local failure = 'not ' .. success + local skip = 'ok %u - # SKIP %s' + local counter = 0 + + handler.suiteReset = function() + counter = 0 + return nil, true + end + + handler.suiteEnd = function() + print('1..' .. counter) + io.flush() + return nil, true + end + + local function showFailure(t) + local message = t.message + local trace = t.trace or {} + + if message == nil then + message = 'Nil error' + elseif type(message) ~= 'string' then + message = pretty.write(message) + end + + print(failure:format(counter, t.name)) + print('# ' .. t.element.trace.short_src .. ' @ ' .. t.element.trace.currentline) + if t.randomseed then print('# Random seed: ' .. t.randomseed) end + print('# Failure message: ' .. message:gsub('\n', '\n# ')) + if options.verbose and trace.traceback then + print('# ' .. trace.traceback:gsub('^\n', '', 1):gsub('\n', '\n# ')) + end + end + + handler.testStart = function(element, parent) + local trace = element.trace + if options.verbose and trace and trace.short_src then + local fileline = trace.short_src .. ' @ ' .. trace.currentline .. ': ' + local testName = fileline .. handler.getFullName(element) + print('# ' .. testName) + end + io.flush() + + return nil, true + end + + handler.testEnd = function(element, parent, status, trace) + counter = counter + 1 + if status == 'success' then + local t = handler.successes[#handler.successes] + print(success:format(counter, t.name)) + elseif status == 'pending' then + local t = handler.pendings[#handler.pendings] + print(skip:format(counter, (t.message or t.name))) + elseif status == 'failure' then + showFailure(handler.failures[#handler.failures]) + elseif status == 'error' then + showFailure(handler.errors[#handler.errors]) + end + io.flush() + + return nil, true + end + + handler.error = function(element, parent, message, debug) + if element.descriptor ~= 'it' then + counter = counter + 1 + showFailure(handler.errors[#handler.errors]) + end + io.flush() + + return nil, true + end + + busted.subscribe({ 'suite', 'reset' }, handler.suiteReset) + busted.subscribe({ 'suite', 'end' }, handler.suiteEnd) + busted.subscribe({ 'test', 'start' }, handler.testStart, { predicate = handler.cancelOnPending }) + busted.subscribe({ 'test', 'end' }, handler.testEnd, { predicate = handler.cancelOnPending }) + busted.subscribe({ 'error' }, handler.error) + + return handler +end diff --git a/busted/outputHandlers/nvim.lua b/busted/outputHandlers/nvim.lua new file mode 100644 index 0000000000..b612ead070 --- /dev/null +++ b/busted/outputHandlers/nvim.lua @@ -0,0 +1,305 @@ +local s = require 'say' +local pretty = require 'pl.pretty' +local term = require 'term' + +local colors + +local isWindows = package.config:sub(1,1) == '\\' + +if isWindows then + colors = setmetatable({}, {__index = function() return function(s) return s end end}) +else + colors = require 'term.colors' +end + +return function(options) + local busted = require 'busted' + local handler = require 'busted.outputHandlers.base'() + + local c = { + succ = function(s) return colors.bright(colors.green(s)) end, + skip = function(s) return colors.bright(colors.yellow(s)) end, + fail = function(s) return colors.bright(colors.magenta(s)) end, + errr = function(s) return colors.bright(colors.red(s)) end, + test = tostring, + file = colors.cyan, + time = colors.dim, + note = colors.yellow, + sect = function(s) return colors.green(colors.dim(s)) end, + nmbr = colors.bright, + } + + local repeatSuiteString = '\nRepeating all tests (run %d of %d) . . .\n\n' + local randomizeString = c.note('Note: Randomizing test order with a seed of %d.\n') + local globalSetup = c.sect('[----------]') .. ' Global test environment setup.\n' + local fileStartString = c.sect('[----------]') .. ' Running tests from ' .. c.file('%s') .. '\n' + local runString = c.sect('[ RUN ]') .. ' ' .. c.test('%s') .. ': ' + local successString = c.succ('OK') .. '\n' + local skippedString = c.skip('SKIP') .. '\n' + local failureString = c.fail('FAIL') .. '\n' + local errorString = c.errr('ERR') .. '\n' + local fileEndString = c.sect('[----------]') .. ' '.. c.nmbr('%d') .. ' %s from ' .. c.file('%s') .. ' ' .. c.time('(%.2f ms total)') .. '\n\n' + local globalTeardown = c.sect('[----------]') .. ' Global test environment teardown.\n' + local suiteEndString = c.sect('[==========]') .. ' ' .. c.nmbr('%d') .. ' %s from ' .. c.nmbr('%d') .. ' test %s ran. ' .. c.time('(%.2f ms total)') .. '\n' + local successStatus = c.succ('[ PASSED ]') .. ' ' .. c.nmbr('%d') .. ' %s.\n' + local timeString = c.time('%.2f ms') + + local summaryStrings = { + skipped = { + header = c.skip('[ SKIPPED ]') .. ' ' .. c.nmbr('%d') .. ' %s, listed below:\n', + test = c.skip('[ SKIPPED ]') .. ' %s\n', + footer = ' ' .. c.nmbr('%d') .. ' SKIPPED %s\n', + }, + + failure = { + header = c.fail('[ FAILED ]') .. ' ' .. c.nmbr('%d') .. ' %s, listed below:\n', + test = c.fail('[ FAILED ]') .. ' %s\n', + footer = ' ' .. c.nmbr('%d') .. ' FAILED %s\n', + }, + + error = { + header = c.errr('[ ERROR ]') .. ' ' .. c.nmbr('%d') .. ' %s, listed below:\n', + test = c.errr('[ ERROR ]') .. ' %s\n', + footer = ' ' .. c.nmbr('%d') .. ' %s\n', + }, + } + + c = nil + + local fileCount = 0 + local fileTestCount = 0 + local testCount = 0 + local successCount = 0 + local skippedCount = 0 + local failureCount = 0 + local errorCount = 0 + + local pendingDescription = function(pending) + local name = pending.name + local string = '' + + if type(pending.message) == 'string' then + string = string .. pending.message .. '\n' + elseif pending.message ~= nil then + string = string .. pretty.write(pending.message) .. '\n' + end + + return string + end + + local failureDescription = function(failure) + local string = failure.randomseed and ('Random seed: ' .. failure.randomseed .. '\n') or '' + if type(failure.message) == 'string' then + string = string .. failure.message + elseif failure.message == nil then + string = string .. 'Nil error' + else + string = string .. pretty.write(failure.message) + end + + string = string .. '\n' + + if options.verbose and failure.trace and failure.trace.traceback then + string = string .. failure.trace.traceback .. '\n' + end + + return string + end + + local getFileLine = function(element) + local fileline = '' + if element.trace or element.trace.short_src then + fileline = colors.cyan(element.trace.short_src) .. ' @ ' .. + colors.cyan(element.trace.currentline) .. ': ' + end + return fileline + end + + local getTestList = function(status, count, list, getDescription) + local string = '' + local header = summaryStrings[status].header + if count > 0 and header then + local tests = (count == 1 and 'test' or 'tests') + local errors = (count == 1 and 'error' or 'errors') + string = header:format(count, status == 'error' and errors or tests) + + local testString = summaryStrings[status].test + if testString then + for _, t in ipairs(list) do + local fullname = getFileLine(t.element) .. colors.bright(t.name) + string = string .. testString:format(fullname) + string = string .. getDescription(t) + end + end + end + return string + end + + local getSummary = function(status, count) + local string = '' + local footer = summaryStrings[status].footer + if count > 0 and footer then + local tests = (count == 1 and 'TEST' or 'TESTS') + local errors = (count == 1 and 'ERROR' or 'ERRORS') + string = footer:format(count, status == 'error' and errors or tests) + end + return string + end + + local getSummaryString = function() + local tests = (successCount == 1 and 'test' or 'tests') + local string = successStatus:format(successCount, tests) + + string = string .. getTestList('skipped', skippedCount, handler.pendings, pendingDescription) + string = string .. getTestList('failure', failureCount, handler.failures, failureDescription) + string = string .. getTestList('error', errorCount, handler.errors, failureDescription) + + string = string .. ((skippedCount + failureCount + errorCount) > 0 and '\n' or '') + string = string .. getSummary('skipped', skippedCount) + string = string .. getSummary('failure', failureCount) + string = string .. getSummary('error', errorCount) + + return string + end + + handler.suiteReset = function() + fileCount = 0 + fileTestCount = 0 + testCount = 0 + successCount = 0 + skippedCount = 0 + failureCount = 0 + errorCount = 0 + + return nil, true + end + + handler.suiteStart = function(suite, count, total, randomseed) + if total > 1 then + io.write(repeatSuiteString:format(count, total)) + end + if randomseed then + io.write(randomizeString:format(randomseed)) + end + io.write(globalSetup) + io.flush() + + return nil, true + end + + local function getElapsedTime(tbl) + if tbl.duration then + return tbl.duration * 1000 + else + return tonumber('nan') + end + end + + handler.suiteEnd = function(suite, count, total) + local elapsedTime_ms = getElapsedTime(suite) + local tests = (testCount == 1 and 'test' or 'tests') + local files = (fileCount == 1 and 'file' or 'files') + io.write(globalTeardown) + io.write(suiteEndString:format(testCount, tests, fileCount, files, elapsedTime_ms)) + io.write(getSummaryString()) + io.flush() + + return nil, true + end + + handler.fileStart = function(file) + fileTestCount = 0 + io.write(fileStartString:format(file.name)) + io.flush() + return nil, true + end + + handler.fileEnd = function(file) + local elapsedTime_ms = getElapsedTime(file) + local tests = (fileTestCount == 1 and 'test' or 'tests') + fileCount = fileCount + 1 + io.write(fileEndString:format(fileTestCount, tests, file.name, elapsedTime_ms)) + io.flush() + return nil, true + end + + handler.testStart = function(element, parent) + io.write(runString:format(handler.getFullName(element))) + io.flush() + + return nil, true + end + + handler.testEnd = function(element, parent, status, debug) + local elapsedTime_ms = getElapsedTime(element) + local string + + fileTestCount = fileTestCount + 1 + testCount = testCount + 1 + if status == 'success' then + successCount = successCount + 1 + string = successString + elseif status == 'pending' then + skippedCount = skippedCount + 1 + string = skippedString + elseif status == 'failure' then + failureCount = failureCount + 1 + string = nil + elseif status == 'error' then + errorCount = errorCount + 1 + string = nil + end + + if string ~= nil then + if elapsedTime_ms == elapsedTime_ms then + string = timeString:format(elapsedTime_ms) .. ' ' .. string + end + io.write(string) + io.flush() + end + + return nil, true + end + + handler.testFailure = function(element, parent, message, debug) + io.write(failureString) + io.flush() + + io.write(failureDescription(handler.failures[#handler.failures])) + io.flush() + return nil, true + end + + handler.testError = function(element, parent, message, debug) + io.write(errorString) + io.flush() + + io.write(failureDescription(handler.errors[#handler.errors])) + io.flush() + return nil, true + end + + handler.error = function(element, parent, message, debug) + if element.descriptor ~= 'it' then + io.write(failureDescription(handler.errors[#handler.errors])) + io.flush() + errorCount = errorCount + 1 + end + + return nil, true + end + + busted.subscribe({ 'suite', 'reset' }, handler.suiteReset) + busted.subscribe({ 'suite', 'start' }, handler.suiteStart) + busted.subscribe({ 'suite', 'end' }, handler.suiteEnd) + busted.subscribe({ 'file', 'start' }, handler.fileStart) + busted.subscribe({ 'file', 'end' }, handler.fileEnd) + busted.subscribe({ 'test', 'start' }, handler.testStart, { predicate = handler.cancelOnPending }) + busted.subscribe({ 'test', 'end' }, handler.testEnd, { predicate = handler.cancelOnPending }) + busted.subscribe({ 'failure', 'it' }, handler.testFailure) + busted.subscribe({ 'error', 'it' }, handler.testError) + busted.subscribe({ 'failure' }, handler.error) + busted.subscribe({ 'error' }, handler.error) + + return handler +end diff --git a/.ci/after_success.sh b/ci/after_success.sh similarity index 69% rename from .ci/after_success.sh rename to ci/after_success.sh index 0215eb139b..388b6eb714 100755 --- a/.ci/after_success.sh +++ b/ci/after_success.sh @@ -5,4 +5,5 @@ set -o pipefail if [[ -n "${GCOV}" ]]; then coveralls --gcov "$(which "${GCOV}")" --encoding iso-8859-1 || echo 'coveralls upload failed.' + bash <(curl -s https://codecov.io/bash) || echo 'codecov upload failed.' fi diff --git a/.ci/before_cache.sh b/ci/before_cache.sh similarity index 78% rename from .ci/before_cache.sh rename to ci/before_cache.sh index dd1fcf2bf7..3d7cc0ec5a 100755 --- a/.ci/before_cache.sh +++ b/ci/before_cache.sh @@ -3,12 +3,15 @@ set -e set -o pipefail +CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +source "${CI_DIR}/common/suite.sh" + # Don't cache pip's log and selfcheck. rm -rf "${HOME}/.cache/pip/log" rm -f "${HOME}/.cache/pip/selfcheck.json" # Update the third-party dependency cache only if the build was successful. -if [[ -f "${SUCCESS_MARKER}" ]]; then +if ended_successfully; then rm -rf "${HOME}/.cache/nvim-deps" mv "${DEPS_BUILD_DIR}" "${HOME}/.cache/nvim-deps" touch "${CACHE_MARKER}" diff --git a/ci/before_install.sh b/ci/before_install.sh new file mode 100755 index 0000000000..f84ad935bc --- /dev/null +++ b/ci/before_install.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash + +set -e +set -o pipefail + +if [[ "${CI_TARGET}" == lint ]]; then + exit +fi + +if [[ "${TRAVIS_OS_NAME}" == osx ]]; then + brew update +fi + +echo 'python info:' +( + 2>&1 python --version || true + 2>&1 python2 --version || true + 2>&1 python3 --version || true + 2>&1 pip --version || true + 2>&1 pip2 --version || true + 2>&1 pip3 --version || true + echo 'pyenv versions:' + 2>&1 pyenv versions || true +) | sed 's/^/ /' + +echo "Upgrade Python 2 pip." +pip2.7 -q install --user --upgrade pip + +if [[ "${TRAVIS_OS_NAME}" == osx ]]; then + echo "Install Python 3." + brew install python3 + echo "Upgrade Python 3 pip." + pip3 -q install --user --upgrade pip +else + echo "Upgrade Python 3 pip." + # Allow failure. pyenv pip3 on travis is broken: + # https://github.com/travis-ci/travis-ci/issues/8363 + pip3 -q install --user --upgrade pip || true +fi diff --git a/.ci/before_script.sh b/ci/before_script.sh similarity index 95% rename from .ci/before_script.sh rename to ci/before_script.sh index 4a75e89fbe..445996a8df 100755 --- a/.ci/before_script.sh +++ b/ci/before_script.sh @@ -3,7 +3,7 @@ set -e set -o pipefail -if [[ -n "${CI_TARGET}" ]]; then +if [[ "${CI_TARGET}" == lint ]]; then exit fi diff --git a/.ci/build.bat b/ci/build.bat similarity index 70% rename from .ci/build.bat rename to ci/build.bat index 87a171b994..6eb22176a9 100644 --- a/.ci/build.bat +++ b/ci/build.bat @@ -9,6 +9,10 @@ if "%CONFIGURATION%" == "MINGW_32" ( set ARCH=x86_64 set BITS=64 ) +if "%CONFIGURATION%" == "MINGW_64-gcov" ( + set USE_GCOV="-DUSE_GCOV=ON" +) + :: We cannot have sh.exe in the PATH (MinGW) set PATH=%PATH:C:\Program Files\Git\usr\bin;=% set PATH=C:\msys64\mingw%BITS%\bin;C:\Windows\System32;C:\Windows;%PATH% @@ -17,7 +21,7 @@ set PATH=C:\Program Files (x86)\CMake\bin\cpack.exe;%PATH% :: Build third-party dependencies C:\msys64\usr\bin\bash -lc "pacman --verbose --noconfirm -Su" || goto :error -C:\msys64\usr\bin\bash -lc "pacman --verbose --noconfirm --needed -S mingw-w64-%ARCH%-cmake mingw-w64-%ARCH%-perl mingw-w64-%ARCH%-diffutils gperf" || goto :error +C:\msys64\usr\bin\bash -lc "pacman --verbose --noconfirm --needed -S mingw-w64-%ARCH%-cmake mingw-w64-%ARCH%-perl mingw-w64-%ARCH%-diffutils mingw-w64-%ARCH%-unibilium gperf" || goto :error :: Setup python (use AppVeyor system python) C:\Python27\python.exe -m pip install neovim || goto :error @@ -31,23 +35,27 @@ python3 -c "import neovim; print(str(neovim))" || goto :error mkdir .deps cd .deps -cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release ..\third-party\ || goto :error +cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=RelWithDebInfo ..\third-party\ || goto :error mingw32-make VERBOSE=1 || goto :error cd .. :: Build Neovim mkdir build cd build -cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DBUSTED_OUTPUT_TYPE=gtest -DGPERF_PRG="C:\msys64\usr\bin\gperf.exe" .. || goto :error +cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUSTED_OUTPUT_TYPE=nvim %USE_GCOV% -DGPERF_PRG="C:\msys64\usr\bin\gperf.exe" .. || goto :error mingw32-make VERBOSE=1 || goto :error bin\nvim --version || goto :error :: Functional tests mingw32-make functionaltest VERBOSE=1 || goto :error +if defined USE_GCOV ( + C:\msys64\usr\bin\bash -lc "cd /c/projects/neovim; bash <(curl -s https://codecov.io/bash) || echo 'codecov upload failed.'" +) + :: Build artifacts -cpack -G ZIP -C Release -if defined APPVEYOR_REPO_TAG_NAME cpack -G NSIS -C Release +cpack -G ZIP -C RelWithDebInfo +if defined APPVEYOR_REPO_TAG_NAME cpack -G NSIS -C RelWithDebInfo goto :EOF :error diff --git a/.ci/common/build.sh b/ci/common/build.sh similarity index 62% rename from .ci/common/build.sh rename to ci/common/build.sh index 44087513ee..f398a1a1cc 100644 --- a/.ci/common/build.sh +++ b/ci/common/build.sh @@ -1,8 +1,17 @@ +top_make() { + ${MAKE_CMD} "$@" +} + +build_make() { + top_make -C "${BUILD_DIR}" "$@" +} + build_deps() { - if [[ "${BUILD_32BIT}" == ON ]]; then + if test "${BUILD_32BIT}" = ON ; then DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} ${CMAKE_FLAGS_32BIT}" fi - if [[ "${FUNCTIONALTEST}" == "functionaltest-lua" ]]; then + if test "${FUNCTIONALTEST}" = "functionaltest-lua" \ + || test "${CLANG_SANITIZER}" = "ASAN_UBSAN" ; then DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} -DUSE_BUNDLED_LUA=ON" fi @@ -10,16 +19,15 @@ build_deps() { # If there is a valid cache and we're not forced to recompile, # use cached third-party dependencies. - if [[ -f "${CACHE_MARKER}" ]] && [[ "${BUILD_NVIM_DEPS}" != true ]]; then - if [[ "${TRAVIS_OS_NAME}" == osx ]]; then - local statcmd="stat -f '%Sm'" - else - local statcmd="stat -c '%y'" + if test -f "${CACHE_MARKER}" && test "${BUILD_NVIM_DEPS}" != "true" ; then + local statcmd="stat -c '%y'" + if test "${TRAVIS_OS_NAME}" = osx ; then + statcmd="stat -f '%Sm'" fi echo "Using third-party dependencies from Travis's cache (last updated: $(${statcmd} "${CACHE_MARKER}"))." - mkdir -p "$(dirname "${DEPS_BUILD_DIR}")" - mv "${HOME}/.cache/nvim-deps" "${DEPS_BUILD_DIR}" + mkdir -p "$(dirname "${DEPS_BUILD_DIR}")" + mv "${HOME}/.cache/nvim-deps" "${DEPS_BUILD_DIR}" else mkdir -p "${DEPS_BUILD_DIR}" fi @@ -30,7 +38,7 @@ build_deps() { echo "Configuring with '${DEPS_CMAKE_FLAGS}'." CC= cmake ${DEPS_CMAKE_FLAGS} "${TRAVIS_BUILD_DIR}/third-party/" - if ! ${MAKE_CMD}; then + if ! top_make; then exit 1 fi @@ -38,10 +46,10 @@ build_deps() { } prepare_build() { - if [[ -n "${CLANG_SANITIZER}" ]]; then + if test -n "${CLANG_SANITIZER}" ; then CMAKE_FLAGS="${CMAKE_FLAGS} -DCLANG_${CLANG_SANITIZER}=ON" fi - if [[ "${BUILD_32BIT}" == ON ]]; then + if test "${BUILD_32BIT}" = ON ; then CMAKE_FLAGS="${CMAKE_FLAGS} ${CMAKE_FLAGS_32BIT}" fi @@ -53,24 +61,24 @@ prepare_build() { build_nvim() { echo "Building nvim." - if ! ${MAKE_CMD} nvim; then + if ! top_make nvim ; then exit 1 fi - if [ "$CLANG_SANITIZER" != "TSAN" ]; then + if test "$CLANG_SANITIZER" != "TSAN" ; then echo "Building libnvim." - if ! ${MAKE_CMD} libnvim; then + if ! top_make libnvim ; then exit 1 fi echo "Building nvim-test." - if ! ${MAKE_CMD} nvim-test; then + if ! top_make nvim-test ; then exit 1 fi fi # Invoke nvim to trigger *San early. - if ! (bin/nvim --version && bin/nvim -u NONE -e -c ':qall'); then + if ! (bin/nvim --version && bin/nvim -u NONE -e -c ':qall') ; then asan_check "${LOG_DIR}" exit 1 fi diff --git a/ci/common/suite.sh b/ci/common/suite.sh new file mode 100644 index 0000000000..d3fbcd1eda --- /dev/null +++ b/ci/common/suite.sh @@ -0,0 +1,199 @@ +# HACK: get newline for use in strings given that "\n" and $'' do not work. +NL="$(printf '\nE')" +NL="${NL%E}" + +FAIL_SUMMARY="" + +# Test success marker. If END_MARKER file exists, we know that all tests +# finished. If FAIL_SUMMARY_FILE exists we know that some tests failed, this +# file will contain information about failed tests. Build is considered +# successful if tests ended without any of them failing. +END_MARKER="$BUILD_DIR/.tests_finished" +FAIL_SUMMARY_FILE="$BUILD_DIR/.test_errors" + +ANSI_CLEAR="\033[0K" + +travis_fold() { + local action="$1" + local name="$2" + name="$(echo -n "$name" | tr '\n\0' '--' | sed 's/[^A-Za-z0-9]\{1,\}/-/g')" + name="$(echo -n "$name" | sed 's/-$//')" + echo -en "travis_fold:${action}:${name}\r${ANSI_CLEAR}" +} + +if test "$TRAVIS" != "true" ; then + travis_fold() { + return 0 + } +fi + +enter_suite() { + set +x + FAILED=0 + rm -f "${END_MARKER}" + local suite_name="$1" + export NVIM_TEST_CURRENT_SUITE="${NVIM_TEST_CURRENT_SUITE}/$suite_name" + travis_fold start "${NVIM_TEST_CURRENT_SUITE}" + set -x +} + +exit_suite() { + set +x + if test -f "$NVIM_LOG_FILE" ; then + printf "===============================================================================\n" + printf "NVIM_LOG_FILE: $NVIM_LOG_FILE\n" + cat "$NVIM_LOG_FILE" 2>/dev/null || printf '(empty)' + printf "\n" + rm -rf "$NVIM_LOG_FILE" + fi + travis_fold end "${NVIM_TEST_CURRENT_SUITE}" + if test $FAILED -ne 0 ; then + echo "Suite ${NVIM_TEST_CURRENT_SUITE} failed, summary:" + echo "${FAIL_SUMMARY}" + fi + export NVIM_TEST_CURRENT_SUITE="${NVIM_TEST_CURRENT_SUITE%/*}" + if test "$1" != "--continue" ; then + exit $FAILED + else + local saved_failed=$FAILED + FAILED=0 + return $saved_failed + fi +} + +fail() { + local test_name="$1" + local fail_char="$2" + local message="$3" + + : ${fail_char:=F} + : ${message:=Test $test_name failed} + + local full_msg="$fail_char $NVIM_TEST_CURRENT_SUITE|$test_name :: $message" + FAIL_SUMMARY="${FAIL_SUMMARY}${NL}${full_msg}" + echo "${full_msg}" >> "${FAIL_SUMMARY_FILE}" + echo "Failed: $full_msg" + FAILED=1 +} + +run_test() { + local cmd="$1" + test $# -gt 0 && shift + local test_name="$1" + : ${test_name:=$cmd} + test $# -gt 0 && shift + if ! eval "$cmd" ; then + fail "${test_name}" "$@" + fi +} + +run_test_wd() { + local hang_ok= + if test "$1" = "--allow-hang" ; then + hang_ok=1 + shift + fi + + local timeout="$1" + test $# -gt 0 && shift + + local cmd="$1" + test $# -gt 0 && shift + + local restart_cmd="$1" + : ${restart_cmd:=true} + test $# -gt 0 && shift + + local test_name="$1" + : ${test_name:=$cmd} + test $# -gt 0 && shift + + local output_file="$(mktemp)" + local status_file="$(mktemp)" + local sid_file="$(mktemp)" + + local restarts=5 + local prev_tmpsize=-1 + while test $restarts -gt 0 ; do + : > "$status_file" + : > "$sid_file" + setsid \ + env \ + output_file="$output_file" \ + status_file="$status_file" \ + sid_file="$sid_file" \ + cmd="$cmd" \ + CI_DIR="$CI_DIR" \ + sh -c ' + . "${CI_DIR}/common/test.sh" + ps -o sid= > "$sid_file" + ( + ret=0 + if ! eval "$cmd" 2>&1 ; then + ret=1 + fi + echo "$ret" > "$status_file" + ) | tee -a "$output_file" + ' + while test "$(stat -c "%s" "$status_file")" -eq 0 ; do + prev_tmpsize=$tmpsize + sleep $timeout + tmpsize="$(stat -c "%s" "$output_file")" + if test $tempsize -eq $prev_temsize ; then + # no output, assuming either hang or exit + break + fi + done + restarts=$(( restarts - 1 )) + if test "$(stat -c "%s" "$status_file")" -eq 0 ; then + # Status file not updated, assuming hang + + # SID not known, this should not ever happen + if test "$(stat -c "%s" "$sid_file")" -eq 0 ; then + fail "$test_name" E "Shell did not run" + break + fi + + # Kill all processes which belong to one session: should get rid of test + # processes as well as sh itself. + pkill -KILL -s$(cat "$sid_file") + + if test $restarts -eq 0 ; then + if test -z "$hang_ok" ; then + fail "$test_name" E "Test hang up" + fi + else + echo "Test ${test_name} hang up, restarting" + eval "$restart_cmd" + fi + else + local new_failed="$(cat "$status_file")" + if test "$new_failed" != "0" ; then + fail "$test_name" F "Test failed in run_test_wd" + fi + break + fi + done + + rm -f "$output_file" + rm -f "$status_file" + rm -f "$sid_file" +} + +ended_successfully() { + if test -f "${FAIL_SUMMARY_FILE}" ; then + echo 'Test failed, complete summary:' + cat "${FAIL_SUMMARY_FILE}" + return 1 + fi + if ! test -f "${END_MARKER}" ; then + echo 'ended_successfully called before end marker was touched' + return 1 + fi + return 0 +} + +end_tests() { + touch "${END_MARKER}" + ended_successfully +} diff --git a/ci/common/test.sh b/ci/common/test.sh new file mode 100644 index 0000000000..55f76ca798 --- /dev/null +++ b/ci/common/test.sh @@ -0,0 +1,174 @@ +. "${CI_DIR}/common/build.sh" +. "${CI_DIR}/common/suite.sh" + +print_core() { + local app="$1" + local core="$2" + if test "$app" = quiet ; then + echo "Found core $core" + return 0 + fi + echo "======= Core file $core =======" + if test "${TRAVIS_OS_NAME}" = osx ; then + lldb -Q -o "bt all" -f "${app}" -c "${core}" + else + gdb -n -batch -ex 'thread apply all bt full' "${app}" -c "${core}" + fi +} + +check_core_dumps() { + local del= + if test "$1" = "--delete" ; then + del=1 + shift + fi + local app="${1:-${BUILD_DIR}/bin/nvim}" + if test "${TRAVIS_OS_NAME}" = osx ; then + local cores="$(find /cores/ -type f -print)" + else + local cores="$(find ./ -type f -name 'core.*' -print)" + fi + + if test -z "${cores}" ; then + return + fi + local core + for core in $cores; do + if test "$del" = "1" ; then + print_core "$app" "$core" >&2 + rm "$core" + else + print_core "$app" "$core" + fi + done + if test "$app" != quiet ; then + fail 'cores' E 'Core dumps found' + fi +} + +check_logs() { + # Iterate through each log to remove an useless warning. + for log in $(find "${1}" -type f -name "${2}"); do + sed -i "${log}" \ + -e '/Warning: noted but unhandled ioctl/d' \ + -e '/could cause spurious value errors to appear/d' \ + -e '/See README_MISSING_SYSCALL_OR_IOCTL for guidance/d' + done + + # Now do it again, but only consider files with size > 0. + local err="" + for log in $(find "${1}" -type f -name "${2}" -size +0); do + cat "${log}" + err=1 + done + if test -n "${err}" ; then + fail 'logs' E 'Runtime errors detected.' + fi +} + +valgrind_check() { + check_logs "${1}" "valgrind-*" +} + +asan_check() { + check_logs "${1}" "*san.*" +} + +run_unittests() {( + enter_suite unittests + ulimit -c unlimited || true + if ! build_make unittest ; then + fail 'unittests' F 'Unit tests failed' + fi + check_core_dumps "$(which luajit)" + exit_suite +)} + +run_functionaltests() {( + enter_suite functionaltests + ulimit -c unlimited || true + if ! build_make ${FUNCTIONALTEST}; then + fail 'functionaltests' F 'Functional tests failed' + fi + asan_check "${LOG_DIR}" + valgrind_check "${LOG_DIR}" + check_core_dumps + exit_suite +)} + +run_oldtests() {( + enter_suite oldtests + ulimit -c unlimited || true + if ! make -C "${TRAVIS_BUILD_DIR}/src/nvim/testdir"; then + reset + fail 'oldtests' F 'Legacy tests failed' + fi + asan_check "${LOG_DIR}" + valgrind_check "${LOG_DIR}" + check_core_dumps + exit_suite +)} + +check_runtime_files() {( + set +x + local test_name="$1" ; shift + local message="$1" ; shift + local tst="$1" ; shift + + cd runtime + for file in $(git ls-files "$@") ; do + # Check that test is not trying to work with files with spaces/etc + # Prefer failing the build over using more robust construct because files + # with IFS are not welcome. + if ! test -e "$file" ; then + fail "$test_name" E \ + "It appears that $file is only a part of the file name" + fi + if ! test "$tst" "$INSTALL_PREFIX/share/nvim/runtime/$file" ; then + fail "$test_name" F "$(printf "$message" "$file")" + fi + done +)} + +install_nvim() {( + enter_suite 'install_nvim' + if ! build_make install ; then + fail 'install' E 'make install failed' + exit_suite + fi + + "${INSTALL_PREFIX}/bin/nvim" --version + if ! "${INSTALL_PREFIX}/bin/nvim" -u NONE -e -c ':help' -c ':qall' ; then + echo "Running ':help' in the installed nvim failed." + echo "Maybe the helptags have not been generated properly." + fail 'help' F 'Failed running :help' + fi + + # Check that all runtime files were installed + check_runtime_files \ + 'runtime-install' \ + 'It appears that %s is not installed.' \ + -e \ + '*.vim' '*.ps' '*.dict' '*.py' '*.tutor' + + # Check that some runtime files are installed and are executables + check_runtime_files \ + 'not-exe' \ + 'It appears that %s is not installed or is not executable.' \ + -x \ + '*.awk' '*.sh' '*.bat' + + # Check that generated syntax file has function names, #5060. + local genvimsynf=syntax/vim/generated.vim + local gpat='syn keyword vimFuncName .*eval' + if ! grep -q "$gpat" "${INSTALL_PREFIX}/share/nvim/runtime/$genvimsynf" ; then + fail 'funcnames' F "It appears that $genvimsynf does not contain $gpat." + fi + + exit_suite +)} + +csi_clean() { + find "${BUILD_DIR}/bin" -name 'test-includes-*' -delete + find "${BUILD_DIR}" -name '*test-include*.o' -delete +} diff --git a/.ci/install.sh b/ci/install.sh similarity index 71% rename from .ci/install.sh rename to ci/install.sh index 98d3dc01cb..c8a0c8825d 100755 --- a/.ci/install.sh +++ b/ci/install.sh @@ -3,7 +3,7 @@ set -e set -o pipefail -if [[ -n "${CI_TARGET}" ]]; then +if [[ "${CI_TARGET}" == lint ]]; then exit fi @@ -17,7 +17,9 @@ echo "Install neovim module and coveralls for Python 2." CC=cc pip2.7 -q install --user --upgrade neovim cpp-coveralls echo "Install neovim module for Python 3." -CC=cc pip3 -q install --user --upgrade neovim +# Allow failure. pyenv pip3 on travis is broken: +# https://github.com/travis-ci/travis-ci/issues/8363 +CC=cc pip3 -q install --user --upgrade neovim || true echo "Install neovim RubyGem." gem install --no-document --version ">= 0.2.0" neovim diff --git a/ci/run_lint.sh b/ci/run_lint.sh new file mode 100755 index 0000000000..e7f6727448 --- /dev/null +++ b/ci/run_lint.sh @@ -0,0 +1,40 @@ +#!/usr/bin/env bash + +set -e +set -o pipefail + +CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" + +source "${CI_DIR}/common/build.sh" +source "${CI_DIR}/common/suite.sh" + +enter_suite 'clint' + +run_test 'top_make clint-full' clint + +exit_suite --continue + +enter_suite 'testlint' + +run_test 'top_make testlint' testlint + +exit_suite --continue + +enter_suite 'lualint' + +run_test 'top_make lualint' lualint + +exit_suite --continue + +enter_suite single-includes + +CLICOLOR_FORCE=1 run_test_wd \ + --allow-hang \ + 10s \ + 'top_make check-single-includes' \ + 'csi_clean' \ + single-includes + +exit_suite --continue + +end_tests diff --git a/.ci/run_tests.sh b/ci/run_tests.sh similarity index 56% rename from .ci/run_tests.sh rename to ci/run_tests.sh index 6347ac15d4..a0bf6e010d 100755 --- a/.ci/run_tests.sh +++ b/ci/run_tests.sh @@ -6,20 +6,29 @@ set -o pipefail CI_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" source "${CI_DIR}/common/build.sh" source "${CI_DIR}/common/test.sh" +source "${CI_DIR}/common/suite.sh" + +enter_suite build check_core_dumps --delete quiet prepare_build build_nvim -if [ "$CLANG_SANITIZER" != "TSAN" ]; then +exit_suite --continue + +enter_suite tests + +if test "$CLANG_SANITIZER" != "TSAN" ; then # Additional threads are only created when the builtin UI starts, which # doesn't happen in the unit/functional tests - run_unittests - run_functionaltests + run_test run_unittests + run_test run_functionaltests fi -run_oldtests +run_test run_oldtests -install_nvim +run_test install_nvim -touch "${SUCCESS_MARKER}" +exit_suite --continue + +end_tests diff --git a/.ci/script.sh b/ci/script.sh similarity index 69% rename from .ci/script.sh rename to ci/script.sh index 46c4eecf38..a59c40cd2d 100755 --- a/.ci/script.sh +++ b/ci/script.sh @@ -3,16 +3,11 @@ set -e set -o pipefail -if [[ -n "${CI_TARGET}" ]]; then - make "${CI_TARGET}" - exit 0 -fi - # This will pass the environment variables down to a bash process which runs # as $USER, while retaining the environment variables defined and belonging # to secondary groups given above in usermod. if [[ "${TRAVIS_OS_NAME}" == osx ]]; then - sudo -E su "${USER}" -c ".ci/run_tests.sh" + sudo -E su "${USER}" -c "ci/run_${CI_TARGET}.sh" else - .ci/run_tests.sh + ci/run_${CI_TARGET}.sh fi diff --git a/cmake/Download.cmake b/cmake/Download.cmake new file mode 100644 index 0000000000..50a77816bc --- /dev/null +++ b/cmake/Download.cmake @@ -0,0 +1,18 @@ +file( + DOWNLOAD "${URL}" "${FILE}" + STATUS status + LOG log +) + +list(GET status 0 status_code) +list(GET status 1 status_string) + +if(NOT status_code EQUAL 0) + if(NOT ALLOW_FAILURE) + message(FATAL_ERROR "error: downloading '${URL}' failed + status_code: ${status_code} + status_string: ${status_string} + log: ${log} + ") + endif() +endif() diff --git a/cmake/FindJeMalloc.cmake b/cmake/FindJeMalloc.cmake index f36cbc6f7a..f139196a38 100644 --- a/cmake/FindJeMalloc.cmake +++ b/cmake/FindJeMalloc.cmake @@ -4,7 +4,7 @@ # JEMALLOC_INCLUDE_DIRS - The jemalloc include directories # JEMALLOC_LIBRARIES - The libraries needed to use jemalloc -if(NOT JEMALLOC_USE_BUNDLED) +if(NOT USE_BUNDLED_JEMALLOC) find_package(PkgConfig) if (PKG_CONFIG_FOUND) pkg_check_modules(PC_JEMALLOC QUIET jemalloc) @@ -27,6 +27,9 @@ find_path(JEMALLOC_INCLUDE_DIR jemalloc/jemalloc.h if(JEMALLOC_USE_STATIC) list(APPEND JEMALLOC_NAMES "${CMAKE_STATIC_LIBRARY_PREFIX}jemalloc${CMAKE_STATIC_LIBRARY_SUFFIX}") +elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") + list(INSERT JEMALLOC_NAMES 0 + "${CMAKE_STATIC_LIBRARY_PREFIX}jemalloc${CMAKE_STATIC_LIBRARY_SUFFIX}") endif() list(APPEND JEMALLOC_NAMES jemalloc) diff --git a/cmake/FindLibIntl.cmake b/cmake/FindLibIntl.cmake index 75926200c1..ab4632cf45 100644 --- a/cmake/FindLibIntl.cmake +++ b/cmake/FindLibIntl.cmake @@ -46,6 +46,7 @@ check_c_source_compiles(" int main(int argc, char** argv) { gettext(\"foo\"); + ngettext(\"foo\", \"bar\", 1); bindtextdomain(\"foo\", \"bar\"); bind_textdomain_codeset(\"foo\", \"bar\"); textdomain(\"foo\"); diff --git a/cmake/FindLibTermkey.cmake b/cmake/FindLibTermkey.cmake index 144deceaae..66fd2e6c89 100644 --- a/cmake/FindLibTermkey.cmake +++ b/cmake/FindLibTermkey.cmake @@ -4,7 +4,7 @@ # LIBTERMKEY_INCLUDE_DIRS - The libtermkey include directories # LIBTERMKEY_LIBRARIES - The libraries needed to use libtermkey -if(NOT LIBTERMKEY_USE_BUNDLED) +if(NOT USE_BUNDLED_LIBTERMKEY) find_package(PkgConfig) if (PKG_CONFIG_FOUND) pkg_check_modules(PC_LIBTERMKEY QUIET termkey) diff --git a/cmake/FindLibUV.cmake b/cmake/FindLibUV.cmake index dcdd5e48b7..3a60a831ea 100644 --- a/cmake/FindLibUV.cmake +++ b/cmake/FindLibUV.cmake @@ -8,7 +8,7 @@ # Set the LIBUV_USE_STATIC variable to specify if static libraries should # be preferred to shared ones. -if(NOT LIBUV_USE_BUNDLED) +if(NOT USE_BUNDLED_LIBUV) find_package(PkgConfig) if (PKG_CONFIG_FOUND) pkg_check_modules(PC_LIBUV QUIET libuv) @@ -65,7 +65,7 @@ if(HAVE_LIBKSTAT) endif() check_library_exists(kvm kvm_open "kvm.h" HAVE_LIBKVM) -if(HAVE_LIBKVM) +if(HAVE_LIBKVM AND NOT CMAKE_SYSTEM_NAME STREQUAL "OpenBSD") list(APPEND LIBUV_LIBRARIES kvm) endif() diff --git a/cmake/FindLibVterm.cmake b/cmake/FindLibVterm.cmake index 0d773d8896..2cbd3215c5 100644 --- a/cmake/FindLibVterm.cmake +++ b/cmake/FindLibVterm.cmake @@ -4,7 +4,7 @@ # LIBVTERM_INCLUDE_DIRS - The libvterm include directories # LIBVTERM_LIBRARIES - The libraries needed to use libvterm -if(NOT LIBVTERM_USE_BUNDLED) +if(NOT USE_BUNDLED_LIBVTERM) find_package(PkgConfig) if (PKG_CONFIG_FOUND) pkg_check_modules(PC_LIBVTERM QUIET vterm) diff --git a/cmake/FindLua.cmake b/cmake/FindLua.cmake new file mode 100644 index 0000000000..b669a49f29 --- /dev/null +++ b/cmake/FindLua.cmake @@ -0,0 +1,197 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +#.rst: +# FindLua +# ------- +# +# +# +# Locate Lua library This module defines +# +# :: +# +# LUA_FOUND - if false, do not try to link to Lua +# LUA_LIBRARIES - both lua and lualib +# LUA_INCLUDE_DIR - where to find lua.h +# LUA_VERSION_STRING - the version of Lua found +# LUA_VERSION_MAJOR - the major version of Lua +# LUA_VERSION_MINOR - the minor version of Lua +# LUA_VERSION_PATCH - the patch version of Lua +# +# +# +# Note that the expected include convention is +# +# :: +# +# #include "lua.h" +# +# and not +# +# :: +# +# #include +# +# This is because, the lua location is not standardized and may exist in +# locations other than lua/ + +unset(_lua_include_subdirs) +unset(_lua_library_names) +unset(_lua_append_versions) + +# this is a function only to have all the variables inside go away automatically +function(_lua_set_version_vars) + set(LUA_VERSIONS5 5.3 5.2 5.1 5.0) + + if (Lua_FIND_VERSION_EXACT) + if (Lua_FIND_VERSION_COUNT GREATER 1) + set(_lua_append_versions ${Lua_FIND_VERSION_MAJOR}.${Lua_FIND_VERSION_MINOR}) + endif () + elseif (Lua_FIND_VERSION) + # once there is a different major version supported this should become a loop + if (NOT Lua_FIND_VERSION_MAJOR GREATER 5) + if (Lua_FIND_VERSION_COUNT EQUAL 1) + set(_lua_append_versions ${LUA_VERSIONS5}) + else () + foreach (subver IN LISTS LUA_VERSIONS5) + if (NOT subver VERSION_LESS ${Lua_FIND_VERSION}) + list(APPEND _lua_append_versions ${subver}) + endif () + endforeach () + endif () + endif () + else () + # once there is a different major version supported this should become a loop + set(_lua_append_versions ${LUA_VERSIONS5}) + endif () + + list(APPEND _lua_include_subdirs "include/lua" "include") + + foreach (ver IN LISTS _lua_append_versions) + string(REGEX MATCH "^([0-9]+)\\.([0-9]+)$" _ver "${ver}") + list(APPEND _lua_include_subdirs + include/lua${CMAKE_MATCH_1}${CMAKE_MATCH_2} + include/lua${CMAKE_MATCH_1}.${CMAKE_MATCH_2} + include/lua-${CMAKE_MATCH_1}.${CMAKE_MATCH_2} + ) + endforeach () + + set(_lua_include_subdirs "${_lua_include_subdirs}" PARENT_SCOPE) + set(_lua_append_versions "${_lua_append_versions}" PARENT_SCOPE) +endfunction(_lua_set_version_vars) + +function(_lua_check_header_version _hdr_file) + # At least 5.[012] have different ways to express the version + # so all of them need to be tested. Lua 5.2 defines LUA_VERSION + # and LUA_RELEASE as joined by the C preprocessor, so avoid those. + file(STRINGS "${_hdr_file}" lua_version_strings + REGEX "^#define[ \t]+LUA_(RELEASE[ \t]+\"Lua [0-9]|VERSION([ \t]+\"Lua [0-9]|_[MR])).*") + + string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_MAJOR[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_MAJOR ";${lua_version_strings};") + if (LUA_VERSION_MAJOR MATCHES "^[0-9]+$") + string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_MINOR[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_MINOR ";${lua_version_strings};") + string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_RELEASE[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_PATCH ";${lua_version_strings};") + set(LUA_VERSION_STRING "${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}.${LUA_VERSION_PATCH}") + else () + string(REGEX REPLACE ".*;#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([0-9.]+)\"[ \t]*;.*" "\\1" LUA_VERSION_STRING ";${lua_version_strings};") + if (NOT LUA_VERSION_STRING MATCHES "^[0-9.]+$") + string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION[ \t]+\"Lua ([0-9.]+)\"[ \t]*;.*" "\\1" LUA_VERSION_STRING ";${lua_version_strings};") + endif () + string(REGEX REPLACE "^([0-9]+)\\.[0-9.]*$" "\\1" LUA_VERSION_MAJOR "${LUA_VERSION_STRING}") + string(REGEX REPLACE "^[0-9]+\\.([0-9]+)[0-9.]*$" "\\1" LUA_VERSION_MINOR "${LUA_VERSION_STRING}") + string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]).*" "\\1" LUA_VERSION_PATCH "${LUA_VERSION_STRING}") + endif () + foreach (ver IN LISTS _lua_append_versions) + if (ver STREQUAL "${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}") + set(LUA_VERSION_MAJOR ${LUA_VERSION_MAJOR} PARENT_SCOPE) + set(LUA_VERSION_MINOR ${LUA_VERSION_MINOR} PARENT_SCOPE) + set(LUA_VERSION_PATCH ${LUA_VERSION_PATCH} PARENT_SCOPE) + set(LUA_VERSION_STRING ${LUA_VERSION_STRING} PARENT_SCOPE) + return() + endif () + endforeach () +endfunction(_lua_check_header_version) + +_lua_set_version_vars() + +if (LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/lua.h") + _lua_check_header_version("${LUA_INCLUDE_DIR}/lua.h") +endif () + +if (NOT LUA_VERSION_STRING) + foreach (subdir IN LISTS _lua_include_subdirs) + unset(LUA_INCLUDE_PREFIX CACHE) + find_path(LUA_INCLUDE_PREFIX ${subdir}/lua.h + HINTS + ENV LUA_DIR + PATHS + ~/Library/Frameworks + /Library/Frameworks + /sw # Fink + /opt/local # DarwinPorts + /opt/csw # Blastwave + /opt + ) + if (LUA_INCLUDE_PREFIX) + _lua_check_header_version("${LUA_INCLUDE_PREFIX}/${subdir}/lua.h") + if (LUA_VERSION_STRING) + set(LUA_INCLUDE_DIR "${LUA_INCLUDE_PREFIX}/${subdir}") + break() + endif () + endif () + endforeach () +endif () +unset(_lua_include_subdirs) +unset(_lua_append_versions) + +if (LUA_VERSION_STRING) + set(_lua_library_names + lua${LUA_VERSION_MAJOR}${LUA_VERSION_MINOR} + lua${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR} + lua-${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR} + lua.${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR} + ) +endif () + +find_library(LUA_LIBRARY + NAMES ${_lua_library_names} lua + HINTS + ENV LUA_DIR + PATH_SUFFIXES lib + PATHS + ~/Library/Frameworks + /Library/Frameworks + /sw + /opt/local + /opt/csw + /opt +) +unset(_lua_library_names) + +if (LUA_LIBRARY) + # include the math library for Unix + if (UNIX AND NOT APPLE AND NOT BEOS) + find_library(LUA_MATH_LIBRARY m) + set(LUA_LIBRARIES "${LUA_LIBRARY};${LUA_MATH_LIBRARY}") + + # include dl library for statically-linked Lua library + get_filename_component(LUA_LIB_EXT ${LUA_LIBRARY} EXT) + if(LUA_LIB_EXT STREQUAL CMAKE_STATIC_LIBRARY_SUFFIX) + list(APPEND LUA_LIBRARIES ${CMAKE_DL_LIBS}) + endif() + + # For Windows and Mac, don't need to explicitly include the math library + else () + set(LUA_LIBRARIES "${LUA_LIBRARY}") + endif () +endif () + +include(FindPackageHandleStandardArgs) +# handle the QUIETLY and REQUIRED arguments and set LUA_FOUND to TRUE if +# all listed variables are TRUE +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua + REQUIRED_VARS LUA_LIBRARIES LUA_INCLUDE_DIR + VERSION_VAR LUA_VERSION_STRING) + +mark_as_advanced(LUA_INCLUDE_DIR LUA_LIBRARY LUA_MATH_LIBRARY) diff --git a/cmake/FindLuaJit.cmake b/cmake/FindLuaJit.cmake index e9ff53ab62..b8eda6388b 100644 --- a/cmake/FindLuaJit.cmake +++ b/cmake/FindLuaJit.cmake @@ -4,7 +4,7 @@ # LUAJIT_INCLUDE_DIRS - The luajit include directories # LUAJIT_LIBRARIES - The libraries needed to use luajit -if(NOT LUAJIT_USE_BUNDLED) +if(NOT USE_BUNDLED_LUAJIT) find_package(PkgConfig) if (PKG_CONFIG_FOUND) pkg_check_modules(PC_LUAJIT QUIET luajit) diff --git a/cmake/FindMsgpack.cmake b/cmake/FindMsgpack.cmake index 8881a34332..6716289a98 100644 --- a/cmake/FindMsgpack.cmake +++ b/cmake/FindMsgpack.cmake @@ -4,7 +4,7 @@ # MSGPACK_INCLUDE_DIRS - The msgpack include directories # MSGPACK_LIBRARIES - The libraries needed to use msgpack -if(NOT MSGPACK_USE_BUNDLED) +if(NOT USE_BUNDLED_MSGPACK) find_package(PkgConfig) if (PKG_CONFIG_FOUND) pkg_search_module(PC_MSGPACK QUIET diff --git a/cmake/FindUnibilium.cmake b/cmake/FindUnibilium.cmake index e1e0de9b7e..cf0ccda877 100644 --- a/cmake/FindUnibilium.cmake +++ b/cmake/FindUnibilium.cmake @@ -4,7 +4,7 @@ # UNIBILIUM_INCLUDE_DIRS - The unibilium include directories # UNIBILIUM_LIBRARIES - The libraries needed to use unibilium -if(NOT UNIBILIUM_USE_BUNDLED) +if(NOT USE_BUNDLED_UNIBILIUM) find_package(PkgConfig) if (PKG_CONFIG_FOUND) pkg_check_modules(PC_UNIBILIUM QUIET unibilium) diff --git a/cmake/FindWinpty.cmake b/cmake/FindWinpty.cmake new file mode 100644 index 0000000000..8feafc58a8 --- /dev/null +++ b/cmake/FindWinpty.cmake @@ -0,0 +1,10 @@ +include(LibFindMacros) + +find_path(WINPTY_INCLUDE_DIR winpty.h) +set(WINPTY_INCLUDE_DIRS ${WINPTY_INCLUDE_DIR}) + +find_library(WINPTY_LIBRARY winpty) +find_program(WINPTY_AGENT_EXE winpty-agent.exe) +set(WINPTY_LIBRARIES ${WINPTY_LIBRARY}) + +find_package_handle_standard_args(Winpty DEFAULT_MSG WINPTY_LIBRARY WINPTY_INCLUDE_DIR) diff --git a/cmake/InstallClintErrors.cmake b/cmake/InstallClintErrors.cmake new file mode 100644 index 0000000000..bd5ca07828 --- /dev/null +++ b/cmake/InstallClintErrors.cmake @@ -0,0 +1,2 @@ +file(GLOB_RECURSE JSON_FILES *.json) +file(COPY ${JSON_FILES} DESTINATION "${TARGET}") diff --git a/cmake/InstallHelpers.cmake b/cmake/InstallHelpers.cmake index ee07ba2c66..bebc0d0d17 100644 --- a/cmake/InstallHelpers.cmake +++ b/cmake/InstallHelpers.cmake @@ -1,3 +1,12 @@ +# Fix CMAKE_INSTALL_MANDIR on BSD before including GNUInstallDirs. #6771 +if(CMAKE_SYSTEM_NAME MATCHES "BSD" AND NOT DEFINED CMAKE_INSTALL_MANDIR) + if(DEFINED ENV{MANPREFIX}) + set(CMAKE_INSTALL_MANDIR "$ENV{MANPREFIX}/man") + elseif(CMAKE_INSTALL_PREFIX MATCHES "^/usr/local$") + set(CMAKE_INSTALL_MANDIR "man") + endif() +endif() + # For $CMAKE_INSTALL_{DATAROOT,MAN, ...}DIR include(GNUInstallDirs) diff --git a/cmake/RunLint.cmake b/cmake/RunLint.cmake deleted file mode 100644 index 306e938232..0000000000 --- a/cmake/RunLint.cmake +++ /dev/null @@ -1,32 +0,0 @@ -get_filename_component(LINT_DIR ${LINT_DIR} ABSOLUTE) -get_filename_component(LINT_PREFIX ${LINT_DIR} PATH) -set(LINT_SUPPRESS_FILE "${LINT_PREFIX}/errors.json") - -if(DEFINED ENV{LINT_FILE}) - file(GLOB_RECURSE LINT_FILES "$ENV{LINT_FILE}") -else() - file(GLOB_RECURSE LINT_FILES ${LINT_DIR}/*.c ${LINT_DIR}/*.h) -endif() - -set(LINT_ARGS) - -if(LINT_SUPPRESS_URL) - file(DOWNLOAD ${LINT_SUPPRESS_URL} ${LINT_SUPPRESS_FILE}) - list(APPEND LINT_ARGS "--suppress-errors=${LINT_SUPPRESS_FILE}") -endif() - -foreach(lint_file ${LINT_FILES}) - file(RELATIVE_PATH lint_file "${LINT_PREFIX}" "${lint_file}") - list(APPEND LINT_ARGS "${lint_file}") -endforeach() - -execute_process( - COMMAND ${LINT_PRG} ${LINT_ARGS} - RESULT_VARIABLE res - WORKING_DIRECTORY "${LINT_PREFIX}") - -file(REMOVE ${LINT_SUPPRESS_FILE}) - -if(NOT res EQUAL 0) - message(FATAL_ERROR "Linting failed: ${res}.") -endif() diff --git a/cmake/RunLuacheck.cmake b/cmake/RunLuacheck.cmake new file mode 100644 index 0000000000..5129541cd8 --- /dev/null +++ b/cmake/RunLuacheck.cmake @@ -0,0 +1,22 @@ +set(LUACHECK_ARGS -q "${LUAFILES_DIR}") +if(DEFINED IGNORE_PATTERN) + list(APPEND LUACHECK_ARGS --exclude-files "${LUAFILES_DIR}/${IGNORE_PATTERN}") +endif() +if(DEFINED CHECK_PATTERN) + list(APPEND LUACHECK_ARGS --include-files "${LUAFILES_DIR}/${CHECK_PATTERN}") +endif() +if(DEFINED READ_GLOBALS) + list(APPEND LUACHECK_ARGS --read-globals "${READ_GLOBALS}") +endif() + +execute_process( + COMMAND "${LUACHECK_PRG}" ${LUACHECK_ARGS} + WORKING_DIRECTORY "${LUAFILES_DIR}" + ERROR_VARIABLE err + RESULT_VARIABLE res +) + +if(NOT res EQUAL 0) + message(STATUS "Output to stderr:\n${err}") + message(FATAL_ERROR "Linting tests failed with error: ${res}.") +endif() diff --git a/cmake/RunTests.cmake b/cmake/RunTests.cmake index 38e0f35213..95c06aeb94 100644 --- a/cmake/RunTests.cmake +++ b/cmake/RunTests.cmake @@ -1,8 +1,15 @@ +# Set LC_ALL to meet expectations of some locale-sensitive tests. +set(ENV{LC_ALL} "en_US.UTF-8") + set(ENV{VIMRUNTIME} ${WORKING_DIR}/runtime) set(ENV{NVIM_RPLUGIN_MANIFEST} ${WORKING_DIR}/Xtest_rplugin_manifest) set(ENV{XDG_CONFIG_HOME} ${WORKING_DIR}/Xtest_xdg/config) set(ENV{XDG_DATA_HOME} ${WORKING_DIR}/Xtest_xdg/share) +if(NOT DEFINED ENV{NVIM_LOG_FILE}) + set(ENV{NVIM_LOG_FILE} ${WORKING_DIR}/.nvimlog) +endif() + if(NVIM_PRG) set(ENV{NVIM_PRG} "${NVIM_PRG}") endif() @@ -25,6 +32,8 @@ if(DEFINED ENV{TEST_FILTER}) set(TEST_TAG "--filter=$ENV{TEST_FILTER}") endif() +execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${WORKING_DIR}/Xtest-tmpdir) +set(ENV{TMPDIR} ${WORKING_DIR}/Xtest-tmpdir) set(ENV{SYSTEM_NAME} ${SYSTEM_NAME}) execute_process( COMMAND ${BUSTED_PRG} ${TEST_TAG} ${TEST_FILTER} -v -o ${BUSTED_OUTPUT_TYPE} @@ -37,6 +46,7 @@ execute_process( file(REMOVE ${WORKING_DIR}/Xtest_rplugin_manifest) file(REMOVE_RECURSE ${WORKING_DIR}/Xtest_xdg) +file(REMOVE_RECURSE ${WORKING_DIR}/Xtest-tmpdir) if(NOT res EQUAL 0) message(STATUS "Output to stderr:\n${err}") diff --git a/cmake/RunTestsLint.cmake b/cmake/RunTestsLint.cmake deleted file mode 100644 index addc9ab35e..0000000000 --- a/cmake/RunTestsLint.cmake +++ /dev/null @@ -1,13 +0,0 @@ -set(IGNORE_FILES "${TEST_DIR}/*/preload.lua") - -execute_process( - COMMAND ${LUACHECK_PRG} -q ${TEST_DIR} --exclude-files ${IGNORE_FILES} - WORKING_DIRECTORY ${TEST_DIR} - ERROR_VARIABLE err - RESULT_VARIABLE res - ${EXTRA_ARGS}) - -if(NOT res EQUAL 0) - message(STATUS "Output to stderr:\n${err}") - message(FATAL_ERROR "Linting tests failed with error: ${res}.") -endif() diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000000..0b3de06b97 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,27 @@ +codecov: + notify: + require_ci_to_pass: yes + ci: + - appveyor + - travis + - !neovim-qb.szakmeister.net + +coverage: + precision: 2 + round: down + range: "70...100" + + status: + project: yes + patch: yes + changes: no + +parsers: + gcov: + branch_detection: + conditional: yes + loop: yes + method: no + macro: no + +comment: off diff --git a/config/config.h.in b/config/config.h.in index f26b5a50a8..962eefd7a7 100644 --- a/config/config.h.in +++ b/config/config.h.in @@ -68,4 +68,6 @@ #cmakedefine ORDER_BIG_ENDIAN #define ENDIAN_INCLUDE_FILE <@ENDIAN_INCLUDE_FILE@> +#cmakedefine HAVE_EXECINFO_BACKTRACE + #endif // AUTO_CONFIG_H diff --git a/contrib/local.mk.example b/contrib/local.mk.example index 04f21131b8..23fe11622b 100644 --- a/contrib/local.mk.example +++ b/contrib/local.mk.example @@ -13,27 +13,21 @@ # Sets the build type; defaults to Debug. Valid values: # -# - Debug: Disables optimizations (-O0), enables debug information and logging. +# - Debug: Disables optimizations (-O0), enables debug information. # -# - Dev: Enables all optimizations that do not interfere with -# debugging (-Og if available, -O2 and -g if not). -# Enables debug information and logging. -# -# - RelWithDebInfo: Enables optimizations (-O2) and debug information. -# Disables logging. +# - RelWithDebInfo: Enables optimizations (-Og or -O2) with debug information. # # - MinSizeRel: Enables all -O2 optimization that do not typically # increase code size, and performs further optimizations # designed to reduce code size (-Os). -# Disables debug information and logging. +# Disables debug information. # # - Release: Same as RelWithDebInfo, but disables debug information. # # CMAKE_BUILD_TYPE := Debug -# By default, nvim's log level is INFO (1) (unless CMAKE_BUILD_TYPE is -# "Release", in which case logging is disabled). -# The log level must be a number DEBUG (0), INFO (1), WARNING (2) or ERROR (3). +# Log levels: 0 (DEBUG), 1 (INFO), 2 (WARNING), 3 (ERROR) +# Default is 1 (INFO) unless CMAKE_BUILD_TYPE is Release or RelWithDebInfo. # CMAKE_EXTRA_FLAGS += -DMIN_LOG_LEVEL=1 # By default, nvim uses bundled versions of its required third-party diff --git a/man/nvim.1 b/man/nvim.1 index 98d97c2d5a..d2a3ea5c43 100644 --- a/man/nvim.1 +++ b/man/nvim.1 @@ -371,27 +371,6 @@ See Used to set the 'shell' option, which determines the shell used by the .Ic :terminal command. -.It Ev NVIM_TUI_ENABLE_CURSOR_SHAPE -Set to 0 to prevent Nvim from changing the cursor shape. -Set to 1 to enable non-blinking mode-sensitive cursor (this is the default). -Set to 2 to enable blinking mode-sensitive cursor. -Host terminal must support the DECSCUSR CSI escape sequence. -.Pp -Depending on the terminal emulator, using this option with -.Nm -under -.Xr tmux 1 -might require adding the following to -.Pa ~/.tmux.conf : -.Bd -literal -offset indent -set -ga terminal-overrides ',*:Ss=\eE[%p1%d q:Se=\eE[2 q' -.Ed -.Pp -See -.Ic terminal-overrides -in the -.Xr tmux 1 -manual page for more information. .El .Sh FILES .Bl -tag -width "~/.config/nvim/init.vim" diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt index 69498dc1a1..6dbe049232 100644 --- a/runtime/CMakeLists.txt +++ b/runtime/CMakeLists.txt @@ -71,6 +71,7 @@ foreach(DF ${DOCFILES}) endforeach() add_custom_target(helptags + COMMAND ${CMAKE_COMMAND} -E remove_directory ${GENERATED_RUNTIME_DIR}/doc COMMAND ${CMAKE_COMMAND} -E copy_directory ${PROJECT_SOURCE_DIR}/runtime/doc ${GENERATED_RUNTIME_DIR}/doc COMMAND "${PROJECT_BINARY_DIR}/bin/nvim" @@ -100,20 +101,6 @@ add_custom_target( ${GENERATED_PACKAGE_TAGS} ) -# Optional targets for nvim.desktop file and icon. -find_program(XDG_MENU_PRG xdg-desktop-menu) -find_program(XDG_ICON_PRG xdg-icon-resource) -if(XDG_MENU_PRG) - add_custom_target(desktop-file - COMMAND xdg-desktop-menu install --novendor ${PROJECT_SOURCE_DIR}/runtime/nvim.desktop) - # add_dependencies(runtime desktop-file) -endif() -if(XDG_ICON_PRG) - add_custom_target(desktop-icon - COMMAND xdg-icon-resource install --novendor --size 128 ${PROJECT_SOURCE_DIR}/runtime/nvim.png) - # add_dependencies(runtime desktop-icon) -endif() - # CMake is painful here. It will create the destination using the user's # current umask, and we don't want that. And we don't just want to install # the target directory, as it will mess with existing permissions. So this @@ -128,6 +115,16 @@ install_helper( FILES ${GENERATED_SYN_VIM} DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/nvim/runtime/syntax/vim) +if(NOT APPLE) + install_helper( + FILES ${CMAKE_CURRENT_SOURCE_DIR}/nvim.desktop + DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications) + + install_helper( + FILES ${CMAKE_CURRENT_SOURCE_DIR}/nvim.png + DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/pixmaps) +endif() + file(GLOB_RECURSE RUNTIME_PROGRAMS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.awk *.sh *.bat) @@ -140,6 +137,7 @@ endforeach() file(GLOB_RECURSE RUNTIME_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + rgb.txt *.vim *.dict *.py *.rb *.ps *.tutor) foreach(F ${RUNTIME_FILES}) diff --git a/runtime/autoload/ada.vim b/runtime/autoload/ada.vim index cc5191fa43..d04feb9250 100644 --- a/runtime/autoload/ada.vim +++ b/runtime/autoload/ada.vim @@ -2,12 +2,13 @@ " Description: Perform Ada specific completion & tagging. " Language: Ada (2005) " $Id: ada.vim 887 2008-07-08 14:29:01Z krischik $ -" Maintainer: Martin Krischik +" Maintainer: Mathias Brousset +" Martin Krischik " Taylor Venable " Neil Bird " Ned Okie " $Author: krischik $ -" $Date: 2008-07-08 16:29:01 +0200 (Di, 08 Jul 2008) $ +" $Date: 2017-01-31 20:20:05 +0200 (Mon, 01 Jan 2017) $ " Version: 4.6 " $Revision: 887 $ " $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/ada.vim $ @@ -23,6 +24,7 @@ " 09.05.2007 MK Session just won't work no matter how much " tweaking is done " 19.09.2007 NO still some mapleader problems +" 31.01.2017 MB fix more mapleader problems " Help Page: ft-ada-functions "------------------------------------------------------------------------------ @@ -585,11 +587,11 @@ function ada#Map_Menu (Text, Keys, Command) \ " :" . a:Command . "" execute \ "nnoremap " . - \ escape(l:leader . "a" . a:Keys , '\') . + \ " a" . a:Keys . \" :" . a:Command execute \ "inoremap " . - \ escape(l:leader . "a" . a:Keys , '\') . + \ " a" . a:Keys . \" :" . a:Command endif return diff --git a/runtime/autoload/context.vim b/runtime/autoload/context.vim new file mode 100644 index 0000000000..254d710c01 --- /dev/null +++ b/runtime/autoload/context.vim @@ -0,0 +1,184 @@ +" Language: ConTeXt typesetting engine +" Maintainer: Nicola Vitacolonna +" Latest Revision: 2016 Oct 21 + +let s:keepcpo= &cpo +set cpo&vim + +" Helper functions {{{ +function! s:context_echo(message, mode) + redraw + echo "\r" + execute 'echohl' a:mode + echomsg '[ConTeXt]' a:message + echohl None +endf + +function! s:sh() + return has('win32') || has('win64') || has('win16') || has('win95') + \ ? ['cmd.exe', '/C'] + \ : ['/bin/sh', '-c'] +endfunction + +" For backward compatibility +if exists('*win_getid') + + function! s:win_getid() + return win_getid() + endf + + function! s:win_id2win(winid) + return win_id2win(a:winid) + endf + +else + + function! s:win_getid() + return winnr() + endf + + function! s:win_id2win(winnr) + return a:winnr + endf + +endif +" }}} + +" ConTeXt jobs {{{ +if has('job') + + let g:context_jobs = [] + + " Print the status of ConTeXt jobs + function! context#job_status() + let l:jobs = filter(g:context_jobs, 'job_status(v:val) == "run"') + let l:n = len(l:jobs) + call s:context_echo( + \ 'There '.(l:n == 1 ? 'is' : 'are').' '.(l:n == 0 ? 'no' : l:n) + \ .' job'.(l:n == 1 ? '' : 's').' running' + \ .(l:n == 0 ? '.' : ' (' . join(l:jobs, ', ').').'), + \ 'ModeMsg') + endfunction + + " Stop all ConTeXt jobs + function! context#stop_jobs() + let l:jobs = filter(g:context_jobs, 'job_status(v:val) == "run"') + for job in l:jobs + call job_stop(job) + endfor + sleep 1 + let l:tmp = [] + for job in l:jobs + if job_status(job) == "run" + call add(l:tmp, job) + endif + endfor + let g:context_jobs = l:tmp + if empty(g:context_jobs) + call s:context_echo('Done. No jobs running.', 'ModeMsg') + else + call s:context_echo('There are still some jobs running. Please try again.', 'WarningMsg') + endif + endfunction + + function! context#callback(path, job, status) + if index(g:context_jobs, a:job) != -1 && job_status(a:job) != 'run' " just in case + call remove(g:context_jobs, index(g:context_jobs, a:job)) + endif + call s:callback(a:path, a:job, a:status) + endfunction + + function! context#close_cb(channel) + call job_status(ch_getjob(a:channel)) " Trigger exit_cb's callback for faster feedback + endfunction + + function! s:typeset(path) + call add(g:context_jobs, + \ job_start(add(s:sh(), context#command() . ' ' . shellescape(fnamemodify(a:path, ":t"))), { + \ 'close_cb' : 'context#close_cb', + \ 'exit_cb' : function(get(b:, 'context_callback', get(g:, 'context_callback', 'context#callback')), + \ [a:path]), + \ 'in_io' : 'null' + \ })) + endfunction + +else " No jobs + + function! context#job_status() + call s:context_echo('Not implemented', 'WarningMsg') + endfunction! + + function! context#stop_jobs() + call s:context_echo('Not implemented', 'WarningMsg') + endfunction + + function! context#callback(path, job, status) + call s:callback(a:path, a:job, a:status) + endfunction + + function! s:typeset(path) + execute '!' . context#command() . ' ' . shellescape(fnamemodify(a:path, ":t")) + call call(get(b:, 'context_callback', get(g:, 'context_callback', 'context#callback')), + \ [a:path, 0, v:shell_error]) + endfunction + +endif " has('job') + +function! s:callback(path, job, status) abort + if a:status < 0 " Assume the job was terminated + return + endif + " Get info about the current window + let l:winid = s:win_getid() " Save window id + let l:efm = &l:errorformat " Save local errorformat + let l:cwd = fnamemodify(getcwd(), ":p") " Save local working directory + " Set errorformat to parse ConTeXt errors + execute 'setl efm=' . escape(b:context_errorformat, ' ') + try " Set cwd to expand error file correctly + execute 'lcd' fnameescape(fnamemodify(a:path, ':h')) + catch /.*/ + execute 'setl efm=' . escape(l:efm, ' ') + throw v:exception + endtry + try + execute 'cgetfile' fnameescape(fnamemodify(a:path, ':r') . '.log') + botright cwindow + finally " Restore cwd and errorformat + execute s:win_id2win(l:winid) . 'wincmd w' + execute 'lcd ' . fnameescape(l:cwd) + execute 'setl efm=' . escape(l:efm, ' ') + endtry + if a:status == 0 + call s:context_echo('Success!', 'ModeMsg') + else + call s:context_echo('There are errors. ', 'ErrorMsg') + endif +endfunction + +function! context#command() + return get(b:, 'context_mtxrun', get(g:, 'context_mtxrun', 'mtxrun')) + \ . ' --script context --autogenerate --nonstopmode' + \ . ' --synctex=' . (get(b:, 'context_synctex', get(g:, 'context_synctex', 0)) ? '1' : '0') + \ . ' ' . get(b:, 'context_extra_options', get(g:, 'context_extra_options', '')) +endfunction + +" Accepts an optional path (useful for big projects, when the file you are +" editing is not the project's root document). If no argument is given, uses +" the path of the current buffer. +function! context#typeset(...) abort + let l:path = fnamemodify(strlen(a:000[0]) > 0 ? a:1 : expand("%"), ":p") + let l:cwd = fnamemodify(getcwd(), ":p") " Save local working directory + call s:context_echo('Typesetting...', 'ModeMsg') + execute 'lcd' fnameescape(fnamemodify(l:path, ":h")) + try + call s:typeset(l:path) + finally " Restore local working directory + execute 'lcd ' . fnameescape(l:cwd) + endtry +endfunction! +"}}} + +let &cpo = s:keepcpo +unlet s:keepcpo + +" vim: sw=2 fdm=marker diff --git a/runtime/autoload/contextcomplete.vim b/runtime/autoload/contextcomplete.vim new file mode 100644 index 0000000000..5b93bb0986 --- /dev/null +++ b/runtime/autoload/contextcomplete.vim @@ -0,0 +1,25 @@ +" Language: ConTeXt typesetting engine +" Maintainer: Nicola Vitacolonna +" Latest Revision: 2016 Oct 15 + +let s:keepcpo= &cpo +set cpo&vim + +" Complete keywords in MetaPost blocks +function! contextcomplete#Complete(findstart, base) + if a:findstart == 1 + if len(synstack(line('.'), 1)) > 0 && + \ synIDattr(synstack(line('.'), 1)[0], "name") ==# 'contextMPGraphic' + return syntaxcomplete#Complete(a:findstart, a:base) + else + return -3 + endif + else + return syntaxcomplete#Complete(a:findstart, a:base) + endif +endfunction + +let &cpo = s:keepcpo +unlet s:keepcpo + +" vim: sw=2 fdm=marker diff --git a/runtime/autoload/gzip.vim b/runtime/autoload/gzip.vim index a6b4605b06..e4adec0947 100644 --- a/runtime/autoload/gzip.vim +++ b/runtime/autoload/gzip.vim @@ -1,6 +1,6 @@ " Vim autoload file for editing compressed files. " Maintainer: Bram Moolenaar -" Last Change: 2014 Nov 05 +" Last Change: 2016 Sep 28 " These functions are used by the gzip plugin. @@ -63,6 +63,9 @@ fun gzip#read(cmd) " set 'modifiable' let ma_save = &ma setlocal ma + " set 'write' + let write_save = &write + set write " Reset 'foldenable', otherwise line numbers get adjusted. if has("folding") let fen_save = &fen @@ -127,6 +130,7 @@ fun gzip#read(cmd) let &pm = pm_save let &cpo = cpo_save let &l:ma = ma_save + let &write = write_save if has("folding") let &l:fen = fen_save endif diff --git a/runtime/autoload/health.vim b/runtime/autoload/health.vim index b0791eb19d..53d45afc2e 100644 --- a/runtime/autoload/health.vim +++ b/runtime/autoload/health.vim @@ -1,24 +1,24 @@ function! s:enhance_syntax() abort syntax case match - syntax keyword healthError ERROR + syntax keyword healthError ERROR[:] \ containedin=markdownCodeBlock,mkdListItemLine - highlight link healthError Error + highlight default link healthError Error - syntax keyword healthWarning WARNING + syntax keyword healthWarning WARNING[:] \ containedin=markdownCodeBlock,mkdListItemLine - highlight link healthWarning WarningMsg + highlight default link healthWarning WarningMsg - syntax keyword healthSuccess SUCCESS + syntax keyword healthSuccess OK[:] \ containedin=markdownCodeBlock,mkdListItemLine - highlight healthSuccess guibg=#5fff00 guifg=#080808 ctermbg=82 ctermfg=232 + highlight default healthSuccess guibg=#5fff00 guifg=#080808 ctermbg=82 ctermfg=232 syntax match healthHelp "|.\{-}|" contains=healthBar \ containedin=markdownCodeBlock,mkdListItemLine syntax match healthBar "|" contained conceal - highlight link healthHelp Identifier + highlight default link healthHelp Identifier - " We do not care about markdown syntax errors in :CheckHealth output. + " We do not care about markdown syntax errors in :checkhealth output. highlight! link markdownError Normal endfunction @@ -34,6 +34,7 @@ function! health#check(plugin_names) abort setlocal filetype=markdown setlocal conceallevel=2 concealcursor=nc setlocal keywordprg=:help + let &l:iskeyword='!-~,^*,^|,^",192-255' call s:enhance_syntax() if empty(healthchecks) @@ -66,6 +67,7 @@ function! health#check(plugin_names) abort " needed for plasticboy/vim-markdown, because it uses fdm=expr normal! zR setlocal nomodified + setlocal bufhidden=hide redraw|echo '' endfunction @@ -88,27 +90,27 @@ endfunction " Changes ':h clipboard' to ':help |clipboard|'. function! s:help_to_link(s) abort - return substitute(a:s, '\v[''"]?:h%[elp] ([^''"]+)[''"]?', '":help |\1|"', 'g') + return substitute(a:s, '\v:h%[elp] ([^|][^"\r\n ]+)', ':help |\1|', 'g') endfunction " Format a message for a specific report item function! s:format_report_message(status, msg, ...) abort " {{{ let output = ' - ' . a:status . ': ' . s:indent_after_line1(a:msg, 4) - let suggestions = [] + let advice = [] " Optional parameters if a:0 > 0 - let suggestions = type(a:1) == type("") ? [a:1] : a:1 - if type(suggestions) != type([]) - echoerr "Expected String or List" + let advice = type(a:1) == type("") ? [a:1] : a:1 + if type(advice) != type([]) + throw "Expected String or List" endif endif " Report each suggestion - if len(suggestions) > 0 - let output .= "\n - SUGGESTIONS:" + if len(advice) > 0 + let output .= "\n - ADVICE:" endif - for suggestion in suggestions + for suggestion in advice let output .= "\n - " . s:indent_after_line1(suggestion, 10) endfor @@ -122,7 +124,7 @@ endfunction " }}} " Reports a successful healthcheck. function! health#report_ok(msg) abort " {{{ - echo s:format_report_message('SUCCESS', a:msg) + echo s:format_report_message('OK', a:msg) endfunction " }}} " Reports a health warning. @@ -157,7 +159,10 @@ endfunction " Translates a list of plugin names to healthcheck function names. function! s:to_fn_names(plugin_names) abort let healthchecks = [] - for p in a:plugin_names + let plugin_names = type('') ==# type(a:plugin_names) + \ ? split(a:plugin_names, '', v:false) + \ : a:plugin_names + for p in plugin_names call add(healthchecks, 'health#'.p.'#check') endfor return healthchecks diff --git a/runtime/autoload/health/nvim.vim b/runtime/autoload/health/nvim.vim index a1bf9b21cf..58033f0405 100644 --- a/runtime/autoload/health/nvim.vim +++ b/runtime/autoload/health/nvim.vim @@ -1,15 +1,31 @@ -let s:suggest_faq = 'See https://github.com/neovim/neovim/wiki/FAQ' +let s:suggest_faq = 'https://github.com/neovim/neovim/wiki/FAQ' function! s:check_config() abort + let ok = v:true call health#report_start('Configuration') - if !get(g:, 'loaded_sensible', 0) + + " If $VIM is empty we don't care. Else make sure it is valid. + if !empty($VIM) && !filereadable($VIM.'/runtime/doc/nvim.txt') + let ok = v:false + call health#report_error("$VIM is invalid: ".$VIM) + endif + + if exists('$NVIM_TUI_ENABLE_CURSOR_SHAPE') + let ok = v:false + call health#report_warn("$NVIM_TUI_ENABLE_CURSOR_SHAPE is ignored in Nvim 0.2+", + \ [ "Use the 'guicursor' option to configure cursor shape. :help 'guicursor'", + \ 'https://github.com/neovim/neovim/wiki/Following-HEAD#20170402' ]) + endif + + if &paste + let ok = v:false + call health#report_error("'paste' is enabled. This option is only for pasting text.\nIt should not be set in your config.", + \ [ 'Remove `set paste` from your init.vim, if applicable.', + \ 'Check `:verbose set paste?` to see if a plugin or script set the option.', ]) + endif + + if ok call health#report_ok('no issues found') - else - let sensible_pi = globpath(&runtimepath, '**/sensible.vim', 1, 1) - call health#report_info("found sensible.vim plugin:\n".join(sensible_pi, "\n")) - call health#report_error("sensible.vim plugin is not needed; Nvim has the same defaults built-in." - \ ." Also, sensible.vim sets 'ttimeoutlen' to a sub-optimal value.", - \ ["Remove sensible.vim plugin, or wrap it in a `if !has('nvim')` check."]) endif endfunction @@ -42,7 +58,7 @@ function! s:check_rplugin_manifest() abort let contents = join(readfile(script)) if contents =~# '\<\%(from\|import\)\s\+neovim\>' if script =~# '[\/]__init__\.py$' - let script = fnamemodify(script, ':h') + let script = tr(fnamemodify(script, ':h'), '\', '/') endif if !has_key(existing_rplugins, script) @@ -118,6 +134,12 @@ function! s:check_tmux() abort let cmd = 'tmux show-option -qvg default-terminal' let out = system(cmd) let tmux_default_term = substitute(out, '\v(\s|\r|\n)', '', 'g') + if empty(tmux_default_term) + let cmd = 'tmux show-option -qvgs default-terminal' + let out = system(cmd) + let tmux_default_term = substitute(out, '\v(\s|\r|\n)', '', 'g') + endif + if v:shell_error call health#report_error('command failed: '.cmd."\n".out) elseif tmux_default_term !=# $TERM @@ -151,6 +173,11 @@ function! s:check_terminal() abort call health#report_info('key_dc (kdch1) terminfo entry: ' \ .(empty(kbs_entry) ? '? (not found)' : kdch1_entry)) endif + for env_var in ['XTERM_VERSION', 'VTE_VERSION', 'TERM_PROGRAM', 'COLORTERM', 'SSH_TTY'] + if !exists('$'.env_var) + call health#report_info(printf("$%s='%s'", env_var, eval('$'.env_var))) + endif + endfor endfunction function! health#nvim#check() abort diff --git a/runtime/autoload/health/provider.vim b/runtime/autoload/health/provider.vim index 57dd508f96..0201ed8062 100644 --- a/runtime/autoload/health/provider.vim +++ b/runtime/autoload/health/provider.vim @@ -8,6 +8,11 @@ function! s:trim(s) abort return substitute(a:s, '^\_s*\|\_s*$', '', 'g') endfunction +" Convert '\' to '/'. Collapse '//' and '/./'. +function! s:normalize_path(s) abort + return substitute(substitute(a:s, '\', '/', 'g'), '/\./\|/\+', '/', 'g') +endfunction + " Simple version comparison. function! s:version_cmp(a, b) abort let a = split(a:a, '\.', 0) @@ -26,13 +31,23 @@ endfunction " Handler for s:system() function. function! s:system_handler(jobid, data, event) dict abort - if a:event == 'stdout' || a:event == 'stderr' + if a:event ==# 'stdout' || a:event ==# 'stderr' let self.output .= join(a:data, '') - elseif a:event == 'exit' + elseif a:event ==# 'exit' let s:shell_error = a:data endif endfunction +" Attempts to construct a shell command from an args list. +" Only for display, to help users debug a failed command. +function! s:shellify(cmd) abort + if type(a:cmd) != type([]) + return a:cmd + endif + return join(map(copy(a:cmd), + \'v:val =~# ''\m[\-.a-zA-Z_/]'' ? shellescape(v:val) : v:val'), ' ') +endfunction + " Run a system command and timeout after 30 seconds. function! s:system(cmd, ...) abort let stdin = a:0 ? a:1 : '' @@ -49,8 +64,7 @@ function! s:system(cmd, ...) abort let jobid = jobstart(a:cmd, opts) if jobid < 1 - call health#report_error(printf('Command error %d: %s', jobid, - \ type(a:cmd) == type([]) ? join(a:cmd) : a:cmd))) + call health#report_error(printf('Command error (job=%d): %s', jobid, s:shellify(a:cmd))) let s:shell_error = 1 return opts.output endif @@ -61,13 +75,11 @@ function! s:system(cmd, ...) abort let res = jobwait([jobid], 30000) if res[0] == -1 - call health#report_error(printf('Command timed out: %s', - \ type(a:cmd) == type([]) ? join(a:cmd) : a:cmd)) + call health#report_error(printf('Command timed out: %s', s:shellify(a:cmd))) call jobstop(jobid) elseif s:shell_error != 0 && !ignore_error - call health#report_error(printf("Command error (%d) %s: %s", jobid, - \ type(a:cmd) == type([]) ? join(a:cmd) : a:cmd, - \ opts.output)) + call health#report_error(printf("Command error (job=%d): %s\nOutput: %s", jobid, + \ s:shellify(a:cmd), opts.output)) endif return opts.output @@ -106,13 +118,17 @@ endfunction " Check for clipboard tools. function! s:check_clipboard() abort - call health#report_start('Clipboard') + call health#report_start('Clipboard (optional)') let clipboard_tool = provider#clipboard#Executable() - if empty(clipboard_tool) + if exists('g:clipboard') && empty(clipboard_tool) + call health#report_error( + \ provider#clipboard#Error(), + \ ["Use the example in :help g:clipboard as a template, or don't set g:clipboard at all."]) + elseif empty(clipboard_tool) call health#report_warn( - \ "No clipboard tool found. Clipboard registers will not work.", - \ ['See ":help clipboard".']) + \ 'No clipboard tool found. Clipboard registers (`"+` and `"*`) will not work.', + \ [':help clipboard']) else call health#report_ok('Clipboard tool found: '. clipboard_tool) endif @@ -152,7 +168,7 @@ function! s:version_info(python) abort \ ])) if empty(python_version) - let python_version = 'unable to parse python response' + let python_version = 'unable to parse '.a:python.' response' endif let nvim_path = s:trim(s:system([ @@ -164,14 +180,14 @@ function! s:version_info(python) abort " Assuming that multiple versions of a package are installed, sort them " numerically in descending order. - function! s:compare(metapath1, metapath2) + function! s:compare(metapath1, metapath2) abort let a = matchstr(fnamemodify(a:metapath1, ':p:h:t'), '[0-9.]\+') let b = matchstr(fnamemodify(a:metapath2, ':p:h:t'), '[0-9.]\+') return a == b ? 0 : a > b ? 1 : -1 endfunction " Try to get neovim.VERSION (added in 0.1.11dev). - let nvim_version = s:system(['python', '-c', + let nvim_version = s:system([a:python, '-c', \ 'from neovim import VERSION as v; '. \ 'print("{}.{}.{}{}".format(v.major, v.minor, v.patch, v.prerelease))'], \ '', 1, 1) @@ -208,7 +224,7 @@ endfunction " Check the Python interpreter's usability. function! s:check_bin(bin) abort - if !filereadable(a:bin) + if !filereadable(a:bin) && (!has('win32') || !filereadable(a:bin.'.exe')) call health#report_error(printf('"%s" was not found.', a:bin)) return 0 elseif executable(a:bin) != 1 @@ -219,11 +235,11 @@ function! s:check_bin(bin) abort endfunction function! s:check_python(version) abort - call health#report_start('Python ' . a:version . ' provider') + call health#report_start('Python ' . a:version . ' provider (optional)') let pyname = 'python'.(a:version == 2 ? '' : '3') let pyenv = resolve(exepath('pyenv')) - let pyenv_root = exists('$PYENV_ROOT') ? resolve($PYENV_ROOT) : 'n' + let pyenv_root = exists('$PYENV_ROOT') ? resolve($PYENV_ROOT) : '' let venv = exists('$VIRTUAL_ENV') ? resolve($VIRTUAL_ENV) : '' let host_prog_var = pyname.'_host_prog' let loaded_var = 'g:loaded_'.pyname.'_provider' @@ -235,6 +251,19 @@ function! s:check_python(version) abort return endif + if !empty(pyenv) + if empty(pyenv_root) + call health#report_warn( + \ 'pyenv was found, but $PYENV_ROOT is not set.', + \ ['Did you follow the final install instructions?', + \ 'If you use a shell "framework" like Prezto or Oh My Zsh, try without.', + \ 'Try a different shell (bash).'] + \ ) + else + call health#report_ok(printf('pyenv found: "%s"', pyenv)) + endif + endif + if exists('g:'.host_prog_var) call health#report_info(printf('Using: g:%s = "%s"', host_prog_var, get(g:, host_prog_var))) endif @@ -266,15 +295,6 @@ function! s:check_python(version) abort endif if !empty(pyenv) - if empty(pyenv_root) - call health#report_warn( - \ 'pyenv was found, but $PYENV_ROOT is not set.', - \ ['Did you follow the final install instructions?'] - \ ) - else - call health#report_ok(printf('pyenv found: "%s"', pyenv)) - endif - let python_bin = s:trim(s:system([pyenv, 'which', pyname], '', 1)) if empty(python_bin) @@ -287,8 +307,9 @@ function! s:check_python(version) abort if exists('$PATH') for path in split($PATH, has('win32') ? ';' : ':') - let path_bin = path.'/'.pyname - if path_bin != python_bin && index(python_multiple, path_bin) == -1 + let path_bin = s:normalize_path(path.'/'.pyname) + if path_bin != s:normalize_path(python_bin) + \ && index(python_multiple, path_bin) == -1 \ && executable(path_bin) call add(python_multiple, path_bin) endif @@ -303,9 +324,8 @@ function! s:check_python(version) abort if python_bin =~# '\' call health#report_warn(printf('`%s` appears to be a pyenv shim.', python_bin), [ - \ 'The `pyenv` executable is not in $PATH,', - \ 'Your pyenv installation is broken. You should set ' - \ . '`g:'.host_prog_var.'` to avoid surprises.', + \ '`pyenv` is not in $PATH, your pyenv installation is broken. ' + \ .'Set `g:'.host_prog_var.'` to avoid surprises.', \ ]) endif endif @@ -318,7 +338,7 @@ function! s:check_python(version) abort call health#report_warn('pyenv is not set up optimally.', [ \ printf('Create a virtualenv specifically ' \ . 'for Neovim using pyenv, and set `g:%s`. This will avoid ' - \ . 'the need to install Neovim''s Python module in each ' + \ . 'the need to install the Neovim Python module in each ' \ . 'version/virtualenv.', host_prog_var) \ ]) elseif !empty(venv) && exists('g:'.host_prog_var) @@ -413,7 +433,7 @@ function! s:check_python(version) abort endfunction function! s:check_ruby() abort - call health#report_start('Ruby provider') + call health#report_start('Ruby provider (optional)') let loaded_var = 'g:loaded_ruby_provider' if exists(loaded_var) && !exists('*provider#ruby#Call') @@ -423,8 +443,8 @@ function! s:check_ruby() abort if !executable('ruby') || !executable('gem') call health#report_warn( - \ "`ruby` and `gem` must be in $PATH.", - \ ["Install Ruby and verify that `ruby` and `gem` commands work."]) + \ '`ruby` and `gem` must be in $PATH.', + \ ['Install Ruby and verify that `ruby` and `gem` commands work.']) return endif call health#report_info('Ruby: '. s:system('ruby -v')) @@ -439,21 +459,21 @@ function! s:check_ruby() abort endif call health#report_info('Host: '. host) - let latest_gem_cmd = 'gem list -ra ^neovim$' + let latest_gem_cmd = has('win32') ? 'cmd /c gem list -ra ^^neovim$' : 'gem list -ra ^neovim$' let latest_gem = s:system(split(latest_gem_cmd)) if s:shell_error || empty(latest_gem) call health#report_error('Failed to run: '. latest_gem_cmd, \ ["Make sure you're connected to the internet.", - \ "Are you behind a firewall or proxy?"]) + \ 'Are you behind a firewall or proxy?']) return endif - let latest_gem = get(split(latest_gem, ' (\|, \|)$' ), 1, 'not found') + let latest_gem = get(split(latest_gem, 'neovim (\|, \|)$' ), 1, 'not found') let current_gem_cmd = host .' --version' let current_gem = s:system(current_gem_cmd) if s:shell_error call health#report_error('Failed to run: '. current_gem_cmd, - \ ["Report this issue with the output of: ", current_gem_cmd]) + \ ['Report this issue with the output of: ', current_gem_cmd]) return endif @@ -467,9 +487,71 @@ function! s:check_ruby() abort endif endfunction +function! s:check_node() abort + call health#report_start('Node provider (optional)') + + let loaded_var = 'g:loaded_node_provider' + if exists(loaded_var) && !exists('*provider#node#Call') + call health#report_info('Disabled. '.loaded_var.'='.eval(loaded_var)) + return + endif + + if !executable('node') || !executable('npm') + call health#report_warn( + \ '`node` and `npm` must be in $PATH.', + \ ['Install Node.js and verify that `node` and `npm` commands work.']) + return + endif + call health#report_info('Node: '. s:system('node -v')) + + let host = provider#node#Detect() + if empty(host) + call health#report_warn('Missing "neovim" npm package.', + \ ['Run in shell: npm install -g neovim', + \ 'Is the npm bin directory in $PATH?']) + return + endif + call health#report_info('Host: '. host) + + let latest_npm_cmd = has('win32') ? 'cmd /c npm info neovim --json' : 'npm info neovim --json' + let latest_npm = s:system(split(latest_npm_cmd)) + if s:shell_error || empty(latest_npm) + call health#report_error('Failed to run: '. latest_npm_cmd, + \ ["Make sure you're connected to the internet.", + \ 'Are you behind a firewall or proxy?']) + return + endif + if !empty(latest_npm) + try + let pkg_data = json_decode(latest_npm) + catch /E474/ + return 'error: '.latest_npm + endtry + let latest_npm = get(get(pkg_data, 'dist-tags', {}), 'latest', 'unable to parse') + endif + + let current_npm_cmd = host .' --version' + let current_npm = s:system(current_npm_cmd) + if s:shell_error + call health#report_error('Failed to run: '. current_npm_cmd, + \ ['Report this issue with the output of: ', current_npm_cmd]) + return + endif + + if s:version_cmp(current_npm, latest_npm) == -1 + call health#report_warn( + \ printf('Package "neovim" is out-of-date. Installed: %s, latest: %s', + \ current_npm, latest_npm), + \ ['Run in shell: npm update neovim']) + else + call health#report_ok('Latest "neovim" npm is installed: '. current_npm) + endif +endfunction + function! health#provider#check() abort call s:check_clipboard() call s:check_python(2) call s:check_python(3) call s:check_ruby() + call s:check_node() endfunction diff --git a/runtime/autoload/javascriptcomplete.vim b/runtime/autoload/javascriptcomplete.vim index 2abe41b463..14bc3d7ce3 100644 --- a/runtime/autoload/javascriptcomplete.vim +++ b/runtime/autoload/javascriptcomplete.vim @@ -1,7 +1,7 @@ " Vim completion script " Language: Java Script " Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl ) -" Last Change: 2006 Apr 30 +" Last Change: 2017 Mar 04 function! javascriptcomplete#CompleteJS(findstart, base) if a:findstart @@ -563,7 +563,7 @@ function! javascriptcomplete#CompleteJS(findstart, base) for i in arguments let g:ia = i let f_elements = matchlist(i, 'function\s\+\(\k\+\)\s*(\(.\{-}\))') - if len(f_elements) == 3 + if len(f_elements) >= 3 let b:js_menuinfo[f_elements[1].'('] = f_elements[2] endif endfor diff --git a/runtime/autoload/man.vim b/runtime/autoload/man.vim index 4352a8c782..dd71ede680 100644 --- a/runtime/autoload/man.vim +++ b/runtime/autoload/man.vim @@ -1,16 +1,31 @@ " Maintainer: Anmol Sethi -let s:man_find_arg = "-w" +let s:find_arg = '-w' +let s:localfile_arg = v:true " Always use -l if possible. #6683 +let s:section_arg = '-s' -" TODO(nhooyr) Completion may work on SunOS; I'm not sure if `man -l` displays -" the list of searched directories. -try - if !has('win32') && $OSTYPE !~? 'cygwin\|linux' && system('uname -s') =~? 'SunOS' && system('uname -r') =~# '^5' - let s:man_find_arg = '-l' +function! s:init_section_flag() + call system(['env', 'MANPAGER=cat', 'man', s:section_arg, '1', 'man']) + if v:shell_error + let s:section_arg = '-S' endif -catch /E145:/ - " Ignore the error in restricted mode -endtry +endfunction + +function! s:init() abort + call s:init_section_flag() + " TODO(nhooyr): Does `man -l` on SunOS list searched directories? + try + if !has('win32') && $OSTYPE !~? 'cygwin\|linux' && system('uname -s') =~? 'SunOS' && system('uname -r') =~# '^5' + let s:find_arg = '-l' + endif + " Check for -l support. + call s:get_page(s:get_path('', 'man')[0:-2]) + catch /E145:/ + " Ignore the error in restricted mode + catch /command error .*/ + let s:localfile_arg = v:false + endtry +endfunction function! man#open_page(count, count1, mods, ...) abort if a:0 > 2 @@ -79,7 +94,7 @@ function! man#read_page(ref) abort let [sect, name, path] = s:verify_exists(sect, name) let page = s:get_page(path) catch - " call to s:error() is unnecessary + call s:error(v:exception) return endtry let b:man_sect = sect @@ -88,10 +103,8 @@ endfunction " Handler for s:system() function. function! s:system_handler(jobid, data, event) dict abort - if a:event == 'stdout' - let self.stdout .= join(a:data, "\n") - elseif a:event == 'stderr' - let self.stderr .= join(a:data, "\n") + if a:event is# 'stdout' || a:event is# 'stderr' + let self[a:event] .= join(a:data, "\n") else let self.exit_code = a:data endif @@ -118,7 +131,7 @@ function! s:system(cmd, ...) abort try call jobstop(jobid) throw printf('command timed out: %s', join(a:cmd)) - catch /^Vim\%((\a\+)\)\=:E900/ + catch /^Vim(call):E900:/ endtry elseif res[0] == -2 throw printf('command interrupted: %s', join(a:cmd)) @@ -135,7 +148,8 @@ function! s:get_page(path) abort let manwidth = empty($MANWIDTH) ? winwidth(0) : $MANWIDTH " Force MANPAGER=cat to ensure Vim is not recursively invoked (by man-db). " http://comments.gmane.org/gmane.editors.vim.devel/29085 - return s:system(['env', 'MANPAGER=cat', 'MANWIDTH='.manwidth, 'man', a:path]) + let cmd = ['env', 'MANPAGER=cat', 'MANWIDTH='.manwidth, 'man'] + return s:system(cmd + (s:localfile_arg ? ['-l', a:path] : [a:path])) endfunction function! s:put_page(page) abort @@ -151,6 +165,31 @@ function! s:put_page(page) abort setlocal filetype=man endfunction +function! man#show_toc() abort + let bufname = bufname('%') + let info = getloclist(0, {'winid': 1}) + if !empty(info) && getwinvar(info.winid, 'qf_toc') ==# bufname + lopen + return + endif + + let toc = [] + let lnum = 2 + let last_line = line('$') - 1 + while lnum && lnum < last_line + let text = getline(lnum) + if text =~# '^\%( \{3\}\)\=\S.*$' + call add(toc, {'bufnr': bufnr('%'), 'lnum': lnum, 'text': text}) + endif + let lnum = nextnonblank(lnum + 1) + endwhile + + call setloclist(0, toc, ' ') + call setloclist(0, [], 'a', {'title': 'Man TOC'}) + lopen + let w:qf_toc = bufname +endfunction + " attempt to extract the name and sect out of 'name(sect)' " otherwise just return the largest string of valid characters in ref function! man#extract_sect_and_name_ref(ref) abort @@ -174,14 +213,14 @@ endfunction function! s:get_path(sect, name) abort if empty(a:sect) - return s:system(['man', s:man_find_arg, a:name]) + return s:system(['man', s:find_arg, a:name]) endif " '-s' flag handles: " - tokens like 'printf(echo)' " - sections starting with '-' " - 3pcap section (found on macOS) " - commas between sections (for section priority) - return s:system(['man', s:man_find_arg, '-s', a:sect, a:name]) + return s:system(['man', s:find_arg, s:section_arg, a:sect, a:name]) endfunction function! s:verify_exists(sect, name) abort @@ -306,7 +345,7 @@ endfunction function! s:complete(sect, psect, name) abort try - let mandirs = join(split(s:system(['man', s:man_find_arg]), ':\|\n'), ',') + let mandirs = join(split(s:system(['man', s:find_arg]), ':\|\n'), ',') catch call s:error(v:exception) return @@ -348,3 +387,5 @@ function! man#init_pager() abort endtry execute 'silent file man://'.fnameescape(ref) endfunction + +call s:init() diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim index de85844d5d..76485c2f38 100644 --- a/runtime/autoload/netrw.vim +++ b/runtime/autoload/netrw.vim @@ -22,8 +22,8 @@ if &cp || exists("g:loaded_netrw") finish endif -" netrw requires vim having patch 213; netrw will benefit from vim's having patch#656, too -if v:version < 704 || !has("patch213") +" netrw requires vim having patch 7.4.213; netrw will benefit from vim's having patch#656, too +if v:version < 704 || (v:version == 704 && !has("patch213")) if !exists("s:needpatch213") unsilent echomsg "***sorry*** this version of netrw requires vim v7.4 with patch 213" endif diff --git a/runtime/autoload/paste.vim b/runtime/autoload/paste.vim index fcf06ecdf9..dd7b3ae54a 100644 --- a/runtime/autoload/paste.vim +++ b/runtime/autoload/paste.vim @@ -1,6 +1,6 @@ " Vim support file to help with paste mappings and menus " Maintainer: Bram Moolenaar -" Last Change: 2006 Jun 23 +" Last Change: 2017 Aug 30 " Define the string to use for items that are present both in Edit, Popup and " Toolbar menu. Also used in mswin.vim and macmap.vim. @@ -12,7 +12,7 @@ if has("virtualedit") let paste#paste_cmd = {'n': ":call paste#Paste()"} let paste#paste_cmd['v'] = '"-c' . paste#paste_cmd['n'] - let paste#paste_cmd['i'] = 'x' . paste#paste_cmd['n'] . 'gi' + let paste#paste_cmd['i'] = "\\\"+gP" func! paste#Paste() let ove = &ve diff --git a/runtime/autoload/phpcomplete.vim b/runtime/autoload/phpcomplete.vim index 7f25d9df33..8e38867a77 100644 --- a/runtime/autoload/phpcomplete.vim +++ b/runtime/autoload/phpcomplete.vim @@ -3,7 +3,7 @@ " Maintainer: Dávid Szabó ( complex857 AT gmail DOT com ) " Previous Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl ) " URL: https://github.com/shawncplus/phpcomplete.vim -" Last Change: 2015 Jul 13 +" Last Change: 2016 Oct 10 " " OPTIONS: " @@ -195,6 +195,8 @@ function! phpcomplete#CompletePHP(findstart, base) " {{{ " }}} elseif context =~? 'implements' return phpcomplete#CompleteClassName(a:base, ['i'], current_namespace, imports) + elseif context =~? 'instanceof' + return phpcomplete#CompleteClassName(a:base, ['c', 'n'], current_namespace, imports) elseif context =~? 'extends\s\+.\+$' && a:base == '' return ['implements'] elseif context =~? 'extends' @@ -787,6 +789,8 @@ function! phpcomplete#CompleteClassName(base, kinds, current_namespace, imports) if kinds == ['c', 'i'] let filterstr = 'v:val =~? "\\(class\\|interface\\)\\s\\+[a-zA-Z_\\x7f-\\xff][a-zA-Z_0-9\\x7f-\\xff]*\\s*"' + elseif kinds == ['c', 'n'] + let filterstr = 'v:val =~? "\\(class\\|namespace\\)\\s\\+[a-zA-Z_\\x7f-\\xff][a-zA-Z_0-9\\x7f-\\xff]*\\s*"' elseif kinds == ['c'] let filterstr = 'v:val =~? "class\\s\\+[a-zA-Z_\\x7f-\\xff][a-zA-Z_0-9\\x7f-\\xff]*\\s*"' elseif kinds == ['i'] @@ -931,7 +935,7 @@ function! phpcomplete#EvaluateModifiers(modifiers, required_modifiers, prohibite endfor for modifier in a:modifiers - " if the modifier is prohibited its a no match + " if the modifier is prohibited it's a no match if index(a:prohibited_modifiers, modifier) != -1 return 0 endif @@ -996,7 +1000,7 @@ function! phpcomplete#CompleteUserClass(context, base, sccontent, visibility) " let required_modifiers += ['static'] endif let all_variable = filter(deepcopy(a:sccontent), - \ 'v:val =~ "^\\s*\\(var\\s\\+\\|public\\s\\+\\|protected\\s\\+\\|private\\s\\+\\|final\\s\\+\\|abstract\\s\\+\\|static\\s\\+\\)\\+\\$"') + \ 'v:val =~ "\\(^\\s*\\(var\\s\\+\\|public\\s\\+\\|protected\\s\\+\\|private\\s\\+\\|final\\s\\+\\|abstract\\s\\+\\|static\\s\\+\\)\\+\\$\\|^\\s*\\(\\/\\|\\*\\)*\\s*@property\\s\\+\\S\\+\\s\\S\\{-}\\s*$\\)"') let variables = [] for i in all_variable @@ -1160,6 +1164,14 @@ function! phpcomplete#GetTaglist(pattern) " {{{ endif let tags = taglist(a:pattern) + for tag in tags + for prop in keys(tag) + if prop == 'cmd' || prop == 'static' || prop == 'kind' || prop == 'builtin' + continue + endif + let tag[prop] = substitute(tag[prop], '\\\\', '\\', 'g') + endfor + endfor let s:cache_tags[a:pattern] = tags let has_key = has_key(s:cache_tags, a:pattern) let s:cache_tags_checksum = cache_checksum @@ -1379,7 +1391,7 @@ function! phpcomplete#GetCallChainReturnType(classname_candidate, class_candidat " Get Structured information of all classes and subclasses including namespace and includes " try to find the method's return type in docblock comment for classstructure in classcontents - let docblock_target_pattern = 'function\s\+&\?'.method.'\|\(public\|private\|protected\|var\).\+\$'.method + let docblock_target_pattern = 'function\s\+&\?'.method.'\>\|\(public\|private\|protected\|var\).\+\$'.method.'\>\|@property.\+\$'.method.'\>' let doc_str = phpcomplete#GetDocBlock(split(classstructure.content, '\n'), docblock_target_pattern) if doc_str != '' break @@ -1387,8 +1399,17 @@ function! phpcomplete#GetCallChainReturnType(classname_candidate, class_candidat endfor if doc_str != '' let docblock = phpcomplete#ParseDocBlock(doc_str) - if has_key(docblock.return, 'type') || has_key(docblock.var, 'type') - let type = has_key(docblock.return, 'type') ? docblock.return.type : docblock.var.type + if has_key(docblock.return, 'type') || has_key(docblock.var, 'type') || len(docblock.properties) > 0 + let type = has_key(docblock.return, 'type') ? docblock.return.type : has_key(docblock.var, 'type') ? docblock.var.type : '' + + if type == '' + for property in docblock.properties + if property.description =~? method + let type = property.type + break + endif + endfor + endif " there's a namespace in the type, threat the type as FQCN if type =~ '\\' @@ -1554,6 +1575,9 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor elseif get(methodstack, 0) =~# function_invocation_pattern let function_name = matchstr(methodstack[0], '^\s*\zs'.function_name_pattern) let function_file = phpcomplete#GetFunctionLocation(function_name, a:current_namespace) + if function_file == '' + let function_file = phpcomplete#GetFunctionLocation(function_name, '\') + endif if function_file == 'VIMPHP_BUILTINFUNCTION' " built in function, grab the return type from the info string @@ -1569,7 +1593,7 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor let [class_candidate_namespace, function_imports] = phpcomplete#GetCurrentNameSpace(file_lines) " try to expand the classname of the returned type with the context got from the function's source file - let [classname_candidate, unused] = phpcomplete#ExpandClassName(classname_candidate, class_candidate_namespace, function_imports) + let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(classname_candidate, class_candidate_namespace, function_imports) endif endif if classname_candidate != '' @@ -1650,9 +1674,10 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor let sub_methodstack = phpcomplete#GetMethodStack(matchstr(line, '^\s*'.object.'\s*=&\?\s*\s\+\zs.*')) let [classname_candidate, class_candidate_namespace] = phpcomplete#GetCallChainReturnType( \ classname, - \ a:current_namespace, + \ namespace_for_class, \ a:imports, \ sub_methodstack) + return (class_candidate_namespace == '\' || class_candidate_namespace == '') ? classname_candidate : class_candidate_namespace.'\'.classname_candidate endif endif @@ -1783,6 +1808,9 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor let [function_name, function_namespace] = phpcomplete#ExpandClassName(function_name, a:current_namespace, a:imports) let function_file = phpcomplete#GetFunctionLocation(function_name, function_namespace) + if function_file == '' + let function_file = phpcomplete#GetFunctionLocation(function_name, '\') + endif if function_file == 'VIMPHP_BUILTINFUNCTION' " built in function, grab the return type from the info string @@ -1798,7 +1826,7 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor let classname_candidate = docblock.return.type let [class_candidate_namespace, function_imports] = phpcomplete#GetCurrentNameSpace(file_lines) " try to expand the classname of the returned type with the context got from the function's source file - let [classname_candidate, unused] = phpcomplete#ExpandClassName(classname_candidate, class_candidate_namespace, function_imports) + let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(classname_candidate, class_candidate_namespace, function_imports) break endif endif @@ -1861,6 +1889,8 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor for tag in tags if tag.kind ==? 'v' && tag.cmd =~? '=\s*new\s\+\zs'.class_name_pattern.'\ze' let classname = matchstr(tag.cmd, '=\s*new\s\+\zs'.class_name_pattern.'\ze') + " unescape the classname, it would have "\" doubled since it is an ex command + let classname = substitute(classname, '\\\(\_.\)', '\1', 'g') return classname endif endfor @@ -2077,6 +2107,19 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam endif call searchpair('{', '', '}', 'W') let class_closing_bracket_line = line('.') + + " Include class docblock + let doc_line = cfline - 1 + if getline(doc_line) =~? '^\s*\*/' + while doc_line != 0 + if getline(doc_line) =~? '^\s*/\*\*' + let cfline = doc_line + break + endif + let doc_line -= 1 + endwhile + endif + let classcontent = join(getline(cfline, class_closing_bracket_line), "\n") let used_traits = [] @@ -2241,8 +2284,19 @@ function! phpcomplete#GetDocBlock(sccontent, search) " {{{ let line = a:sccontent[i] " search for a function declaration if line =~? a:search - let l = i - 1 - " start backward serch for the comment block + if line =~? '@property' + let doc_line = i + while doc_line != sccontent_len - 1 + if a:sccontent[doc_line] =~? '^\s*\*/' + let l = doc_line + break + endif + let doc_line += 1 + endwhile + else + let l = i - 1 + endif + " start backward search for the comment block while l != 0 let line = a:sccontent[l] " if it's a one line docblock like comment and we can just return it right away @@ -2263,7 +2317,7 @@ function! phpcomplete#GetDocBlock(sccontent, search) " {{{ return '' end - while l != 0 + while l >= 0 let line = a:sccontent[l] if line =~? '^\s*/\*\*' let comment_start = l @@ -2297,9 +2351,10 @@ function! phpcomplete#ParseDocBlock(docblock) " {{{ \ 'return': {}, \ 'throws': [], \ 'var': {}, + \ 'properties': [], \ } - let res.description = substitute(matchstr(a:docblock, '\zs\_.\{-}\ze\(@var\|@param\|@return\|$\)'), '\(^\_s*\|\_s*$\)', '', 'g') + let res.description = substitute(matchstr(a:docblock, '\zs\_.\{-}\ze\(@type\|@var\|@param\|@return\|$\)'), '\(^\_s*\|\_s*$\)', '', 'g') let docblock_lines = split(a:docblock, "\n") let param_lines = filter(copy(docblock_lines), 'v:val =~? "^@param"') @@ -2334,15 +2389,26 @@ function! phpcomplete#ParseDocBlock(docblock) " {{{ endif endfor - let var_line = filter(copy(docblock_lines), 'v:val =~? "^@var"') + let var_line = filter(copy(docblock_lines), 'v:val =~? "^\\(@var\\|@type\\)"') if len(var_line) > 0 - let var_parts = matchlist(var_line[0], '@var\s\+\(\S\+\)\s*\(.*\)') + let var_parts = matchlist(var_line[0], '\(@var\|@type\)\s\+\(\S\+\)\s*\(.*\)') let res['var'] = { \ 'line': var_parts[0], - \ 'type': phpcomplete#GetTypeFromDocBlockParam(get(var_parts, 1, '')), - \ 'description': get(var_parts, 2, '')} + \ 'type': phpcomplete#GetTypeFromDocBlockParam(get(var_parts, 2, '')), + \ 'description': get(var_parts, 3, '')} endif + let property_lines = filter(copy(docblock_lines), 'v:val =~? "^@property"') + for property_line in property_lines + let parts = matchlist(property_line, '\(@property\)\s\+\(\S\+\)\s*\(.*\)') + if len(parts) > 0 + call add(res.properties, { + \ 'line': parts[0], + \ 'type': phpcomplete#GetTypeFromDocBlockParam(get(parts, 2, '')), + \ 'description': get(parts, 3, '')}) + endif + endfor + return res endfunction " }}} @@ -2498,6 +2564,7 @@ function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{ let name = matchstr(name, '\\\zs[^\\]\+\ze$') endif endif + " leading slash is not required use imports are always absolute let imports[name] = {'name': object, 'kind': ''} endfor @@ -2533,6 +2600,7 @@ function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{ elseif !exists('no_namespace_candidate') " save the first namespacless match to be used if no better " candidate found later on + let tag.namespace = namespace_for_classes let no_namespace_candidate = tag endif endif diff --git a/runtime/autoload/provider.vim b/runtime/autoload/provider.vim new file mode 100644 index 0000000000..e6514f5ba8 --- /dev/null +++ b/runtime/autoload/provider.vim @@ -0,0 +1,20 @@ +" Common functionality for providers + +let s:stderr = {} + +function! provider#stderr_collector(chan_id, data, event) + let stderr = get(s:stderr, a:chan_id, ['']) + let stderr[-1] .= a:data[0] + call extend(stderr, a:data[1:]) + let s:stderr[a:chan_id] = stderr +endfunction + +function! provider#clear_stderr(chan_id) + if has_key(s:stderr, a:chan_id) + call remove(s:stderr, a:chan_id) + endif +endfunction + +function! provider#get_stderr(chan_id) + return get(s:stderr, a:chan_id, []) +endfunction diff --git a/runtime/autoload/provider/clipboard.vim b/runtime/autoload/provider/clipboard.vim index 1bcc1dea74..6454a01c2a 100644 --- a/runtime/autoload/provider/clipboard.vim +++ b/runtime/autoload/provider/clipboard.vim @@ -3,28 +3,36 @@ " available. let s:copy = {} let s:paste = {} +let s:clipboard = {} " When caching is enabled, store the jobid of the xclip/xsel process keeping " ownership of the selection, so we know how long the cache is valid. -let s:selection = { 'owner': 0, 'data': [] } +let s:selection = { 'owner': 0, 'data': [], 'on_stderr': function('provider#stderr_collector') } -function! s:selection.on_exit(jobid, data, event) +function! s:selection.on_exit(jobid, data, event) abort " At this point this nvim instance might already have launched " a new provider instance. Don't drop ownership in this case. if self.owner == a:jobid let self.owner = 0 endif + if a:data != 0 + let stderr = provider#get_stderr(a:jobid) + echohl WarningMsg + echomsg 'clipboard: error invoking '.get(self.argv, 0, '?').': '.join(stderr) + echohl None + endif + call provider#clear_stderr(a:jobid) endfunction -let s:selections = { '*': s:selection, '+': copy(s:selection)} +let s:selections = { '*': s:selection, '+': copy(s:selection) } -function! s:try_cmd(cmd, ...) +function! s:try_cmd(cmd, ...) abort let argv = split(a:cmd, " ") let out = a:0 ? systemlist(argv, a:1, 1) : systemlist(argv, [''], 1) if v:shell_error if !exists('s:did_error_try_cmd') echohl WarningMsg - echomsg "clipboard: error: ".(len(out) ? out[0] : '') + echomsg "clipboard: error: ".(len(out) ? out[0] : v:shell_error) echohl None let s:did_error_try_cmd = 1 endif @@ -34,7 +42,7 @@ function! s:try_cmd(cmd, ...) endfunction " Returns TRUE if `cmd` exits with success, else FALSE. -function! s:cmd_ok(cmd) +function! s:cmd_ok(cmd) abort call system(a:cmd) return v:shell_error == 0 endfunction @@ -47,7 +55,18 @@ function! provider#clipboard#Error() abort endfunction function! provider#clipboard#Executable() abort - if has('mac') && executable('pbcopy') + if exists('g:clipboard') + if type({}) isnot# type(g:clipboard) + \ || type({}) isnot# type(get(g:clipboard, 'copy', v:null)) + \ || type({}) isnot# type(get(g:clipboard, 'paste', v:null)) + let s:err = 'clipboard: invalid g:clipboard' + return '' + endif + let s:copy = get(g:clipboard, 'copy', { '+': v:null, '*': v:null }) + let s:paste = get(g:clipboard, 'paste', { '+': v:null, '*': v:null }) + let s:cache_enabled = get(g:clipboard, 'cache_enabled', 0) + return get(g:clipboard, 'name', 'g:clipboard') + elseif has('mac') && executable('pbcopy') let s:copy['+'] = 'pbcopy' let s:paste['+'] = 'pbpaste' let s:copy['*'] = s:copy['+'] @@ -84,26 +103,33 @@ function! provider#clipboard#Executable() abort let s:copy['*'] = s:copy['+'] let s:paste['*'] = s:paste['+'] return 'win32yank' + elseif exists('$TMUX') && executable('tmux') + let s:copy['+'] = 'tmux load-buffer -' + let s:paste['+'] = 'tmux save-buffer -' + let s:copy['*'] = s:copy['+'] + let s:paste['*'] = s:paste['+'] + return 'tmux' endif - let s:err = 'clipboard: No clipboard tool available. See :help clipboard' + let s:err = 'clipboard: No clipboard tool. :help clipboard' return '' endfunction if empty(provider#clipboard#Executable()) + " provider#clipboard#Call() *must not* be defined if the provider is broken. + " Otherwise eval_has_provider() thinks the clipboard provider is + " functioning, and eval_call_provider() will happily call it. finish endif -let s:clipboard = {} - -function! s:clipboard.get(reg) +function! s:clipboard.get(reg) abort if s:selections[a:reg].owner > 0 return s:selections[a:reg].data end return s:try_cmd(s:paste[a:reg]) endfunction -function! s:clipboard.set(lines, regtype, reg) +function! s:clipboard.set(lines, regtype, reg) abort if a:reg == '"' call s:clipboard.set(a:lines,a:regtype,'+') if s:copy['*'] != s:copy['+'] @@ -124,20 +150,31 @@ function! s:clipboard.set(lines, regtype, reg) end let selection.data = [a:lines, a:regtype] let argv = split(s:copy[a:reg], " ") + let selection.argv = argv let selection.detach = s:cache_enabled let selection.cwd = "/" let jobid = jobstart(argv, selection) - if jobid <= 0 + if jobid > 0 + call jobsend(jobid, a:lines) + call jobclose(jobid, 'stdin') + let selection.owner = jobid + else echohl WarningMsg - echo "clipboard: error when invoking provider" + echomsg 'clipboard: failed to execute: '.(s:copy[a:reg]) echohl None return 0 endif - call jobsend(jobid, a:lines) - call jobclose(jobid, 'stdin') - let selection.owner = jobid + return 1 endfunction -function! provider#clipboard#Call(method, args) - return call(s:clipboard[a:method],a:args,s:clipboard) +function! provider#clipboard#Call(method, args) abort + if get(s:, 'here', v:false) " Clipboard provider must not recurse. #7184 + return 0 + endif + let s:here = v:true + try + return call(s:clipboard[a:method],a:args,s:clipboard) + finally + let s:here = v:false + endtry endfunction diff --git a/runtime/autoload/provider/node.vim b/runtime/autoload/provider/node.vim new file mode 100644 index 0000000000..b08ad4f316 --- /dev/null +++ b/runtime/autoload/provider/node.vim @@ -0,0 +1,80 @@ +if exists('g:loaded_node_provider') + finish +endif +let g:loaded_node_provider = 1 + +let s:job_opts = {'rpc': v:true, 'on_stderr': function('provider#stderr_collector')} + +function! provider#node#Detect() abort + return has('win32') ? exepath('neovim-node-host.cmd') : exepath('neovim-node-host') +endfunction + +function! provider#node#Prog() + return s:prog +endfunction + +function! provider#node#Require(host) abort + if s:err != '' + echoerr s:err + return + endif + + if has('win32') + let args = provider#node#Prog() + else + let args = ['node'] + + if !empty($NVIM_NODE_HOST_DEBUG) + call add(args, '--inspect-brk') + endif + + call add(args , provider#node#Prog()) + endif + + try + let channel_id = jobstart(args, s:job_opts) + if rpcrequest(channel_id, 'poll') ==# 'ok' + return channel_id + endif + catch + echomsg v:throwpoint + echomsg v:exception + for row in provider#get_stderr(channel_id) + echomsg row + endfor + endtry + finally + call provider#clear_stderr(channel_id) + endtry + throw remote#host#LoadErrorForHost(a:host.orig_name, '$NVIM_NODE_LOG_FILE') +endfunction + +function! provider#node#Call(method, args) + if s:err != '' + echoerr s:err + return + endif + + if !exists('s:host') + try + let s:host = remote#host#Require('node') + catch + let s:err = v:exception + echohl WarningMsg + echomsg v:exception + echohl None + return + endtry + endif + return call('rpcrequest', insert(insert(a:args, 'node_'.a:method), s:host)) +endfunction + + +let s:err = '' +let s:prog = provider#node#Detect() + +if empty(s:prog) + let s:err = 'Cannot find the "neovim" node package. Try :CheckHealth' +endif + +call remote#host#RegisterPlugin('node-provider', 'node', []) diff --git a/runtime/autoload/provider/python.vim b/runtime/autoload/provider/python.vim index b99a046375..81fe194cb9 100644 --- a/runtime/autoload/provider/python.vim +++ b/runtime/autoload/provider/python.vim @@ -1,5 +1,5 @@ " The Python provider uses a Python host to emulate an environment for running -" python-vim plugins. See ":help provider". +" python-vim plugins. :help provider " " Associating the plugin with the Python host is the first step because plugins " will be passed as command-line arguments diff --git a/runtime/autoload/provider/python3.vim b/runtime/autoload/provider/python3.vim index 4f47a03a9b..0c3b75b73d 100644 --- a/runtime/autoload/provider/python3.vim +++ b/runtime/autoload/provider/python3.vim @@ -1,5 +1,5 @@ " The Python3 provider uses a Python3 host to emulate an environment for running -" python3 plugins. See ":help provider". +" python3 plugins. :help provider " " Associating the plugin with the Python3 host is the first step because " plugins will be passed as command-line arguments diff --git a/runtime/autoload/provider/pythonx.vim b/runtime/autoload/provider/pythonx.vim index 08a0f39b01..7285ed43ea 100644 --- a/runtime/autoload/provider/pythonx.vim +++ b/runtime/autoload/provider/pythonx.vim @@ -5,17 +5,7 @@ endif let s:loaded_pythonx_provider = 1 -let s:stderr = {} -let s:job_opts = {'rpc': v:true} - -" TODO(bfredl): this logic is common and should be builtin -function! s:job_opts.on_stderr(chan_id, data, event) - let stderr = get(s:stderr, a:chan_id, ['']) - let last = remove(stderr, -1) - let a:data[0] = last.a:data[0] - call extend(stderr, a:data) - let s:stderr[a:chan_id] = stderr -endfunction +let s:job_opts = {'rpc': v:true, 'on_stderr': function('provider#stderr_collector')} function! provider#pythonx#Require(host) abort let ver = (a:host.orig_name ==# 'python') ? 2 : 3 @@ -38,9 +28,11 @@ function! provider#pythonx#Require(host) abort catch echomsg v:throwpoint echomsg v:exception - for row in get(s:stderr, channel_id, []) + for row in provider#get_stderr(channel_id) echomsg row endfor + finally + call provider#clear_stderr(channel_id) endtry throw remote#host#LoadErrorForHost(a:host.orig_name, \ '$NVIM_PYTHON_LOG_FILE') @@ -112,15 +104,14 @@ function! s:check_interpreter(prog, major_ver) abort endif if v:shell_error == 2 - return [0, prog_path . ' does not have the neovim module installed. ' - \ . 'See ":help provider-python".'] + return [0, prog_path.' does not have the "neovim" module. :help provider-python'] elseif v:shell_error == 127 " This can happen with pyenv's shims. return [0, prog_path . ' does not exist: ' . prog_ver] elseif v:shell_error return [0, 'Checking ' . prog_path . ' caused an unknown error. ' \ . '(' . v:shell_error . ', output: ' . prog_ver . ')' - \ . ' Please report this at github.com/neovim/neovim.'] + \ . ' Report this at https://github.com/neovim/neovim'] endif return [1, ''] diff --git a/runtime/autoload/provider/ruby.vim b/runtime/autoload/provider/ruby.vim index c8ede20a75..da73a0dfc0 100644 --- a/runtime/autoload/provider/ruby.vim +++ b/runtime/autoload/provider/ruby.vim @@ -16,7 +16,11 @@ function! s:job_opts.on_stderr(chan_id, data, event) endfunction function! provider#ruby#Detect() abort - return exepath('neovim-ruby-host') + if exists("g:ruby_host_prog") + return g:ruby_host_prog + else + return has('win32') ? exepath('neovim-ruby-host.bat') : exepath('neovim-ruby-host') + end endfunction function! provider#ruby#Prog() @@ -24,15 +28,15 @@ function! provider#ruby#Prog() endfunction function! provider#ruby#Require(host) abort - let args = [provider#ruby#Prog()] + let prog = provider#ruby#Prog() let ruby_plugins = remote#host#PluginsForHost(a:host.name) for plugin in ruby_plugins - call add(args, plugin.path) + let prog .= " " . shellescape(plugin.path) endfor try - let channel_id = jobstart(args, s:job_opts) + let channel_id = jobstart(prog, s:job_opts) if rpcrequest(channel_id, 'poll') ==# 'ok' return channel_id endif @@ -71,7 +75,7 @@ let s:prog = provider#ruby#Detect() let s:plugin_path = expand(':p:h') . '/script_host.rb' if empty(s:prog) - let s:err = 'Cannot find the neovim RubyGem. Try :CheckHealth' + let s:err = 'Cannot find the neovim RubyGem. Try :checkhealth' endif call remote#host#RegisterClone('legacy-ruby-provider', 'ruby') diff --git a/runtime/autoload/provider/script_host.rb b/runtime/autoload/provider/script_host.rb index 1dade766c7..a1c58bde85 100644 --- a/runtime/autoload/provider/script_host.rb +++ b/runtime/autoload/provider/script_host.rb @@ -1,8 +1,6 @@ begin - require "neovim/ruby_provider" + require 'neovim/ruby_provider' rescue LoadError - warn( - "Your neovim RubyGem is missing or out of date. " + - "Install the latest version using `gem install neovim`." - ) + warn('Your neovim RubyGem is missing or out of date.', + 'Install the latest version using `gem install neovim`.') end diff --git a/runtime/autoload/remote/define.vim b/runtime/autoload/remote/define.vim index b04a5d2280..2688a62a82 100644 --- a/runtime/autoload/remote/define.vim +++ b/runtime/autoload/remote/define.vim @@ -89,7 +89,8 @@ endfunction function! remote#define#AutocmdOnHost(host, method, sync, name, opts) let group = s:GetNextAutocmdGroup() - let forward = '"doau '.group.' '.a:name.' ".'.'expand("")' + let forward = '"doau '.group.' '.a:name.' ".' + \ . 'fnameescape(expand(""))' let a:opts.group = group let bootstrap_def = s:GetAutocmdPrefix(a:name, a:opts) \ .' call remote#define#AutocmdBootstrap("'.a:host.'"' @@ -168,14 +169,40 @@ function! remote#define#FunctionOnChannel(channel, method, sync, name, opts) exe function_def endfunction +let s:busy = {} +let s:pending_notifications = {} function! s:GetRpcFunction(sync) - if a:sync - return 'rpcrequest' + if a:sync ==# 'urgent' + return 'rpcnotify' + elseif a:sync + return 'remote#define#request' endif - return 'rpcnotify' + return 'remote#define#notify' endfunction +function! remote#define#notify(chan, ...) + if get(s:busy, a:chan, 0) > 0 + let pending = get(s:pending_notifications, a:chan, []) + call add(pending, deepcopy(a:000)) + let s:pending_notifications[a:chan] = pending + else + call call('rpcnotify', [a:chan] + a:000) + endif +endfunction + +function! remote#define#request(chan, ...) + let s:busy[a:chan] = get(s:busy, a:chan, 0)+1 + let val = call('rpcrequest', [a:chan]+a:000) + let s:busy[a:chan] -= 1 + if s:busy[a:chan] == 0 + for msg in get(s:pending_notifications, a:chan, []) + call call('rpcnotify', [a:chan] + msg) + endfor + let s:pending_notifications[a:chan] = [] + endif + return val +endfunction function! s:GetCommandPrefix(name, opts) return 'command!'.s:StringifyOpts(a:opts, ['nargs', 'complete', 'range', diff --git a/runtime/autoload/remote/host.vim b/runtime/autoload/remote/host.vim index e695fb7df7..dfaab7d246 100644 --- a/runtime/autoload/remote/host.vim +++ b/runtime/autoload/remote/host.vim @@ -199,3 +199,7 @@ call remote#host#Register('python3', '*', " Ruby call remote#host#Register('ruby', '*.rb', \ function('provider#ruby#Require')) + +" nodejs +call remote#host#Register('node', '*', + \ function('provider#node#Require')) diff --git a/runtime/autoload/rubycomplete.vim b/runtime/autoload/rubycomplete.vim index e1064c8a58..40b87f4cbe 100644 --- a/runtime/autoload/rubycomplete.vim +++ b/runtime/autoload/rubycomplete.vim @@ -93,7 +93,7 @@ function! s:GetBufferRubyEntity( name, type, ... ) let stopline = 1 - let crex = '^\s*\<' . a:type . '\>\s*\<' . a:name . '\>\s*\(<\s*.*\s*\)\?' + let crex = '^\s*\<' . a:type . '\>\s*\<' . escape(a:name, '*') . '\>\s*\(<\s*.*\s*\)\?' let [lnum,lcol] = searchpos( crex, 'w' ) "let [lnum,lcol] = searchpairpos( crex . '\zs', '', '\(end\|}\)', 'w' ) @@ -149,7 +149,7 @@ function! s:GetRubyVarType(v) let ctors = ctors.'\)' let fstr = '=\s*\([^ \t]\+.' . ctors .'\>\|[\[{"''/]\|%[xwQqr][(\[{@]\|[A-Za-z0-9@:\-()\.]\+...\?\|lambda\|&\)' - let sstr = ''.a:v.'\>\s*[+\-*/]*'.fstr + let sstr = ''.escape(a:v, '*').'\>\s*[+\-*/]*'.fstr let [lnum,lcol] = searchpos(sstr,'nb',stopline) if lnum != 0 && lcol != 0 let str = matchstr(getline(lnum),fstr,lcol) @@ -196,7 +196,7 @@ function! rubycomplete#Complete(findstart, base) if c =~ '\w' continue elseif ! c =~ '\.' - idx = -1 + let idx = -1 break else break @@ -266,6 +266,28 @@ class VimRubyCompletion end end + def load_gems + fpath = VIM::evaluate("get(g:, 'rubycomplete_gemfile_path', 'Gemfile')") + return unless File.file?(fpath) && File.readable?(fpath) + want_bundler = VIM::evaluate("get(g:, 'rubycomplete_use_bundler')") + parse_file = !want_bundler + begin + require 'bundler' + Bundler.setup + Bundler.require + rescue Exception + parse_file = true + end + if parse_file + File.new(fpath).each_line do |line| + begin + require $1 if /\s*gem\s*['"]([^'"]+)/.match(line) + rescue Exception + end + end + end + end + def load_buffer_class(name) dprint "load_buffer_class(%s) START" % name classdef = get_buffer_entity(name, 's:GetBufferRubyClass("%s")') @@ -588,6 +610,10 @@ class VimRubyCompletion load_rails end + want_gems = VIM::evaluate("get(g:, 'rubycomplete_load_gemfile')") + load_gems unless want_gems.to_i.zero? + + input = VIM::Buffer.current.line cpos = VIM::Window.current.cursor[1] - 1 input = input[0..cpos] @@ -678,7 +704,9 @@ class VimRubyCompletion cv = eval("self.class.constants") vartype = get_var_type( receiver ) dprint "vartype: %s" % vartype - if vartype != '' + + invalid_vartype = ['', "gets"] + if !invalid_vartype.include?(vartype) load_buffer_class( vartype ) begin @@ -706,7 +734,7 @@ class VimRubyCompletion methods.concat m.instance_methods(false) } end - variables += add_rails_columns( "#{vartype}" ) if vartype && vartype.length > 0 + variables += add_rails_columns( "#{vartype}" ) if vartype && !invalid_vartype.include?(vartype) when /^\(?\s*[A-Za-z0-9:^@.%\/+*\(\)]+\.\.\.?[A-Za-z0-9:^@.%\/+*\(\)]+\s*\)?\.([^.]*)/ message = $1 diff --git a/runtime/autoload/rust.vim b/runtime/autoload/rust.vim new file mode 100644 index 0000000000..34a3b41773 --- /dev/null +++ b/runtime/autoload/rust.vim @@ -0,0 +1,415 @@ +" Author: Kevin Ballard +" Description: Helper functions for Rust commands/mappings +" Last Modified: May 27, 2014 +" For bugs, patches and license go to https://github.com/rust-lang/rust.vim + +" Jump {{{1 + +function! rust#Jump(mode, function) range + let cnt = v:count1 + normal! m' + if a:mode ==# 'v' + norm! gv + endif + let foldenable = &foldenable + set nofoldenable + while cnt > 0 + execute "call Jump_" . a:function . "()" + let cnt = cnt - 1 + endwhile + let &foldenable = foldenable +endfunction + +function! s:Jump_Back() + call search('{', 'b') + keepjumps normal! w99[{ +endfunction + +function! s:Jump_Forward() + normal! j0 + call search('{', 'b') + keepjumps normal! w99[{% + call search('{') +endfunction + +" Run {{{1 + +function! rust#Run(bang, args) + let args = s:ShellTokenize(a:args) + if a:bang + let idx = index(l:args, '--') + if idx != -1 + let rustc_args = idx == 0 ? [] : l:args[:idx-1] + let args = l:args[idx+1:] + else + let rustc_args = l:args + let args = [] + endif + else + let rustc_args = [] + endif + + let b:rust_last_rustc_args = l:rustc_args + let b:rust_last_args = l:args + + call s:WithPath(function("s:Run"), rustc_args, args) +endfunction + +function! s:Run(dict, rustc_args, args) + let exepath = a:dict.tmpdir.'/'.fnamemodify(a:dict.path, ':t:r') + if has('win32') + let exepath .= '.exe' + endif + + let relpath = get(a:dict, 'tmpdir_relpath', a:dict.path) + let rustc_args = [relpath, '-o', exepath] + a:rustc_args + + let rustc = exists("g:rustc_path") ? g:rustc_path : "rustc" + + let pwd = a:dict.istemp ? a:dict.tmpdir : '' + let output = s:system(pwd, shellescape(rustc) . " " . join(map(rustc_args, 'shellescape(v:val)'))) + if output != '' + echohl WarningMsg + echo output + echohl None + endif + if !v:shell_error + exe '!' . shellescape(exepath) . " " . join(map(a:args, 'shellescape(v:val)')) + endif +endfunction + +" Expand {{{1 + +function! rust#Expand(bang, args) + let args = s:ShellTokenize(a:args) + if a:bang && !empty(l:args) + let pretty = remove(l:args, 0) + else + let pretty = "expanded" + endif + call s:WithPath(function("s:Expand"), pretty, args) +endfunction + +function! s:Expand(dict, pretty, args) + try + let rustc = exists("g:rustc_path") ? g:rustc_path : "rustc" + + if a:pretty =~? '^\%(everybody_loops$\|flowgraph=\)' + let flag = '--xpretty' + else + let flag = '--pretty' + endif + let relpath = get(a:dict, 'tmpdir_relpath', a:dict.path) + let args = [relpath, '-Z', 'unstable-options', l:flag, a:pretty] + a:args + let pwd = a:dict.istemp ? a:dict.tmpdir : '' + let output = s:system(pwd, shellescape(rustc) . " " . join(map(args, 'shellescape(v:val)'))) + if v:shell_error + echohl WarningMsg + echo output + echohl None + else + new + silent put =output + 1 + d + setl filetype=rust + setl buftype=nofile + setl bufhidden=hide + setl noswapfile + " give the buffer a nice name + let suffix = 1 + let basename = fnamemodify(a:dict.path, ':t:r') + while 1 + let bufname = basename + if suffix > 1 | let bufname .= ' ('.suffix.')' | endif + let bufname .= '.pretty.rs' + if bufexists(bufname) + let suffix += 1 + continue + endif + exe 'silent noautocmd keepalt file' fnameescape(bufname) + break + endwhile + endif + endtry +endfunction + +function! rust#CompleteExpand(lead, line, pos) + if a:line[: a:pos-1] =~ '^RustExpand!\s*\S*$' + " first argument and it has a ! + let list = ["normal", "expanded", "typed", "expanded,identified", "flowgraph=", "everybody_loops"] + if !empty(a:lead) + call filter(list, "v:val[:len(a:lead)-1] == a:lead") + endif + return list + endif + + return glob(escape(a:lead, "*?[") . '*', 0, 1) +endfunction + +" Emit {{{1 + +function! rust#Emit(type, args) + let args = s:ShellTokenize(a:args) + call s:WithPath(function("s:Emit"), a:type, args) +endfunction + +function! s:Emit(dict, type, args) + try + let output_path = a:dict.tmpdir.'/output' + + let rustc = exists("g:rustc_path") ? g:rustc_path : "rustc" + + let relpath = get(a:dict, 'tmpdir_relpath', a:dict.path) + let args = [relpath, '--emit', a:type, '-o', output_path] + a:args + let pwd = a:dict.istemp ? a:dict.tmpdir : '' + let output = s:system(pwd, shellescape(rustc) . " " . join(map(args, 'shellescape(v:val)'))) + if output != '' + echohl WarningMsg + echo output + echohl None + endif + if !v:shell_error + new + exe 'silent keepalt read' fnameescape(output_path) + 1 + d + if a:type == "llvm-ir" + setl filetype=llvm + let extension = 'll' + elseif a:type == "asm" + setl filetype=asm + let extension = 's' + endif + setl buftype=nofile + setl bufhidden=hide + setl noswapfile + if exists('l:extension') + " give the buffer a nice name + let suffix = 1 + let basename = fnamemodify(a:dict.path, ':t:r') + while 1 + let bufname = basename + if suffix > 1 | let bufname .= ' ('.suffix.')' | endif + let bufname .= '.'.extension + if bufexists(bufname) + let suffix += 1 + continue + endif + exe 'silent noautocmd keepalt file' fnameescape(bufname) + break + endwhile + endif + endif + endtry +endfunction + +" Utility functions {{{1 + +" Invokes func(dict, ...) +" Where {dict} is a dictionary with the following keys: +" 'path' - The path to the file +" 'tmpdir' - The path to a temporary directory that will be deleted when the +" function returns. +" 'istemp' - 1 if the path is a file inside of {dict.tmpdir} or 0 otherwise. +" If {istemp} is 1 then an additional key is provided: +" 'tmpdir_relpath' - The {path} relative to the {tmpdir}. +" +" {dict.path} may be a path to a file inside of {dict.tmpdir} or it may be the +" existing path of the current buffer. If the path is inside of {dict.tmpdir} +" then it is guaranteed to have a '.rs' extension. +function! s:WithPath(func, ...) + let buf = bufnr('') + let saved = {} + let dict = {} + try + let saved.write = &write + set write + let dict.path = expand('%') + let pathisempty = empty(dict.path) + + " Always create a tmpdir in case the wrapped command wants it + let dict.tmpdir = tempname() + call mkdir(dict.tmpdir) + + if pathisempty || !saved.write + let dict.istemp = 1 + " if we're doing this because of nowrite, preserve the filename + if !pathisempty + let filename = expand('%:t:r').".rs" + else + let filename = 'unnamed.rs' + endif + let dict.tmpdir_relpath = filename + let dict.path = dict.tmpdir.'/'.filename + + let saved.mod = &mod + set nomod + + silent exe 'keepalt write! ' . fnameescape(dict.path) + if pathisempty + silent keepalt 0file + endif + else + let dict.istemp = 0 + update + endif + + call call(a:func, [dict] + a:000) + finally + if bufexists(buf) + for [opt, value] in items(saved) + silent call setbufvar(buf, '&'.opt, value) + unlet value " avoid variable type mismatches + endfor + endif + if has_key(dict, 'tmpdir') | silent call s:RmDir(dict.tmpdir) | endif + endtry +endfunction + +function! rust#AppendCmdLine(text) + call setcmdpos(getcmdpos()) + let cmd = getcmdline() . a:text + return cmd +endfunction + +" Tokenize the string according to sh parsing rules +function! s:ShellTokenize(text) + " states: + " 0: start of word + " 1: unquoted + " 2: unquoted backslash + " 3: double-quote + " 4: double-quoted backslash + " 5: single-quote + let l:state = 0 + let l:current = '' + let l:args = [] + for c in split(a:text, '\zs') + if l:state == 0 || l:state == 1 " unquoted + if l:c ==# ' ' + if l:state == 0 | continue | endif + call add(l:args, l:current) + let l:current = '' + let l:state = 0 + elseif l:c ==# '\' + let l:state = 2 + elseif l:c ==# '"' + let l:state = 3 + elseif l:c ==# "'" + let l:state = 5 + else + let l:current .= l:c + let l:state = 1 + endif + elseif l:state == 2 " unquoted backslash + if l:c !=# "\n" " can it even be \n? + let l:current .= l:c + endif + let l:state = 1 + elseif l:state == 3 " double-quote + if l:c ==# '\' + let l:state = 4 + elseif l:c ==# '"' + let l:state = 1 + else + let l:current .= l:c + endif + elseif l:state == 4 " double-quoted backslash + if stridx('$`"\', l:c) >= 0 + let l:current .= l:c + elseif l:c ==# "\n" " is this even possible? + " skip it + else + let l:current .= '\'.l:c + endif + let l:state = 3 + elseif l:state == 5 " single-quoted + if l:c == "'" + let l:state = 1 + else + let l:current .= l:c + endif + endif + endfor + if l:state != 0 + call add(l:args, l:current) + endif + return l:args +endfunction + +function! s:RmDir(path) + " sanity check; make sure it's not empty, /, or $HOME + if empty(a:path) + echoerr 'Attempted to delete empty path' + return 0 + elseif a:path == '/' || a:path == $HOME + echoerr 'Attempted to delete protected path: ' . a:path + return 0 + endif + return system("rm -rf " . shellescape(a:path)) +endfunction + +" Executes {cmd} with the cwd set to {pwd}, without changing Vim's cwd. +" If {pwd} is the empty string then it doesn't change the cwd. +function! s:system(pwd, cmd) + let cmd = a:cmd + if !empty(a:pwd) + let cmd = 'cd ' . shellescape(a:pwd) . ' && ' . cmd + endif + return system(cmd) +endfunction + +" Playpen Support {{{1 +" Parts of gist.vim by Yasuhiro Matsumoto reused +" gist.vim available under the BSD license, available at +" http://github.com/mattn/gist-vim +function! s:has_webapi() + if !exists("*webapi#http#post") + try + call webapi#http#post() + catch + endtry + endif + return exists("*webapi#http#post") +endfunction + +function! rust#Play(count, line1, line2, ...) abort + redraw + + let l:rust_playpen_url = get(g:, 'rust_playpen_url', 'https://play.rust-lang.org/') + let l:rust_shortener_url = get(g:, 'rust_shortener_url', 'https://is.gd/') + + if !s:has_webapi() + echohl ErrorMsg | echomsg ':RustPlay depends on webapi.vim (https://github.com/mattn/webapi-vim)' | echohl None + return + endif + + let bufname = bufname('%') + if a:count < 1 + let content = join(getline(a:line1, a:line2), "\n") + else + let save_regcont = @" + let save_regtype = getregtype('"') + silent! normal! gvy + let content = @" + call setreg('"', save_regcont, save_regtype) + endif + + let body = l:rust_playpen_url."?code=".webapi#http#encodeURI(content) + + if strlen(body) > 5000 + echohl ErrorMsg | echomsg 'Buffer too large, max 5000 encoded characters ('.strlen(body).')' | echohl None + return + endif + + let payload = "format=simple&url=".webapi#http#encodeURI(body) + let res = webapi#http#post(l:rust_shortener_url.'create.php', payload, {}) + let url = res.content + + redraw | echomsg 'Done: '.url +endfunction + +" }}}1 + +" vim: set noet sw=8 ts=8: diff --git a/runtime/autoload/rustfmt.vim b/runtime/autoload/rustfmt.vim new file mode 100644 index 0000000000..a689b5e00d --- /dev/null +++ b/runtime/autoload/rustfmt.vim @@ -0,0 +1,107 @@ +" Author: Stephen Sugden +" +" Adapted from https://github.com/fatih/vim-go +" For bugs, patches and license go to https://github.com/rust-lang/rust.vim + +if !exists("g:rustfmt_autosave") + let g:rustfmt_autosave = 0 +endif + +if !exists("g:rustfmt_command") + let g:rustfmt_command = "rustfmt" +endif + +if !exists("g:rustfmt_options") + let g:rustfmt_options = "" +endif + +if !exists("g:rustfmt_fail_silently") + let g:rustfmt_fail_silently = 0 +endif + +let s:got_fmt_error = 0 + +function! s:RustfmtCommandRange(filename, line1, line2) + let l:arg = {"file": shellescape(a:filename), "range": [a:line1, a:line2]} + return printf("%s %s --write-mode=overwrite --file-lines '[%s]'", g:rustfmt_command, g:rustfmt_options, json_encode(l:arg)) +endfunction + +function! s:RustfmtCommand(filename) + return g:rustfmt_command . " --write-mode=overwrite " . g:rustfmt_options . " " . shellescape(a:filename) +endfunction + +function! s:RunRustfmt(command, curw, tmpname) + if exists("*systemlist") + let out = systemlist(a:command) + else + let out = split(system(a:command), '\r\?\n') + endif + + if v:shell_error == 0 || v:shell_error == 3 + " remove undo point caused via BufWritePre + try | silent undojoin | catch | endtry + + " Replace current file with temp file, then reload buffer + call rename(a:tmpname, expand('%')) + silent edit! + let &syntax = &syntax + + " only clear location list if it was previously filled to prevent + " clobbering other additions + if s:got_fmt_error + let s:got_fmt_error = 0 + call setloclist(0, []) + lwindow + endif + elseif g:rustfmt_fail_silently == 0 + " otherwise get the errors and put them in the location list + let errors = [] + + for line in out + " src/lib.rs:13:5: 13:10 error: expected `,`, or `}`, found `value` + let tokens = matchlist(line, '^\(.\{-}\):\(\d\+\):\(\d\+\):\s*\(\d\+:\d\+\s*\)\?\s*error: \(.*\)') + if !empty(tokens) + call add(errors, {"filename": @%, + \"lnum": tokens[2], + \"col": tokens[3], + \"text": tokens[5]}) + endif + endfor + + if empty(errors) + % | " Couldn't detect rustfmt error format, output errors + endif + + if !empty(errors) + call setloclist(0, errors, 'r') + echohl Error | echomsg "rustfmt returned error" | echohl None + endif + + let s:got_fmt_error = 1 + lwindow + " We didn't use the temp file, so clean up + call delete(a:tmpname) + endif + + call winrestview(a:curw) +endfunction + +function! rustfmt#FormatRange(line1, line2) + let l:curw = winsaveview() + let l:tmpname = expand("%:p:h") . "/." . expand("%:p:t") . ".rustfmt" + call writefile(getline(1, '$'), l:tmpname) + + let command = s:RustfmtCommandRange(l:tmpname, a:line1, a:line2) + + call s:RunRustfmt(command, l:curw, l:tmpname) +endfunction + +function! rustfmt#Format() + let l:curw = winsaveview() + let l:tmpname = expand("%:p:h") . "/." . expand("%:p:t") . ".rustfmt" + call writefile(getline(1, '$'), l:tmpname) + + let command = s:RustfmtCommand(l:tmpname) + + call s:RunRustfmt(command, l:curw, l:tmpname) +endfunction diff --git a/runtime/autoload/shada.vim b/runtime/autoload/shada.vim index cf27ee608a..87acc515ee 100644 --- a/runtime/autoload/shada.vim +++ b/runtime/autoload/shada.vim @@ -45,7 +45,7 @@ call map(copy(s:SHADA_ENTRY_NAMES), let s:SHADA_MAP_ENTRIES = { \'search_pattern': ['sp', 'sh', 'ss', 'sb', 'sm', 'sc', 'sl', 'se', 'so', \ 'su'], - \'register': ['n', 'rc', 'rw', 'rt'], + \'register': ['n', 'rc', 'rw', 'rt', 'ru'], \'global_mark': ['n', 'f', 'l', 'c'], \'local_mark': ['f', 'n', 'l', 'c'], \'jump': ['f', 'l', 'c'], @@ -139,6 +139,7 @@ let s:SHADA_STANDARD_KEYS = { \'rt': ['type', 'regtype', s:SHADA_ENUMS.regtype.CHARACTERWISE], \'rw': ['block width', 'uint', 0], \'rc': ['contents', 'binarray', s:SHADA_REQUIRED], + \'ru': ['is_unnamed', 'boolean', g:msgpack#false], \'n': ['name', 'intchar', char2nr('"')], \'l': ['line number', 'uint', 1], \'c': ['column', 'uint', 0], diff --git a/runtime/autoload/spellfile.vim b/runtime/autoload/spellfile.vim index a5ffa514ea..84584c6e29 100644 --- a/runtime/autoload/spellfile.vim +++ b/runtime/autoload/spellfile.vim @@ -88,8 +88,8 @@ function! spellfile#LoadFile(lang) endif endif if newbufnr == winbufnr(0) - " We are back the old buffer, remove any (half-finished) download. - g/^/d_ + " We are back to the old buffer, remove any (half-finished) download. + keeppatterns g/^/d_ else let newbufnr = winbufnr(0) endif @@ -127,7 +127,7 @@ function! spellfile#LoadFile(lang) exe "write " . dirname . '/' . fname " Also download the .sug file. - g/^/d_ + keeppatterns g/^/d_ let fname = substitute(fname, '\.spl$', '.sug', '') echo 'Downloading ' . fname . '...' call spellfile#Nread(fname) @@ -197,7 +197,7 @@ function! spellfile#WritableSpellDir() " Always use the $XDG_DATA_HOME/nvim/site directory if exists('$XDG_DATA_HOME') return $XDG_DATA_HOME . "/nvim/site/spell" - else + elseif !(has('win32') || has('win64')) return $HOME . "/.local/share/nvim/site/spell" endif for dir in split(&rtp, ',') diff --git a/runtime/autoload/sqlcomplete.vim b/runtime/autoload/sqlcomplete.vim index e80729add4..ea0d8c2de9 100644 --- a/runtime/autoload/sqlcomplete.vim +++ b/runtime/autoload/sqlcomplete.vim @@ -2,7 +2,7 @@ " Language: SQL " Maintainer: David Fishburn " Version: 16.0 -" Last Change: 2015 Dec 29 +" Last Change: 2017 Oct 15 " Homepage: http://www.vim.org/scripts/script.php?script_id=1572 " Usage: For detailed help " ":help sql.txt" diff --git a/runtime/autoload/tar.vim b/runtime/autoload/tar.vim index 5e76870cce..9c518cb9d0 100644 --- a/runtime/autoload/tar.vim +++ b/runtime/autoload/tar.vim @@ -117,7 +117,7 @@ fun! tar#Browse(tarfile) if !filereadable(a:tarfile) " call Decho('a:tarfile<'.a:tarfile.'> not filereadable') if a:tarfile !~# '^\a\+://' - " if its an url, don't complain, let url-handlers such as vim do its thing + " if it's an url, don't complain, let url-handlers such as vim do its thing redraw! echohl Error | echo "***error*** (tar#Browse) File not readable<".a:tarfile.">" | echohl None endif diff --git a/runtime/autoload/tutor.vim b/runtime/autoload/tutor.vim index 43d8a87886..56e2283465 100644 --- a/runtime/autoload/tutor.vim +++ b/runtime/autoload/tutor.vim @@ -15,30 +15,17 @@ function! tutor#SetupVim() endif endfunction -" Mappings: {{{1 - -function! s:CheckMaps() - nmap +" Loads metadata file, if available +function! tutor#LoadMetadata() + let b:tutor_metadata = json_decode(join(readfile(expand('%').'.json'), "\n")) endfunction -function! s:MapKeyWithRedirect(key, cmd) - if maparg(a:key) !=# '' - redir => l:keys - silent call s:CheckMaps() - redir END - let l:key_list = split(l:keys, '\n') +" Mappings: {{{1 - let l:raw_map = filter(copy(l:key_list), "v:val =~# '\\* ".a:key."'") - if len(l:raw_map) == 0 - exe "nnoremap ".a:key." ".a:cmd - return - endif - let l:map_data = split(l:raw_map[0], '\s*') - - exe "nnoremap ".l:map_data[0]." ".a:cmd - else - exe "nnoremap ".a:key." ".a:cmd - endif +function! tutor#SetNormalMappings() + nnoremap :call tutor#FollowLink(0) + nnoremap <2-LeftMouse> :call tutor#MouseDoubleClick() + nnoremap >> :call tutor#InjectCommand() endfunction function! tutor#MouseDoubleClick() @@ -46,7 +33,7 @@ function! tutor#MouseDoubleClick() normal! zo else if match(getline('.'), '^#\{1,} ') > -1 - normal! zc + silent normal! zc else call tutor#FollowLink(0) endif @@ -59,114 +46,6 @@ function! tutor#InjectCommand() redraw | echohl WarningMsg | echon "tutor: ran" | echohl None | echon " " | echohl Statement | echon l:cmd endfunction -function! tutor#SetNormalMappings() - call s:MapKeyWithRedirect('l', 'tutor#ForwardSkipConceal(v:count1)') - call s:MapKeyWithRedirect('h', 'tutor#BackwardSkipConceal(v:count1)') - call s:MapKeyWithRedirect('', 'tutor#ForwardSkipConceal(v:count1)') - call s:MapKeyWithRedirect('', 'tutor#BackwardSkipConceal(v:count1)') - - nnoremap :call tutor#FollowLink(0) - nnoremap <2-LeftMouse> :call tutor#MouseDoubleClick() - nnoremap >> :call tutor#InjectCommand() -endfunction - -function! tutor#SetSampleTextMappings() - noremap A :if match(getline('.'), '^--->') > -1 \| call search('\s{\@=', 'Wc') \| startinsert \| else \| startinsert! \| endif - noremap $ :if match(getline('.'), '^--->') > -1 \| call search('.\s{\@=', 'Wc') \| else \| call search('$', 'Wc') \| endif - onoremap $ :if match(getline('.'), '^--->') > -1 \| call search('.\s{\@=', 'Wc') \| else \| call search('$', 'Wc') \| endif - noremap ^ :if match(getline('.'), '^--->') > -1 \| call search('\(--->\s\)\@<=.', 'bcW') \| else \| call search('^', 'bcW') \|endif - onoremap ^ :if match(getline('.'), '^--->') > -1 \| call search('\(--->\s\)\@<=.', 'bcW') \| else \| call search('^', 'bcW') \|endif - nmap 0 ^ - nmap ^ - nmap $ - imap ^:startinsert - imap $:startinsert - noremap I :exe "normal! 0" \| startinsert -endfunction - -" Navigation: {{{1 - -" taken from http://stackoverflow.com/a/24224578 - -function! tutor#ForwardSkipConceal(count) - let cnt=a:count - let mvcnt=0 - let c=col('.') - let l=line('.') - let lc=col('$') - let line=getline('.') - while cnt - if c>=lc - let mvcnt+=cnt - break - endif - if stridx(&concealcursor, 'n')==-1 - let isconcealed=0 - else - let [isconcealed, cchar, group] = synconcealed(l, c) - endif - if isconcealed - let cnt-=strchars(cchar) - let oldc=c - let c+=1 - while c < lc - let [isconcealed2, cchar2, group2] = synconcealed(l, c) - if !isconcealed2 || cchar2 != cchar - break - endif - let c+= 1 - endwhile - let mvcnt+=strchars(line[oldc-1:c-2]) - else - let cnt-=1 - let mvcnt+=1 - let c+=len(matchstr(line[c-1:], '.')) - endif - endwhile - return mvcnt.'l' -endfunction - -function! tutor#BackwardSkipConceal(count) - let cnt=a:count - let mvcnt=0 - let c=col('.') - let l=line('.') - let lc=0 - let line=getline('.') - while cnt - if c<=1 - let mvcnt+=cnt - break - endif - if stridx(&concealcursor, 'n')==-1 || c == 0 - let isconcealed=0 - else - let [isconcealed, cchar, group]=synconcealed(l, c-1) - endif - if isconcealed - let cnt-=strchars(cchar) - let oldc=c - let c-=1 - while c>1 - let [isconcealed2, cchar2, group2] = synconcealed(l, c-1) - if !isconcealed2 || cchar2 != cchar - break - endif - let c-=1 - endwhile - let c = max([c, 1]) - let mvcnt+=strchars(line[c-1:oldc-2]) - else - let cnt-=1 - let mvcnt+=1 - let c-=len(matchstr(line[:c-2], '.$')) - endif - endwhile - return mvcnt.'h' -endfunction - -" Hypertext: {{{1 - function! tutor#FollowLink(force) let l:stack_s = join(map(synstack(line('.'), col('.')), 'synIDattr(v:val, "name")'), '') if l:stack_s =~# 'tutorLink' @@ -209,42 +88,40 @@ function! tutor#InfoText() return join(l:info_parts, " ") endfunction -" Marks {{{1 -function! tutor#PlaceXMarks() - call cursor(1, 1) - let b:tutor_sign_id = 1 - while search('^--->', 'W') > 0 - call tutor#CheckText(getline('.')) - let b:tutor_sign_id+=1 - endwhile - call cursor(1, 1) + +" Marks: {{{1 + +function! tutor#ApplyMarks() + hi! link tutorExpect Special + if exists('b:tutor_metadata') && has_key(b:tutor_metadata, 'expect') + let b:tutor_sign_id = 1 + for expct in keys(b:tutor_metadata['expect']) + let lnum = eval(expct) + call matchaddpos('tutorExpect', [lnum]) + call tutor#CheckLine(lnum) + endfor + endif endfunction -function! tutor#CheckText(text) - if match(a:text, '{expect:ANYTHING}\s*$') == -1 - if match(getline('.'), '^--->\s*$') > -1 - exe "sign place ".b:tutor_sign_id." line=".line('.')." name=tutorbad buffer=".bufnr('%') - else - if match(getline('.'), '|expect:.\+|') == -1 - let l:cur_text = matchstr(a:text, '---> \zs.\{-}\ze {expect:') - let l:expected_text = matchstr(a:text, '{expect:\zs.*\ze}\s*$') - else - let l:cur_text = matchstr(a:text, '---> \zs.\{-}\ze |expect:') - let l:expected_text = matchstr(a:text, '|expect:\zs.*\ze|\s*$') - endif - if l:cur_text ==# l:expected_text - exe "sign place ".b:tutor_sign_id." line=".line('.')." name=tutorok buffer=".bufnr('%') - else - exe "sign place ".b:tutor_sign_id." line=".line('.')." name=tutorbad buffer=".bufnr('%') - endif +function! tutor#ApplyMarksOnChanged() + if exists('b:tutor_metadata') && has_key(b:tutor_metadata, 'expect') + let lnum = line('.') + if index(keys(b:tutor_metadata['expect']), string(lnum)) > -1 + call tutor#CheckLine(lnum) endif endif endfunction -function! tutor#OnTextChanged() - let l:text = getline('.') - if match(l:text, '^--->') > -1 - call tutor#CheckText(l:text) +function! tutor#CheckLine(line) + if exists('b:tutor_metadata') && has_key(b:tutor_metadata, 'expect') + let bufn = bufnr('%') + let ctext = getline(a:line) + if b:tutor_metadata['expect'][string(a:line)] == -1 || ctext ==# b:tutor_metadata['expect'][string(a:line)] + exe "sign place ".b:tutor_sign_id." line=".a:line." name=tutorok buffer=".bufn + else + exe "sign place ".b:tutor_sign_id." line=".a:line." name=tutorbad buffer=".bufn + endif + let b:tutor_sign_id+=1 endif endfunction diff --git a/runtime/autoload/zip.vim b/runtime/autoload/zip.vim index 687500ebe3..ea086e0882 100644 --- a/runtime/autoload/zip.vim +++ b/runtime/autoload/zip.vim @@ -1,7 +1,7 @@ " zip.vim: Handles browsing zipfiles " AUTOLOAD PORTION -" Date: Jul 02, 2013 -" Version: 27 +" Date: Sep 13, 2016 +" Version: 28 " Maintainer: Charles E Campbell " License: Vim License (see vim's :help license) " Copyright: Copyright (C) 2005-2013 Charles E. Campbell {{{1 @@ -20,10 +20,10 @@ if &cp || exists("g:loaded_zip") finish endif -let g:loaded_zip= "v27" +let g:loaded_zip= "v28" if v:version < 702 echohl WarningMsg - echo "***warning*** this version of zip needs vim 7.2" + echo "***warning*** this version of zip needs vim 7.2 or later" echohl Normal finish endif @@ -53,6 +53,9 @@ endif if !exists("g:zip_unzipcmd") let g:zip_unzipcmd= "unzip" endif +if !exists("g:zip_extractcmd") + let g:zip_extractcmd= g:zip_unzipcmd +endif " ---------------- " Functions: {{{1 @@ -62,14 +65,14 @@ endif " zip#Browse: {{{2 fun! zip#Browse(zipfile) " call Dfunc("zip#Browse(zipfile<".a:zipfile.">)") - " sanity check: insure that the zipfile has "PK" as its first two letters + " sanity check: ensure that the zipfile has "PK" as its first two letters " (zipped files have a leading PK as a "magic cookie") if !filereadable(a:zipfile) || readfile(a:zipfile, "", 1)[0] !~ '^PK' exe "noautocmd e ".fnameescape(a:zipfile) " call Dret("zip#Browse : not a zipfile<".a:zipfile.">") return " else " Decho -" call Decho("zip#Browse: a:zipfile<".a:zipfile."> passed PK test - its a zip file") +" call Decho("zip#Browse: a:zipfile<".a:zipfile."> passed PK test - it's a zip file") endif let repkeep= &report @@ -92,7 +95,7 @@ fun! zip#Browse(zipfile) endif if !filereadable(a:zipfile) if a:zipfile !~# '^\a\+://' - " if its an url, don't complain, let url-handlers such as vim do its thing + " if it's an url, don't complain, let url-handlers such as vim do its thing redraw! echohl Error | echo "***error*** (zip#Browse) File not readable<".a:zipfile.">" | echohl None " call inputsave()|call input("Press to continue")|call inputrestore() @@ -136,8 +139,10 @@ fun! zip#Browse(zipfile) return endif + " Maps associated with zip plugin setlocal noma nomod ro - noremap :call ZipBrowseSelect() + noremap :call ZipBrowseSelect() + noremap x :call zip#Extract() let &report= repkeep " call Dret("zip#Browse") @@ -204,6 +209,15 @@ fun! zip#Read(fname,mode) endif " call Decho("zipfile<".zipfile.">") " call Decho("fname <".fname.">") + " sanity check + if !executable(substitute(g:zip_unzipcmd,'\s\+.*$','','')) + redraw! + echohl Error | echo "***error*** (zip#Read) sorry, your system doesn't appear to have the ".g:zip_unzipcmd." program" | echohl None +" call inputsave()|call input("Press to continue")|call inputrestore() + let &report= repkeep +" call Dret("zip#Write") + return + endif " the following code does much the same thing as " exe "keepj sil! r! ".g:zip_unzipcmd." -p -- ".s:Escape(zipfile,1)." ".s:Escape(fnameescape(fname),1) @@ -236,9 +250,9 @@ fun! zip#Write(fname) set report=10 " sanity checks - if !executable(g:zip_zipcmd) + if !executable(substitute(g:zip_zipcmd,'\s\+.*$','','')) redraw! - echohl Error | echo "***error*** (zip#Write) sorry, your system doesn't appear to have the zip pgm" | echohl None + echohl Error | echo "***error*** (zip#Write) sorry, your system doesn't appear to have the ".g:zip_zipcmd." program" | echohl None " call inputsave()|call input("Press to continue")|call inputrestore() let &report= repkeep " call Dret("zip#Write") @@ -344,6 +358,48 @@ fun! zip#Write(fname) " call Dret("zip#Write") endfun +" --------------------------------------------------------------------- +" zip#Extract: extract a file from a zip archive {{{2 +fun! zip#Extract() +" call Dfunc("zip#Extract()") + + let repkeep= &report + set report=10 + let fname= getline(".") +" call Decho("fname<".fname.">") + + " sanity check + if fname =~ '^"' + let &report= repkeep +" call Dret("zip#Extract") + return + endif + if fname =~ '/$' + redraw! + echohl Error | echo "***error*** (zip#Extract) Please specify a file, not a directory" | echohl None + let &report= repkeep +" call Dret("zip#Extract") + return + endif + + " extract the file mentioned under the cursor +" call Decho("system(".g:zip_extractcmd." ".shellescape(b:zipfile)." ".shellescape(shell).")") + call system(g:zip_extractcmd." ".shellescape(b:zipfile)." ".shellescape(shell)) +" call Decho("zipfile<".b:zipfile.">") + if v:shell_error != 0 + echohl Error | echo "***error*** ".g:zip_extractcmd." ".b:zipfile." ".fname.": failed!" | echohl NONE + elseif !filereadable(fname) + echohl Error | echo "***error*** attempted to extract ".fname." but it doesn't appear to be present!" + else + echo "***note*** successfully extracted ".fname + endif + + " restore option + let &report= repkeep + +" call Dret("zip#Extract") +endfun + " --------------------------------------------------------------------- " s:Escape: {{{2 fun! s:Escape(fname,isfilt) diff --git a/runtime/bugreport.vim b/runtime/bugreport.vim index f0c045e6c3..650e37940d 100644 --- a/runtime/bugreport.vim +++ b/runtime/bugreport.vim @@ -53,7 +53,6 @@ : scriptnames :endif :set all -:set termcap :if has("autocmd") : au :endif diff --git a/runtime/colors/README.txt b/runtime/colors/README.txt index 3b3445cbc9..8fa6f322ab 100644 --- a/runtime/colors/README.txt +++ b/runtime/colors/README.txt @@ -41,9 +41,16 @@ this autocmd might be useful: autocmd SourcePre */colors/blue_sky.vim set background=dark Replace "blue_sky" with the name of the colorscheme. -In case you want to tweak a colorscheme after it was loaded, check out that +In case you want to tweak a colorscheme after it was loaded, check out the ColorScheme autocmd event. +To customize a colorscheme use another name, e.g. "~/.vim/colors/mine.vim", +and use `:runtime` to load the original colorscheme: + " load the "evening" colorscheme + runtime colors/evening.vim + " change the color of statements + hi Statement ctermfg=Blue guifg=Blue + To see which highlight group is used where, find the help for "highlight-groups" and "group-name". diff --git a/runtime/colors/evening.vim b/runtime/colors/evening.vim index 5dae08280e..5257307593 100644 --- a/runtime/colors/evening.vim +++ b/runtime/colors/evening.vim @@ -1,6 +1,6 @@ " Vim color file " Maintainer: Bram Moolenaar -" Last Change: 2006 Apr 14 +" Last Change: 2016 Oct 10 " This color scheme uses a dark grey background. @@ -45,8 +45,8 @@ hi CursorColumn term=reverse ctermbg=Black guibg=grey40 hi CursorLine term=underline cterm=underline guibg=grey40 " Groups for syntax highlighting -hi Constant term=underline ctermfg=Magenta guifg=#ffa0a0 guibg=grey5 -hi Special term=bold ctermfg=LightRed guifg=Orange guibg=grey5 +hi Constant term=underline ctermfg=Magenta guifg=#ffa0a0 +hi Special term=bold ctermfg=LightRed guifg=Orange if &t_Co > 8 hi Statement term=bold cterm=bold ctermfg=Yellow guifg=#ffff60 gui=bold endif diff --git a/runtime/colors/koehler.vim b/runtime/colors/koehler.vim index a36f9f6972..250472a162 100644 --- a/runtime/colors/koehler.vim +++ b/runtime/colors/koehler.vim @@ -2,7 +2,7 @@ " vim: tw=0 ts=4 sw=4 " Vim color file " Maintainer: Ron Aaron -" Last Change: 2013 May 23 +" Last Change: 2016 Sep 04 hi clear set background=dark @@ -45,6 +45,7 @@ hi TabLineFill term=bold,reverse cterm=bold ctermfg=lightblue ctermbg=white g hi TabLineSel term=reverse ctermfg=white ctermbg=lightblue guifg=white guibg=blue hi Underlined term=underline cterm=bold,underline ctermfg=lightblue guifg=lightblue gui=bold,underline hi Ignore ctermfg=black ctermbg=black guifg=black guibg=black +hi EndOfBuffer term=bold cterm=bold ctermfg=darkred guifg=#cc0000 gui=bold hi link IncSearch Visual hi link String Constant hi link Character Constant diff --git a/runtime/compiler/bdf.vim b/runtime/compiler/bdf.vim index ca33776988..b062e847aa 100644 --- a/runtime/compiler/bdf.vim +++ b/runtime/compiler/bdf.vim @@ -1,7 +1,7 @@ " Vim compiler file -" Compiler: BDF to PCF Conversion -" Maintainer: Nikolai Weibull -" Latest Revision: 2006-04-19 +" Compiler: BDF to PCF Conversion +" Previous Maintainer: Nikolai Weibull +" Latest Revision: 2006-04-19 if exists("current_compiler") finish diff --git a/runtime/compiler/cargo.vim b/runtime/compiler/cargo.vim new file mode 100644 index 0000000000..bd48666bc9 --- /dev/null +++ b/runtime/compiler/cargo.vim @@ -0,0 +1,35 @@ +" Vim compiler file +" Compiler: Cargo Compiler +" Maintainer: Damien Radtke +" Latest Revision: 2014 Sep 24 +" For bugs, patches and license go to https://github.com/rust-lang/rust.vim + +if exists('current_compiler') + finish +endif +runtime compiler/rustc.vim +let current_compiler = "cargo" + +let s:save_cpo = &cpo +set cpo&vim + +if exists(':CompilerSet') != 2 + command -nargs=* CompilerSet setlocal +endif + +if exists('g:cargo_makeprg_params') + execute 'CompilerSet makeprg=cargo\ '.escape(g:cargo_makeprg_params, ' \|"').'\ $*' +else + CompilerSet makeprg=cargo\ $* +endif + +" Ignore general cargo progress messages +CompilerSet errorformat+= + \%-G%\\s%#Downloading%.%#, + \%-G%\\s%#Compiling%.%#, + \%-G%\\s%#Finished%.%#, + \%-G%\\s%#error:\ Could\ not\ compile\ %.%#, + \%-G%\\s%#To\ learn\ more\\,%.%# + +let &cpo = s:save_cpo +unlet s:save_cpo diff --git a/runtime/compiler/context.vim b/runtime/compiler/context.vim new file mode 100644 index 0000000000..cb78c96df0 --- /dev/null +++ b/runtime/compiler/context.vim @@ -0,0 +1,54 @@ +" Vim compiler file +" Compiler: ConTeXt typesetting engine +" Maintainer: Nicola Vitacolonna +" Last Change: 2016 Oct 21 + +if exists("current_compiler") + finish +endif +let s:keepcpo= &cpo +set cpo&vim + +if exists(":CompilerSet") != 2 " older Vim always used :setlocal + command -nargs=* CompilerSet setlocal +endif + +" If makefile exists and we are not asked to ignore it, we use standard make +" (do not redefine makeprg) +if get(b:, 'context_ignore_makefile', get(g:, 'context_ignore_makefile', 0)) || + \ (!filereadable('Makefile') && !filereadable('makefile')) + let current_compiler = 'context' + " The following assumes that the current working directory is set to the + " directory of the file to be typeset + let &l:makeprg = get(b:, 'context_mtxrun', get(g:, 'context_mtxrun', 'mtxrun')) + \ . ' --script context --autogenerate --nonstopmode --synctex=' + \ . (get(b:, 'context_synctex', get(g:, 'context_synctex', 0)) ? '1' : '0') + \ . ' ' . get(b:, 'context_extra_options', get(g:, 'context_extra_options', '')) + \ . ' ' . shellescape(expand('%:p:t')) +else + let current_compiler = 'make' +endif + +let b:context_errorformat = '' + \ . '%-Popen source%.%#> %f,' + \ . '%-Qclose source%.%#> %f,' + \ . "%-Popen source%.%#name '%f'," + \ . "%-Qclose source%.%#name '%f'," + \ . '%Etex %trror%.%#mp error on line %l in file %f:%.%#,' + \ . 'tex %trror%.%#error on line %l in file %f: %m,' + \ . '%Elua %trror%.%#error on line %l in file %f:,' + \ . '%+Emetapost %#> error: %#,' + \ . '! error: %#%m,' + \ . '%-C %#,' + \ . '%C! %m,' + \ . '%Z[ctxlua]%m,' + \ . '%+C<*> %.%#,' + \ . '%-C%.%#,' + \ . '%Z...%m,' + \ . '%-Zno-error,' + \ . '%-G%.%#' " Skip remaining lines + +execute 'CompilerSet errorformat=' . escape(b:context_errorformat, ' ') + +let &cpo = s:keepcpo +unlet s:keepcpo diff --git a/runtime/compiler/csslint.vim b/runtime/compiler/csslint.vim new file mode 100644 index 0000000000..14c4289a24 --- /dev/null +++ b/runtime/compiler/csslint.vim @@ -0,0 +1,16 @@ +" Vim compiler file +" Compiler: csslint for CSS +" Maintainer: Daniel Moch +" Last Change: 2016 May 21 + +if exists("current_compiler") + finish +endif +let current_compiler = "csslint" + +if exists(":CompilerSet") != 2 " older Vim always used :setlocal + command -nargs=* CompilerSet setlocal +endif + +CompilerSet makeprg=csslint\ --format=compact +CompilerSet errorformat=%-G,%-G%f:\ lint\ free!,%f:\ line\ %l\\,\ col\ %c\\,\ %trror\ -\ %m,%f:\ line\ %l\\,\ col\ %c\\,\ %tarning\ -\ %m,%f:\ line\ %l\\,\ col\ %c\\,\ %m diff --git a/runtime/compiler/cucumber.vim b/runtime/compiler/cucumber.vim index c020be6e3b..17ce3627c1 100644 --- a/runtime/compiler/cucumber.vim +++ b/runtime/compiler/cucumber.vim @@ -1,7 +1,7 @@ " Vim compiler file " Compiler: Cucumber " Maintainer: Tim Pope -" Last Change: 2010 Aug 09 +" Last Change: 2016 Aug 29 if exists("current_compiler") finish @@ -19,7 +19,7 @@ CompilerSet makeprg=cucumber CompilerSet errorformat= \%W%m\ (Cucumber::Undefined), - \%E%m\ (%.%#), + \%E%m\ (%\\S%#), \%Z%f:%l, \%Z%f:%l:%.%# diff --git a/runtime/compiler/gcc.vim b/runtime/compiler/gcc.vim index 19ea2edc12..1af568de57 100644 --- a/runtime/compiler/gcc.vim +++ b/runtime/compiler/gcc.vim @@ -1,7 +1,7 @@ " Vim compiler file -" Compiler: GNU C Compiler -" Maintainer: Nikolai Weibull -" Latest Revision: 2010-10-14 +" Compiler: GNU C Compiler +" Previous Maintainer: Nikolai Weibull +" Latest Revision: 2010-10-14 " added line suggested by Anton Lindqvist 2016 Mar 31 if exists("current_compiler") diff --git a/runtime/compiler/ghc.vim b/runtime/compiler/ghc.vim new file mode 100644 index 0000000000..c98ae302a8 --- /dev/null +++ b/runtime/compiler/ghc.vim @@ -0,0 +1,26 @@ +" Vim compiler file +" Compiler: GHC Haskell Compiler +" Maintainer: Daniel Campoverde +" Latest Revision: 2016-11-29 + +if exists("current_compiler") + finish +endif +let current_compiler = "ghc" + +let s:cpo_save = &cpo +set cpo&vim + +CompilerSet errorformat= + \%-G%.%#:\ build, + \%-G%.%#preprocessing\ library\ %.%#, + \%-G[%.%#]%.%#, + \%E%f:%l:%c:\ %m, + \%-G--%.%# + +if exists('g:compiler_ghc_ignore_unmatched_lines') + CompilerSet errorformat+=%-G%.%# +endif + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/compiler/haml.vim b/runtime/compiler/haml.vim index b06a672df7..9464c3dc85 100644 --- a/runtime/compiler/haml.vim +++ b/runtime/compiler/haml.vim @@ -1,7 +1,7 @@ " Vim compiler file " Compiler: Haml " Maintainer: Tim Pope -" Last Change: 2013 May 30 +" Last Change: 2016 Aug 29 if exists("current_compiler") finish @@ -15,7 +15,7 @@ endif let s:cpo_save = &cpo set cpo-=C -CompilerSet makeprg=haml\ -c +CompilerSet makeprg=haml CompilerSet errorformat= \Haml\ %trror\ on\ line\ %l:\ %m, diff --git a/runtime/compiler/pylint.vim b/runtime/compiler/pylint.vim new file mode 100644 index 0000000000..93079ce61d --- /dev/null +++ b/runtime/compiler/pylint.vim @@ -0,0 +1,16 @@ +" Vim compiler file +" Compiler: Pylint for Python +" Maintainer: Daniel Moch +" Last Change: 2016 May 20 + +if exists("current_compiler") + finish +endif +let current_compiler = "pylint" + +if exists(":CompilerSet") != 2 " older Vim always used :setlocal + command -nargs=* CompilerSet setlocal +endif + +CompilerSet makeprg=pylint\ --output-format=text\ --msg-template=\"{path}:{line}:{column}:{C}:\ [{symbol}]\ {msg}\"\ --reports=no +CompilerSet errorformat=%A%f:%l:%c:%t:\ %m,%A%f:%l:\ %m,%A%f:(%l):\ %m,%-Z%p^%.%#,%-G%.%# diff --git a/runtime/compiler/rake.vim b/runtime/compiler/rake.vim index 3bd9da0daf..8490f2a9e9 100644 --- a/runtime/compiler/rake.vim +++ b/runtime/compiler/rake.vim @@ -27,7 +27,11 @@ CompilerSet errorformat= \%\\s%#[%f:%l:\ %#%m, \%\\s%#%f:%l:\ %#%m, \%\\s%#%f:%l:, - \%m\ [%f:%l]: + \%m\ [%f:%l]:, + \%+Erake\ aborted!, + \%+EDon't\ know\ how\ to\ build\ task\ %.%#, + \%+Einvalid\ option:%.%#, + \%+Irake\ %\\S%\\+%\\s%\\+#\ %.%# let &cpo = s:cpo_save unlet s:cpo_save diff --git a/runtime/compiler/rspec.vim b/runtime/compiler/rspec.vim index 7c340bab15..c77bd70da7 100644 --- a/runtime/compiler/rspec.vim +++ b/runtime/compiler/rspec.vim @@ -22,9 +22,10 @@ CompilerSet errorformat= \%f:%l:\ %tarning:\ %m, \%E%.%#:in\ `load':\ %f:%l:%m, \%E%f:%l:in\ `%*[^']':\ %m, - \%-Z\ \ \ \ \ \#\ %f:%l:%.%#, + \%-Z\ \ \ \ \ %\\+\#\ %f:%l:%.%#, \%E\ \ %\\d%\\+)%.%#, \%C\ \ \ \ \ %m, + \%C%\\s%#, \%-G%.%# let &cpo = s:cpo_save diff --git a/runtime/compiler/rst.vim b/runtime/compiler/rst.vim index 15d2d79f64..392bea6ae0 100644 --- a/runtime/compiler/rst.vim +++ b/runtime/compiler/rst.vim @@ -1,7 +1,8 @@ " Vim compiler file -" Compiler: reStructuredText Documentation Format -" Maintainer: Nikolai Weibull -" Latest Revision: 2006-04-19 +" Compiler: sphinx >= 1.0.8, http://www.sphinx-doc.org +" Description: reStructuredText Documentation Format +" Previous Maintainer: Nikolai Weibull +" Latest Revision: 2017-03-31 if exists("current_compiler") finish @@ -11,12 +12,18 @@ let current_compiler = "rst" let s:cpo_save = &cpo set cpo&vim -setlocal errorformat= - \%f:%l:\ (%tEBUG/0)\ %m, - \%f:%l:\ (%tNFO/1)\ %m, - \%f:%l:\ (%tARNING/2)\ %m, - \%f:%l:\ (%tRROR/3)\ %m, - \%f:%l:\ (%tEVERE/3)\ %m, +if exists(":CompilerSet") != 2 + command -nargs=* CompilerSet setlocal +endif + +CompilerSet errorformat= + \%f\\:%l:\ %tEBUG:\ %m, + \%f\\:%l:\ %tNFO:\ %m, + \%f\\:%l:\ %tARNING:\ %m, + \%f\\:%l:\ %tRROR:\ %m, + \%f\\:%l:\ %tEVERE:\ %m, + \%f\\:%s:\ %tARNING:\ %m, + \%f\\:%s:\ %tRROR:\ %m, \%D%*\\a[%*\\d]:\ Entering\ directory\ `%f', \%X%*\\a[%*\\d]:\ Leaving\ directory\ `%f', \%DMaking\ %*\\a\ in\ %f diff --git a/runtime/compiler/rubyunit.vim b/runtime/compiler/rubyunit.vim index 93a0c8e653..ed0639b581 100644 --- a/runtime/compiler/rubyunit.vim +++ b/runtime/compiler/rubyunit.vim @@ -17,6 +17,8 @@ let s:cpo_save = &cpo set cpo-=C CompilerSet makeprg=testrb +" CompilerSet makeprg=ruby\ -Itest +" CompilerSet makeprg=m CompilerSet errorformat=\%W\ %\\+%\\d%\\+)\ Failure:, \%C%m\ [%f:%l]:, diff --git a/runtime/compiler/rustc.vim b/runtime/compiler/rustc.vim new file mode 100644 index 0000000000..c27bdc9c0c --- /dev/null +++ b/runtime/compiler/rustc.vim @@ -0,0 +1,46 @@ +" Vim compiler file +" Compiler: Rust Compiler +" Maintainer: Chris Morgan +" Latest Revision: 2013 Jul 12 +" For bugs, patches and license go to https://github.com/rust-lang/rust.vim + +if exists("current_compiler") + finish +endif +let current_compiler = "rustc" + +let s:cpo_save = &cpo +set cpo&vim + +if exists(":CompilerSet") != 2 + command -nargs=* CompilerSet setlocal +endif + +if exists("g:rustc_makeprg_no_percent") && g:rustc_makeprg_no_percent != 0 + CompilerSet makeprg=rustc +else + CompilerSet makeprg=rustc\ \% +endif + +" Old errorformat (before nightly 2016/08/10) +CompilerSet errorformat= + \%f:%l:%c:\ %t%*[^:]:\ %m, + \%f:%l:%c:\ %*\\d:%*\\d\ %t%*[^:]:\ %m, + \%-G%f:%l\ %s, + \%-G%*[\ ]^, + \%-G%*[\ ]^%*[~], + \%-G%*[\ ]... + +" New errorformat (after nightly 2016/08/10) +CompilerSet errorformat+= + \%-G, + \%-Gerror:\ aborting\ %.%#, + \%-Gerror:\ Could\ not\ compile\ %.%#, + \%Eerror:\ %m, + \%Eerror[E%n]:\ %m, + \%Wwarning:\ %m, + \%Inote:\ %m, + \%C\ %#-->\ %f:%l:%c + +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/compiler/sass.vim b/runtime/compiler/sass.vim index 376a52b303..9c540ac443 100644 --- a/runtime/compiler/sass.vim +++ b/runtime/compiler/sass.vim @@ -1,7 +1,7 @@ " Vim compiler file " Compiler: Sass " Maintainer: Tim Pope -" Last Change: 2013 May 30 +" Last Change: 2016 Aug 29 if exists("current_compiler") finish @@ -15,7 +15,7 @@ endif let s:cpo_save = &cpo set cpo-=C -CompilerSet makeprg=sass\ -c +CompilerSet makeprg=sass CompilerSet errorformat= \%f:%l:%m\ (Sass::Syntax%trror), diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index 122ab37e72..ef8b9c7d47 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -1,4 +1,4 @@ -*api.txt* {Nvim} +*api.txt* Nvim NVIM REFERENCE MANUAL by Thiago de Arruda @@ -7,10 +7,11 @@ Nvim API *API* *api* Nvim exposes a powerful API that can be used by plugins and external processes -via |msgpack-rpc|, Lua and VimL (|eval-api|). +via |RPC|, |Lua| and VimL (|eval-api|). -Nvim can also be embedded in C applications as libnvim, so the application -can control the embedded instance by calling the C API directly. +Applications can also embed libnvim to work with the C API directly. + + Type |gO| to see the table of contents. ============================================================================== API Types *api-types* @@ -47,6 +48,7 @@ version.api_compatible API is backwards-compatible with this level version.api_prerelease Declares the current API level as unstable > (version.api_prerelease && fn.since == version.api_level) functions API function signatures +ui_events UI event signatures |ui| {fn}.since API level where function {fn} was introduced {fn}.deprecated_since API level where function {fn} was deprecated types Custom handle types defined by Nvim @@ -54,6 +56,28 @@ error_types Possible error types returned by API functions External programs ("clients") can use the metadata to discover the |rpc-api|. +============================================================================== +API contract *api-contract* + +The API is made of functions and events. Clients call functions like those +described at |api-global|, and may "attach" in order to receive rich events, +described at |rpc-remote-ui|. + +As Nvim develops, its API may change only according the following "contract": + +- New functions and events may be added. + - Any such extensions are OPTIONAL: old clients may ignore them. +- Function signatures will NOT CHANGE (after release). + - Functions introduced in the development (unreleased) version MAY CHANGE. + (Clients can dynamically check `api_prerelease`, etc. |api-metadata|) +- Event parameters will not be removed or reordered (after release). +- Events may be EXTENDED: new parameters may be added. +- New items may be ADDED to map/list parameters/results of functions and + events. + - Any such new items are OPTIONAL: old clients may ignore them. + - Existing items will not be removed (after release). +- Deprecated functions will not be removed until Nvim version 2.0 + ============================================================================== Buffer highlighting *api-highlights* @@ -111,6 +135,26 @@ nvim_command({command}) *nvim_command()* Parameters:~ {command} Ex-command string +nvim_get_hl_by_name({name}, {rgb}) *nvim_get_hl_by_name()* + Gets a highlight definition by name. + + Parameters:~ + {name} Highlight group name + {rgb} Export RGB colors + + Return:~ + Highlight definition map + +nvim_get_hl_by_id({hl_id}, {rgb}) *nvim_get_hl_by_id()* + Gets a highlight definition by id. |hlID()| + + Parameters:~ + {hl_id} Highlight id as returned by |hlID()| + {rgb} Export RGB colors + + Return:~ + Highlight definition map + nvim_feedkeys({keys}, {mode}, {escape_csi}) *nvim_feedkeys()* Passes input keys to Nvim. On VimL error: Does not fail, but updates v:errmsg. @@ -127,7 +171,11 @@ nvim_input({keys}) *nvim_input()* Unlike `nvim_feedkeys`, this uses a lower-level input buffer and the call is not deferred. This is the most reliable way to - emulate real user input. + send real user input. + + Note: + |keycodes| like are translated, so "<" is special. To + input a literal "<", send . Attributes:~ {async} @@ -141,7 +189,16 @@ nvim_input({keys}) *nvim_input()* *nvim_replace_termcodes()* nvim_replace_termcodes({str}, {from_part}, {do_lt}, {special}) - Replaces any terminal codes with the internal representation + Replaces terminal codes and |keycodes| (, , ...) in a + string with the internal representation. + + Parameters:~ + {str} String to be converted. + {from_part} Legacy Vim parameter. Usually true. + {do_lt} Also translate . Ignored if `special` is + false. + {special} Replace |keycodes|, e.g. becomes a "\n" + char. nvim_command_output({str}) *nvim_command_output()* TODO: Documentation @@ -158,8 +215,10 @@ nvim_eval({expr}) *nvim_eval()* Evaluation result or expanded object nvim_call_function({fname}, {args}) *nvim_call_function()* - Calls a VimL function with the given arguments. On VimL error: - Returns a generic error; v:errmsg is not updated. + Calls a VimL function with the given arguments + + On VimL error: Returns a generic error; v:errmsg is not + updated. Parameters:~ {fname} Function to call @@ -168,7 +227,21 @@ nvim_call_function({fname}, {args}) *nvim_call_function()* Return:~ Result of the function call -nvim_strwidth({str}) *nvim_strwidth()* +nvim_execute_lua({code}, {args}) *nvim_execute_lua()* + Execute lua code. Parameters (if any) are available as `...` + inside the chunk. The chunk can return a value. + + Only statements are executed. To evaluate an expression, + prefix it with `return`: return my_function(...) + + Parameters:~ + {code} lua code to execute + {args} Arguments to the code + + Return:~ + Return value of lua code if present or NIL. + +nvim_strwidth({text}) *nvim_strwidth()* Calculates the number of display cells occupied by `text`. counts as one cell. @@ -247,7 +320,7 @@ nvim_get_option({name}) *nvim_get_option()* {name} Option name Return:~ - Option value + Option value (global) nvim_set_option({name}, {value}) *nvim_set_option()* Sets an option value @@ -257,20 +330,24 @@ nvim_set_option({name}, {value}) *nvim_set_option()* {value} New option value nvim_out_write({str}) *nvim_out_write()* - Writes a message to vim output buffer + Writes a message to the Vim output buffer. Does not append + "\n", the message is buffered (won't display) until a linefeed + is written. Parameters:~ {str} Message nvim_err_write({str}) *nvim_err_write()* - Writes a message to vim error buffer + Writes a message to the Vim error buffer. Does not append + "\n", the message is buffered (won't display) until a linefeed + is written. Parameters:~ {str} Message nvim_err_writeln({str}) *nvim_err_writeln()* - Writes a message to vim error buffer. Appends a linefeed to - ensure all contents are written. + Writes a message to the Vim error buffer. Appends "\n", so the + buffer is flushed (and displayed). Parameters:~ {str} Message @@ -291,7 +368,7 @@ nvim_set_current_buf({buffer}) *nvim_set_current_buf()* Sets the current buffer Parameters:~ - {id} Buffer handle + {buffer} Buffer handle nvim_list_wins() *nvim_list_wins()* Gets the current list of window handles @@ -309,7 +386,7 @@ nvim_set_current_win({window}) *nvim_set_current_win()* Sets the current window Parameters:~ - {handle} Window handle + {window} Window handle nvim_list_tabpages() *nvim_list_tabpages()* Gets the current list of tabpage handles @@ -327,7 +404,7 @@ nvim_set_current_tabpage({tabpage}) *nvim_set_current_tabpage()* Sets the current tabpage Parameters:~ - {handle} Tabpage handle + {tabpage} Tabpage handle nvim_subscribe({event}) *nvim_subscribe()* Subscribes to event broadcasts @@ -347,6 +424,27 @@ nvim_get_color_by_name({name}) *nvim_get_color_by_name()* nvim_get_color_map() *nvim_get_color_map()* TODO: Documentation +nvim_get_mode() *nvim_get_mode()* + Gets the current mode. |mode()| "blocking" is true if Nvim is + waiting for input. + + Return:~ + Dictionary { "mode": String, "blocking": Boolean } + + Attributes:~ + {async} + +nvim_get_keymap({mode}) *nvim_get_keymap()* + Gets a list of dictionaries describing global (non-buffer) + mappings. The "buffer" key in the returned dictionary is + always zero. + + Parameters:~ + {mode} Mode short-name ("n", "i", "v", ...) + + Return:~ + Array of maparg()-like dictionaries describing mappings + nvim_get_api_info() *nvim_get_api_info()* TODO: Documentation @@ -379,6 +477,54 @@ nvim_call_atomic({calls}) *nvim_call_atomic()* error ocurred, the values from all preceding calls will still be returned. +nvim__id({obj}) *nvim__id()* + Returns object given as argument + + This API function is used for testing. One should not rely on + its presence in plugins. + + Parameters:~ + {obj} Object to return. + + Return:~ + its argument. + +nvim__id_array({arr}) *nvim__id_array()* + Returns array given as argument + + This API function is used for testing. One should not rely on + its presence in plugins. + + Parameters:~ + {arr} Array to return. + + Return:~ + its argument. + +nvim__id_dictionary({dct}) *nvim__id_dictionary()* + Returns dictionary given as argument + + This API function is used for testing. One should not rely on + its presence in plugins. + + Parameters:~ + {dct} Dictionary to return. + + Return:~ + its argument. + +nvim__id_float({flt}) *nvim__id_float()* + Returns floating-point value given as argument + + This API function is used for testing. One should not rely on + its presence in plugins. + + Parameters:~ + {flt} Value to return. + + Return:~ + its argument. + ============================================================================== Buffer Functions *api-buffer* @@ -457,6 +603,18 @@ nvim_buf_get_changedtick({buffer}) *nvim_buf_get_changedtick()* Return:~ b:changedtickvalue. +nvim_buf_get_keymap({buffer}, {mode}) *nvim_buf_get_keymap()* + Gets a list of dictionaries describing buffer-local mappings. + The "buffer" key in the returned dictionary reflects the + buffer handle where the mapping is present. + + Parameters:~ + {mode} Mode short-name ("n", "i", "v", ...) + {buffer} Buffer handle + + Return:~ + Array of maparg()-like dictionaries describing mappings + nvim_buf_set_var({buffer}, {name}, {value}) *nvim_buf_set_var()* Sets a buffer-scoped (b:) variable @@ -491,15 +649,6 @@ nvim_buf_set_option({buffer}, {name}, {value}) *nvim_buf_set_option()* {name} Option name {value} Option value -nvim_buf_get_number({buffer}) *nvim_buf_get_number()* - Gets the buffer number - - Parameters:~ - {buffer} Buffer handle - - Return:~ - Buffer number - nvim_buf_get_name({buffer}) *nvim_buf_get_name()* Gets the full file name for the buffer @@ -541,24 +690,24 @@ nvim_buf_add_highlight({buffer}, {src_id}, {hl_group}, {line}, {col_start}, {col_end}) Adds a highlight to buffer. - This can be used for plugins which dynamically generate - highlights to a buffer (like a semantic highlighter or - linter). The function adds a single highlight to a buffer. - Unlike matchaddpos() highlights follow changes to line - numbering (as lines are inserted/removed above the highlighted - line), like signs and marks do. + Useful for plugins that dynamically generate highlights to a + buffer (like a semantic highlighter or linter). The function + adds a single highlight to a buffer. Unlike matchaddpos() + highlights follow changes to line numbering (as lines are + inserted/removed above the highlighted line), like signs and + marks do. - "src_id" is useful for batch deletion/updating of a set of - highlights. When called with src_id = 0, an unique source id - is generated and returned. Succesive calls can pass in it as - "src_id" to add new highlights to the same source group. All - highlights in the same group can then be cleared with - nvim_buf_clear_highlight. If the highlight never will be - manually deleted pass in -1 for "src_id". + `src_id` is useful for batch deletion/updating of a set of + highlights. When called with `src_id = 0`, an unique source id + is generated and returned. Successive calls can pass that + `src_id` to associate new highlights with the same source + group. All highlights in the same group can be cleared with + `nvim_buf_clear_highlight`. If the highlight never will be + manually deleted, pass `src_id = -1`. - If "hl_group" is the empty string no highlight is added, but a - new src_id is still returned. This is useful for an external - plugin to synchrounously request an unique src_id at + If `hl_group` is the empty string no highlight is added, but a + new `src_id` is still returned. This is useful for an external + plugin to synchrounously request an unique `src_id` at initialization, and later asynchronously add and clear highlights in response to buffer changes. @@ -567,7 +716,7 @@ nvim_buf_add_highlight({buffer}, {src_id}, {hl_group}, {line}, {src_id} Source group to use or 0 to use a new group, or -1 for ungrouped highlight {hl_group} Name of the highlight group to use - {line} Line to highlight + {line} Line to highlight (zero-indexed) {col_start} Start of range of columns to highlight {col_end} End of range of columns to highlight, or -1 to highlight to end of line @@ -819,4 +968,4 @@ nvim_ui_try_resize({width}, {height}) *nvim_ui_try_resize()* nvim_ui_set_option({name}, {value}) *nvim_ui_set_option()* TODO: Documentation - vim:tw=78:ts=8:ft=help:norl: + vim:tw=78:ts=8:ft=help:norl: \ No newline at end of file diff --git a/runtime/doc/arabic.txt b/runtime/doc/arabic.txt index 6f17b38a7a..07350083c6 100644 --- a/runtime/doc/arabic.txt +++ b/runtime/doc/arabic.txt @@ -1,4 +1,4 @@ -*arabic.txt* For Vim version 7.4. Last change: 2010 Nov 13 +*arabic.txt* Nvim VIM REFERENCE MANUAL by Nadim Shaikli @@ -36,7 +36,7 @@ the user interface remains the standard Vi interface. Highlights ---------- -o Editing left-to-right files as in the original VIM hasn't changed. +o Editing left-to-right files as in the original Vim hasn't changed. o Viewing and editing files in right-to-left windows. File orientation is per window, so it is possible to view the same @@ -46,7 +46,7 @@ o No special terminal with right-to-left capabilities is required. The right-to-left changes are completely hardware independent. Only Arabic fonts are necessary. -o Compatible with the original VIM. Almost all features work in +o Compatible with the original Vim. Almost all features work in right-to-left mode (there are liable to be bugs). o Changing keyboard mapping and reverse insert modes using a single @@ -60,14 +60,14 @@ o While in Arabic mode, numbers are entered from left to right. Upon o Arabic keymapping on the command line in reverse insert mode. -o Proper Bidirectional functionality is possible given VIM is +o Proper Bidirectional functionality is possible given Vim is started within a Bidi capable terminal emulator. Arabic Fonts *arabicfonts* ------------ -VIM requires monospaced fonts of which there are many out there. +Vim requires monospaced fonts of which there are many out there. Arabic requires ISO-8859-6 as well as Presentation Form-B fonts (without Form-B, Arabic will _NOT_ be usable). It is highly recommended that users search for so-called 'ISO-10646-1' fonts. @@ -90,13 +90,13 @@ o Installation of fonts for X Window systems (Unix/Linux) Usage ----- -Prior to the actual usage of Arabic within VIM, a number of settings +Prior to the actual usage of Arabic within Vim, a number of settings need to be accounted for and invoked. o Setting the Arabic fonts - + For VIM GUI set the 'guifont' to your_ARABIC_FONT. This is done - by entering the following command in the VIM window. + + For Vim GUI set the 'guifont' to your_ARABIC_FONT. This is done + by entering the following command in the Vim window. > :set guifont=your_ARABIC_FONT < @@ -109,7 +109,7 @@ o Setting the Arabic fonts you can include ':set guifont=your_ARABIC_FONT' to your vimrc file. - + Under the X Window environment, you can also start VIM with + + Under the X Window environment, you can also start Vim with '-fn your_ARABIC_FONT' option. o Setting the appropriate character Encoding @@ -131,11 +131,11 @@ o Setting the appropriate character Encoding o Enable Arabic settings [short-cut] In order to simplify and streamline things, you can either invoke - VIM with the command-line option, + Vim with the command-line option, % vim -A my_utf8_arabic_file ... - or enable 'arabic' via the following command within VIM + or enable 'arabic' via the following command within Vim > :set arabic < @@ -196,7 +196,7 @@ o Enable Arabic settings [short-cut] + Arabic deletion of a combined pair character - By default VIM has the 'delcombine' option disabled. This option + By default Vim has the 'delcombine' option disabled. This option allows the deletion of ALEF in a LAM_ALEF (LAA) combined character and still retain the LAM (i.e. it reverts to treating the combined character as its natural two characters form -- this also pertains @@ -255,7 +255,7 @@ o Enable Arabic settings [short-cut] Keymap/Keyboard *arabickeymap* --------------- -The character/letter encoding used in VIM is the standard UTF-8. +The character/letter encoding used in Vim is the standard UTF-8. It is widely discouraged that any other encoding be used or even attempted. @@ -288,7 +288,7 @@ o Keyboard Restrictions ------------ -o VIM in its GUI form does not currently support Bi-directionality +o Vim in its GUI form does not currently support Bi-directionality (i.e. the ability to see both Arabic and Latin intermixed within the same line). diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt index 180127cd52..740f44414a 100644 --- a/runtime/doc/autocmd.txt +++ b/runtime/doc/autocmd.txt @@ -1,4 +1,4 @@ -*autocmd.txt* For Vim version 7.4. Last change: 2016 Jun 09 +*autocmd.txt* Nvim VIM REFERENCE MANUAL by Bram Moolenaar @@ -8,17 +8,7 @@ Automatic commands *autocommand* For a basic explanation, see section |40.3| in the user manual. -1. Introduction |autocmd-intro| -2. Defining autocommands |autocmd-define| -3. Removing autocommands |autocmd-remove| -4. Listing autocommands |autocmd-list| -5. Events |autocmd-events| -6. Patterns |autocmd-patterns| -7. Buffer-local autocommands |autocmd-buflocal| -8. Groups |autocmd-groups| -9. Executing autocommands |autocmd-execute| -10. Using autocommands |autocmd-use| -11. Disabling autocommands |autocmd-disable| + Type |gO| to see the table of contents. ============================================================================== 1. Introduction *autocmd-intro* @@ -30,7 +20,7 @@ files matching *.c. You can also use autocommands to implement advanced features, such as editing compressed files (see |gzip-example|). The usual place to put autocommands is in your vimrc file. - *E203* *E204* *E143* *E855* + *E203* *E204* *E143* *E855* *E937* WARNING: Using autocommands is very powerful, and may lead to unexpected side effects. Be careful not to destroy your text. - It's a good idea to do some testing on an expendable copy of a file first. @@ -65,7 +55,14 @@ Note: The ":autocmd" command can only be followed by another command when the '|' appears before {cmd}. This works: > :augroup mine | au! BufRead | augroup END But this sees "augroup" as part of the defined command: > + :augroup mine | au! BufRead * | augroup END :augroup mine | au BufRead * set tw=70 | augroup END +Instead you can put the group name into the command: > + :au! mine BufRead * + :au mine BufRead * set tw=70 +Or use `:execute`: > + :augroup mine | exe "au! BufRead *" | augroup END + :augroup mine | exe "au BufRead * set tw=70" | augroup END Note that special characters (e.g., "%", "") in the ":autocmd" arguments are not expanded when the autocommand is defined. These will be @@ -76,11 +73,15 @@ exception is that "" is expanded when the autocmd is defined. Example: Here Vim expands to the name of the file containing this line. -When your vimrc file is sourced twice, the autocommands will appear twice. -To avoid this, put this command in your vimrc file, before defining -autocommands: > +`:autocmd` adds to the list of autocommands regardless of whether they are +already present. When your .vimrc file is sourced twice, the autocommands +will appear twice. To avoid this, define your autocommands in a group, so +that you can easily clear them: > - :autocmd! " Remove ALL autocommands for the current group. + augroup vimrc + autocmd! " Remove all vimrc autocommands + au BufNewFile,BufRead *.html so :h/html.vim + augroup END If you don't want to remove all autocommands, you can instead use a variable to ensure that Vim includes the autocommands only once: > @@ -127,8 +128,13 @@ prompt. When one command outputs two messages this can happen anyway. :au[tocmd]! [group] {event} Remove ALL autocommands for {event}. + Warning: You should not do this without a group for + |BufRead| and other common events, it can break + plugins, syntax highlighting, etc. :au[tocmd]! [group] Remove ALL autocommands. + Warning: You should normally not do this without a + group, it breaks plugins, syntax highlighting, etc. When the [group] argument is not given, Vim uses the current group (as defined with ":augroup"); otherwise, Vim uses the group defined with [group]. @@ -304,6 +310,8 @@ Name triggered by ~ |TabNew| when creating a new tab page |TabNewEntered| after entering a new tab page |TabClosed| after closing a tab page +|CmdlineEnter| after entering cmdline mode +|CmdlineLeave| before leaving cmdline mode |CmdwinEnter| after entering the command-line window |CmdwinLeave| before leaving the command-line window @@ -422,8 +430,8 @@ BufUnload Before unloading a buffer. This is when the NOTE: When this autocommand is executed, the current buffer "%" may be different from the buffer being unloaded "". - Don't change to another buffer, it will cause - problems. + Don't change to another buffer or window, it + will cause problems! When exiting and v:dying is 2 or more this event is not triggered. *BufWinEnter* @@ -486,6 +494,28 @@ CmdUndefined When a user command is used but it isn't command is defined. An alternative is to always define the user command and have it invoke an autoloaded function. See |autoload|. + *CmdlineEnter* +CmdlineEnter After moving the cursor to the command line, + where the user can type a command or search + string. + is set to a single character, + indicating the type of command-line. + |cmdline-char| + Sets these |v:event| keys: + cmdlevel + cmdtype + *CmdlineLeave* +CmdlineLeave Before leaving the command line. + is set to a single character, + indicating the type of command-line. + |cmdline-char| + Sets these |v:event| keys: + abort (mutable) + cmdlevel + cmdtype + Note: `abort` can only be changed from false + to true. An autocmd cannot execute an already + aborted cmdline by changing it to false. *CmdwinEnter* CmdwinEnter After entering the command-line window. Useful for setting options specifically for @@ -606,7 +636,7 @@ FileChangedShell When Vim notices that the modification time of |timestamp| Mostly triggered after executing a shell command, but also with a |:checktime| command - or when Gvim regains input focus. + or when gvim regains input focus. This autocommand is triggered for each changed file. It is not used when 'autoread' is set and the buffer was not changed. If a @@ -617,7 +647,7 @@ FileChangedShell When Vim notices that the modification time of to tell Vim what to do next. NOTE: When this autocommand is executed, the current buffer "%" may be different from the - buffer that was changed "". + buffer that was changed, which is in "". NOTE: The commands must not change the current buffer, jump to another buffer or delete a buffer. *E246* *E811* @@ -644,7 +674,8 @@ FileType When the 'filetype' option has been set. The pattern is matched against the filetype. can be used for the name of the file where this option was set, and for - the new value of 'filetype'. + the new value of 'filetype'. Navigating to + another window or buffer is not allowed. See |filetypes|. *FileWriteCmd* FileWriteCmd Before writing to a file, when not writing the @@ -794,7 +825,9 @@ QuickFixCmdPre Before a quickfix command is run (|:make|, |:vimgrepadd|, |:lvimgrepadd|, |:cscope|, |:cfile|, |:cgetfile|, |:caddfile|, |:lfile|, |:lgetfile|, |:laddfile|, |:helpgrep|, - |:lhelpgrep|). + |:lhelpgrep|, |:cexpr|, |:cgetexpr|, + |:caddexpr|, |:cbuffer|, |:cgetbuffer|, + |:caddbuffer|). The pattern is matched against the command being run. When |:grep| is used but 'grepprg' is set to "internal" it still matches "grep". @@ -919,7 +952,7 @@ TermClose When a terminal buffer ends. {Nvim} *TermOpen* TermOpen When a terminal buffer is starting. This can be used to configure the terminal emulator by - setting buffer variables. |terminal-emulator| + setting buffer variables. |terminal| *TermResponse* TermResponse After the response to |t_RV| is received from the terminal. The value of |v:termresponse| @@ -966,9 +999,9 @@ VimEnter After doing all the startup stuff, including VimLeave Before exiting Vim, just after writing the .shada file. Executed only once, like VimLeavePre. - To detect an abnormal exit use |v:dying|. - When v:dying is 2 or more this event is not - triggered. +< Use |v:dying| to detect an abnormal exit. + Use |v:exiting| to get the exit code. + Not triggered if |v:dying| is 2 or more. *VimLeavePre* VimLeavePre Before exiting Vim, just before writing the .shada file. This is executed only once, @@ -976,9 +1009,9 @@ VimLeavePre Before exiting Vim, just before writing the happens to be the current buffer when exiting. Mostly useful with a "*" pattern. > :autocmd VimLeavePre * call CleanupStuff() -< To detect an abnormal exit use |v:dying|. - When v:dying is 2 or more this event is not - triggered. +< Use |v:dying| to detect an abnormal exit. + Use |v:exiting| to get the exit code. + Not triggered if |v:dying| is 2 or more. *VimResized* VimResized After the Vim window was resized, thus 'lines' and/or 'columns' changed. Not when starting @@ -1002,7 +1035,7 @@ WinLeave Before leaving a window. If the window to be *WinNew* WinNew When a new window was created. Not done for - the fist window, when Vim has just started. + the first window, when Vim has just started. Before a WinEnter event. ============================================================================== @@ -1086,6 +1119,9 @@ Note that for all systems the '/' character is used for path separator (even Windows). This was done because the backslash is difficult to use in a pattern and to make the autocommands portable across different systems. +It is possible to use |pattern| items, but they may not work as expected, +because of the translation done for the above. + *autocmd-changes* Matching with the pattern is done when an event is triggered. Changing the buffer name in one of the autocommands, or even deleting the buffer, does not @@ -1184,10 +1220,12 @@ name! different from existing {event} names, as this most likely will not do what you intended. - *:augroup-delete* *E367* + *:augroup-delete* *E367* *W19* *E936* :aug[roup]! {name} Delete the autocmd group {name}. Don't use this if there is still an autocommand using - this group! This is not checked. + this group! You will get a warning if doing + it anyway. when the group is the current group + you will get error E936. To enter autocommands for a specific group, use this method: 1. Select the group with ":augroup {name}". diff --git a/runtime/doc/change.txt b/runtime/doc/change.txt index 31a46f53bb..9610d7359f 100644 --- a/runtime/doc/change.txt +++ b/runtime/doc/change.txt @@ -1,4 +1,4 @@ -*change.txt* For Vim version 7.4. Last change: 2016 Apr 12 +*change.txt* Nvim VIM REFERENCE MANUAL by Bram Moolenaar @@ -9,20 +9,10 @@ changing text means deleting the text and replacing it with other text using one command. You can undo all of these commands. You can repeat the non-Ex commands with the "." command. -1. Deleting text |deleting| -2. Delete and insert |delete-insert| -3. Simple changes |simple-change| *changing* -4. Complex changes |complex-change| - 4.1 Filter commands |filter| - 4.2 Substitute |:substitute| - 4.3 Search and replace |search-replace| - 4.4 Changing tabs |change-tabs| -5. Copying and moving text |copy-move| -6. Formatting text |formatting| -7. Sorting text |sorting| - For inserting text see |insert.txt|. + Type |gO| to see the table of contents. + ============================================================================== 1. Deleting text *deleting* *E470* @@ -259,7 +249,7 @@ Or use "caw" (see |aw|). command is executed. ============================================================================== -3. Simple changes *simple-change* +3. Simple changes *simple-change* *changing* *r* r{char} Replace the character under the cursor with {char}. @@ -398,11 +388,6 @@ CTRL-X Subtract [count] from the number or alphabetic {Visual}CTRL-X Subtract [count] from the number or alphabetic character in the highlighted text. {not in Vi} - On MS-Windows, this is mapped to cut Visual text - |dos-standard-mappings|. If you want to disable the - mapping, use this: > - silent! vunmap -< *v_g_CTRL-X* {Visual}g CTRL-X Subtract [count] from the number or alphabetic character in the highlighted text. If several lines @@ -601,8 +586,8 @@ all files in it are deleted. When Vim has the setuid bit set this may cause problems, the temp file is owned by the setuid user but the filter command probably runs as the original user. Directory for temporary files is created in the first suitable directory of: -For Unix: $TMPDIR, /tmp, current-dir, $HOME. -For MS-Windows: $TMP, $TEMP, $USERPROFILE, current-dir. + Unix: $TMPDIR, /tmp, current-dir, $HOME. + Windows: $TMPDIR, $TMP, $TEMP, $USERPROFILE, current-dir. @@ -614,12 +599,14 @@ For MS-Windows: $TMP, $TEMP, $USERPROFILE, current-dir. For the {pattern} see |pattern|. {string} can be a literal string, or something special; see |sub-replace-special|. + *E939* When [range] and [count] are omitted, replace in the - current line only. - When [count] is given, replace in [count] lines, - starting with the last line in [range]. When [range] - is omitted start in the current line. - Also see |cmdline-ranges|. + current line only. When [count] is given, replace in + [count] lines, starting with the last line in [range]. + When [range] is omitted start in the current line. + [count] must be a positive number. Also see + |cmdline-ranges|. + See |:s_flags| for [flags]. :[range]s[ubstitute] [flags] [count] @@ -661,6 +648,7 @@ g& Synonym for `:%s//~/&` (repeat last substitute with *:s_flags* The flags that you can use for the substitute commands: + *:&&* [&] Must be the first one: Keep the flags from the previous substitute command. Examples: > :&& @@ -833,6 +821,7 @@ The numbering of "\1", "\2" etc. is done based on which "\(" comes first in the pattern (going left to right). When a parentheses group matches several times, the last one will be used for "\1", "\2", etc. Example: > :s/\(\(a[a-d] \)*\)/\2/ modifies "aa ab x" to "ab x" +The "\2" is for "\(a[a-d] \)". At first it matches "aa ", secondly "ab ". When using parentheses in combination with '|', like in \([ab]\)\|\([cd]\), either the first or second pattern in parentheses did not match, so either @@ -873,8 +862,7 @@ Exceptions: Substitute with an expression *sub-replace-expression* *sub-replace-\=* *s/\=* When the substitute string starts with "\=" the remainder is interpreted as an -expression. This does not work recursively: a |substitute()| function inside -the expression cannot use "\=" for the substitute string. +expression. The special meaning for characters as mentioned at |sub-replace-special| does not apply except for "". A character is used as a line break, you diff --git a/runtime/doc/channel.txt b/runtime/doc/channel.txt new file mode 100644 index 0000000000..c94c64eb84 --- /dev/null +++ b/runtime/doc/channel.txt @@ -0,0 +1,168 @@ +*channel.txt* Nvim + + + NVIM REFERENCE MANUAL by Thiago de Arruda + + +Nvim's facilities for async io *channel* + + Type to see the table of contents. + +============================================================================== +1. Introduction *channel-intro* + +Channels are nvim's way of communicating with external processes. + +There are several ways to open a channel: + + 1. Through stdin/stdout when `nvim` is started with `--headless`, and a startup + script or --cmd command opens the stdio channel using |stdioopen()|. + + 2. Through stdin, stdout and stderr of a process spawned by |jobstart()|. + + 3. Through the PTY master end of a PTY opened with + `jobstart(..., {'pty': v:true})` or |termopen()|. + + 4. By connecting to a TCP/IP socket or named pipe with |sockconnect()|. + + 5. By another process connecting to a socket listened to by nvim. This only + supports RPC channels, see |rpc-connecting|. + +Channels support multiple modes or protocols. In the most basic +mode of operation, raw bytes are read and written to the channel. +The |rpc| protocol, based on the msgpack-rpc standard, enables nvim and the +process at the other end to send remote calls and events to each other. +Additionally, the builtin |terminal-emulator|, is implemented on top of PTY +channels. + +============================================================================== +2. Reading and writing raw bytes *channel-bytes* + +By default, channels opened by vimscript functions will operate with raw +bytes. Additionally, for a job channel using rpc, bytes can still be +read over its stderr. Similarily, only bytes can be written to nvim's own stderr. + + *channel-callback* *buffered* + *on_stdout* *on_stderr* *on_stdin* *on_data* +A callback function `on_{stream}` will be invoked with data read from the +channel. By default, the callback will be invoked immediately when data is +available, to facilitate interactive communication. The same callback will +then be invoked with empty data, to indicate that the stream reached EOF. +Alternatively the `{stream}_buffered` option can be set to invoke the callback +only when the underlying stream reaches EOF, and will then be passed in +complete output. This is helpful when only the complete output is useful, and +not partial data. Futhermore if `{stream}_buffered` is set but not a callback, +the data is saved in the options dict, with the stream name as key. + +- The arguments passed to the callback function are: + + 0: The channel id + 1: the raw data read from the channel, formatted as a |readfile()|-style + list. If EOF occured, a single empty string `['']` will be passed in. + Note that the items in this list do not directly correspond to actual + lines in the output. See |channel-lines| + 2: Stream name as a string, like `"stdout"`. This is to allow multiple + on_{event} handlers to be implemented by the same function. The available + events depend on how the channel was opened and in what mode/protocol. + + *channel-lines* + Note: + stream event handlers may receive partial (incomplete) lines. For a given + invocation of on_stdout etc, `a:data` is not guaranteed to end + with a newline. + - `abcdefg` may arrive as `['abc']`, `['defg']`. + - `abc\nefg` may arrive as `['abc', '']`, `['efg']` or `['abc']`, + `['','efg']`, or even `['ab']`, `['c','efg']`. + + If you only are interested in complete output when the process exits, + use buffered mode. Otherwise, an easy way to deal with this: + initialize a list as `['']`, then append to it as follows: > + let s:chunks = [''] + func! s:on_event(job_id, data, event) dict + let s:chunks[-1] .= a:data[0] + call extend(s:chunks, a:data[1:]) + endf +< + +Additionally, if the callbacks are Dictionary functions, |self| can be used to +refer to the options dictionary containing the callbacks. |Partial|s can also be +used as callbacks. + +Data can be sent to the channel using the |chansend()| function. Here is a +simple example, echoing some data through a cat-process: +> + function! s:OnEvent(id, data, event) dict + let str = join(a:data, "\n") + echomsg str + endfunction + let id = jobstart(['cat'], {'on_stdout': function('s:OnEvent') } ) + call chansend(id, "hello!") +< + +Here is a example of setting a buffer to the result of grep, but only after +all data has been processed: +> + function! s:OnEvent(id, data, event) dict + call nvim_buf_set_lines(2, 0, -1, v:true, a:data) + endfunction + let id = jobstart(['grep', '^[0-9]'], { 'on_stdout': function('s:OnEvent'), + \ 'stdout_buffered':v:true } ) + + call chansend(id, "stuff\n10 PRINT \"NVIM\"\nxx") + " no output is received, buffer is empty + + call chansend(id, "xx\n20 GOTO 10\nzz\n") + call chanclose(id, 'stdin') + " now buffer has result +< +For additional examples with jobs, see |job-control|. + + *channel-pty* +A special case is PTY channels opened by `jobstart(..., {'pty': v:true})` . +No preprocessing of ANSI escape sequences is done, these will be sent raw to +the callback. However, change of PTY size can be signaled to the slave using +|jobresize()|. See also |terminal-emulator|. + +============================================================================== +3. Communicating using msgpack-rpc *channel-rpc* + +When channels are opened with the `rpc` option set to true, the channel can be +used for remote method calls in both directions, see |msgpack-rpc|. Note that +rpc channels are implicitly trusted and the process at the other end can +invoke any |api| function! + +============================================================================== +4. Using the stdio channel *channel-stdio* + +When invoked normally, nvim will use stdin and stdout to interact with the +user over the terminal interface (TUI). However when invoked with +`--headless`, the TUI is not started and stdin and stdout can be used as a +channel. To open the stdio channel |stdioopen()| must be called during +|startup|, as there later will be no way of invoking a command. As a +convenience, the stdio channel will always have channel id 1. + +Here is an example: +> + func! OnEvent(id, data, event) + if a:data == [""] + quit + end + call chansend(a:id, map(a:data, {i,v -> toupper(v)})) + endfunc + + call stdioopen({'on_stdin': 'OnEvent'}) +< +Put this in `uppercase.vim` and invoke nvim with +> + nvim --headless --cmd "source uppercase.vim" +< + *--embed* +An common use case is another program embedding nvim and communicating with it +over rpc. Therefore, the option `--embed` exists as a shorthand for +`nvim --headless --cmd "call stdioopen({'rpc': v:true})"` + +Nvim's stderr is implicitly open as a write-only bytes channel. It will +always have channel id 2, however to be explicit |v:stderr| can be used. + +============================================================================== + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/runtime/doc/cmdline.txt b/runtime/doc/cmdline.txt index a123ea711b..00e654841c 100644 --- a/runtime/doc/cmdline.txt +++ b/runtime/doc/cmdline.txt @@ -1,4 +1,4 @@ -*cmdline.txt* For Vim version 7.4. Last change: 2015 Dec 17 +*cmdline.txt* Nvim VIM REFERENCE MANUAL by Bram Moolenaar @@ -13,13 +13,7 @@ Command-line mode is used to enter Ex commands (":"), search patterns Basic command line editing is explained in chapter 20 of the user manual |usr_20.txt|. -1. Command-line editing |cmdline-editing| -2. Command-line completion |cmdline-completion| -3. Ex command-lines |cmdline-lines| -4. Ex command-line ranges |cmdline-ranges| -5. Ex command-line flags |ex-flags| -6. Ex special characters |cmdline-special| -7. Command-line window |cmdline-window| + Type |gO| to see the table of contents. ============================================================================== 1. Command-line editing *cmdline-editing* @@ -219,9 +213,10 @@ CTRL-Y When there is a modeless selection, copy the selection into the clipboard. |modeless-selection| If there is no selection CTRL-Y is inserted as a character. -CTRL-J *c_CTRL-J* *c_* *c_* *c_CR* +CTRL-M or CTRL-J *c_CTRL-M* *c_CTRL-J* *c_* *c_* *c_CR* or start entered command - *c_* *c_Esc* + +CTRL-[ *c_CTRL-[* *c_* *c_Esc* When typed and 'x' not present in 'cpoptions', quit Command-line mode without executing. In macros or when 'x' present in 'cpoptions', start entered command. @@ -332,8 +327,11 @@ terminals) List entries 6 to 12 from the search history: > :history / 6,12 < - List the recent five entries from all histories: > - :history all -5, + List the penultimate entry from all histories: > + :history all -2 +< + List the most recent two entries from all histories: > + :history all -2, :keepp[atterns] {command} *:keepp* *:keeppatterns* Execute {command}, without adding anything to the search @@ -363,7 +361,7 @@ These are the commands that can be used: *c_CTRL-D* CTRL-D List names that match the pattern in front of the cursor. When showing file names, directories are highlighted (see - 'highlight' option). Names where 'suffixes' matches are moved + |highlight-groups|). Names where 'suffixes' matches are moved to the end. The 'wildoptions' option can be set to "tagfile" to list the file of matching tags. @@ -394,12 +392,26 @@ CTRL-L A match is done on the pattern in front of the cursor. If If there are multiple matches the longest common part is inserted in place of the pattern. If the result is shorter than the pattern, no completion is done. + */_CTRL-L* When 'incsearch' is set, entering a search pattern for "/" or "?" and the current match is displayed then CTRL-L will add one character from the end of the current match. If 'ignorecase' and 'smartcase' are set and the command line has no uppercase characters, the added character is converted to lowercase. + *c_CTRL-G* */_CTRL-G* +CTRL-G When 'incsearch' is set, entering a search pattern for "/" or + "?" and the current match is displayed then CTRL-G will move + to the next match (does not take |search-offset| into account) + Use CTRL-T to move to the previous match. Hint: on a regular + keyboard T is above G. + *c_CTRL-T* */_CTRL-T* +CTRL-T When 'incsearch' is set, entering a search pattern for "/" or + "?" and the current match is displayed then CTRL-T will move + to the previous match (does not take |search-offset| into + account). + Use CTRL-G to move to the next match. Hint: on a regular + keyboard T is above G. The 'wildchar' option defaults to (CTRL-E when in Vi compatible mode; in a previous version was used). In the pattern standard wildcards '*' and @@ -408,6 +420,9 @@ matches exactly one character. The 'wildignorecase' option can be set to ignore case in filenames. +The 'wildmenu' option can be set to show the matches just above the command +line. + If you like tcsh's autolist completion, you can use this mapping: :cnoremap X (Where X is the command key to use, is CTRL-L and is CTRL-D) @@ -766,6 +781,7 @@ Also see |`=|. *:* *:* *:* ** *:* ** *:* ** *:* ** *:* ** + *:* ** ** *E495* *E496* *E497* *E499* *E500* Note: these are typed literally, they are not special keys! is replaced with the word under the cursor (like |star|) @@ -773,7 +789,8 @@ Note: these are typed literally, they are not special keys! is replaced with the path name under the cursor (like what |gf| uses) When executing autocommands, is replaced with the file name - for a file read or write. + of the buffer being manipulated, or the file for a read or + write. When executing autocommands, is replaced with the currently effective buffer number (for ":r file" and ":so file" it is the current buffer, the file being read/sourced is not in a @@ -999,10 +1016,10 @@ There are several ways to leave the command-line window: Insert and in Normal mode. CTRL-C Continue in Command-line mode. The command-line under the cursor is used as the command-line. Works both in Insert and - in Normal mode. ":close" also works. There is no redraw, - thus the window will remain visible. + in Normal mode. There is no redraw, thus the window will + remain visible. :quit Discard the command line and go back to Normal mode. - ":exit", ":xit" and CTRL-\ CTRL-N also work. + ":close", ":exit", ":xit" and CTRL-\ CTRL-N also work. :qall Quit Vim, unless there are changes in some buffer. :qall! Quit Vim, discarding changes to any buffer. @@ -1071,7 +1088,7 @@ Another example: > :au CmdwinEnter [/?] startinsert This will make Vim start in Insert mode in the command-line window. - *cmdwin-char* + *cmdline-char* *cmdwin-char* The character used for the pattern indicates the type of command-line: : normal Ex command > debug mode command |debug-mode| diff --git a/runtime/doc/debug.txt b/runtime/doc/debug.txt index f03116ffed..422255fa02 100644 --- a/runtime/doc/debug.txt +++ b/runtime/doc/debug.txt @@ -1,4 +1,4 @@ -*debug.txt* For Vim version 7.4. Last change: 2012 Feb 11 +*debug.txt* Nvim VIM REFERENCE MANUAL by Bram Moolenaar @@ -9,9 +9,7 @@ Debugging Vim *debug-vim* This is for debugging Vim itself, when it doesn't work properly. For debugging Vim scripts, functions, etc. see |debug-scripts| -1. Location of a crash, using gcc and gdb |debug-gcc| -2. Locating memory leaks |debug-leaks| -3. Windows Bug Reporting |debug-win32| + Type |gO| to see the table of contents. ============================================================================== diff --git a/runtime/doc/deprecated.txt b/runtime/doc/deprecated.txt index ef00143709..72dfe1230e 100644 --- a/runtime/doc/deprecated.txt +++ b/runtime/doc/deprecated.txt @@ -1,4 +1,4 @@ -*deprecated.txt* {Nvim} +*deprecated.txt* Nvim NVIM REFERENCE MANUAL @@ -26,9 +26,6 @@ Events ~ *EncodingChanged* Never fired; 'encoding' is always "utf-8". *FileEncoding* Never fired; equivalent to |EncodingChanged|. -Highlight groups ~ -*hl-VisualNOS* Obsolete. |vim-differences| {Nvim} - Keycodes ~ ** Use instead. ** Use instead. @@ -40,11 +37,21 @@ Functions ~ *file_readable()* Obsolete name for |filereadable()|. *highlight_exists()* Obsolete name for |hlexists()|. *highlightID()* Obsolete name for |hlID()|. +*jobclose()* Obsolete name for |chanclose()| +*jobsend()* Obsolete name for |chansend()| *last_buffer_nr()* Obsolete name for bufnr("$"). +Modifiers ~ +*:menu-* +*:menu-special* <> notation is always enabled. |cpo-<| +*:map-* +*:map-special* <> notation is always enabled. |cpo-<| + Options ~ *'fe'* 'fenc'+'enc' before Vim 6.0; no longer used. +*'highlight'* *'hl'* Names of builtin |highlight-groups| cannot be changed. +*'langnoremap'* Deprecated alias to 'nolangremap'. *'vi'* *'viminfo'* Deprecated alias to 'shada' option. - vim:tw=78:ts=8:ft=help:norl: + vim:noet:tw=78:ts=8:ft=help:norl: diff --git a/runtime/doc/develop.txt b/runtime/doc/develop.txt index b738da9bec..36826e2479 100644 --- a/runtime/doc/develop.txt +++ b/runtime/doc/develop.txt @@ -1,4 +1,4 @@ -*develop.txt* +*develop.txt* Nvim NVIM REFERENCE MANUAL @@ -6,22 +6,19 @@ Development of Nvim. *development* -1. Design goals |design-goals| -2. Design decisions |design-decisions| - Nvim is open source software. Everybody is encouraged to contribute. https://github.com/neovim/neovim/blob/master/CONTRIBUTING.md -See src/nvim/README.md for a high-level overview of the source code: - https://github.com/neovim/neovim/blob/master/src/nvim/README.md +See src/nvim/README.md for an overview of the source code. + + Type |gO| to see the table of contents. ============================================================================== -1. Design goals *design-goals* +Design goals *design-goals* Most important things come first (roughly). -Note that quite a few items are contradicting. This is intentional. A -balance must be found between them. +Note that some items conflict; this is intentional. A balance must be found. NVIM IS... IMPROVED *design-improved* @@ -41,7 +38,7 @@ completely different editor. Extensions are done with a "Vi spirit". - There are many first-time and inexperienced Vim users. Make it easy for them to start using Vim and learn more over time. - There is no limit to the features that can be added. Selecting new features - is one based on (1) what users ask for, (2) how much effort it takes to + is based on (1) what users ask for, (2) how much effort it takes to implement and (3) someone actually implementing it. @@ -56,33 +53,21 @@ Vim tries to help as many users on as many platforms as possible. - Support many compilers and libraries. Not everybody is able or allowed to install another compiler or GUI library. - People switch from one platform to another, and from GUI to terminal - version. Features should be present in all versions, or at least in as many - as possible with a reasonable effort. Try to avoid that users must switch - between platforms to accomplish their work efficiently. -- That a feature is not possible on some platforms, or only possible on one - platform, does not mean it cannot be implemented. [This intentionally - contradicts the previous item, these two must be balanced.] + version. Features should be present in all versions. NVIM IS... WELL DOCUMENTED *design-documented* - A feature that isn't documented is a useless feature. A patch for a new feature must include the documentation. -- Documentation should be comprehensive and understandable. Using examples is - recommended. +- Documentation should be comprehensive and understandable. Use examples. - Don't make the text unnecessarily long. Less documentation means that an item is easier to find. -- Do not prefix doc-tags with "nvim-". Use |vim_diff.txt| to document - differences from Vim. The {Nvim} annotation is also available - to mark a specific feature. No other distinction is necessary. -- If a feature is removed, delete its doc entry and move its tag to - |vim_diff.txt|. NVIM IS... HIGH SPEED AND SMALL IN SIZE *design-speed-size* -Using Vim must not be a big attack on system resources. Keep it small and -fast. +Keep Nvim small and fast. - Computers are becoming faster and bigger each year. Vim can grow too, but no faster than computers are growing. Keep Vim usable on older systems. - Many users start Vim from a shell very often. Startup time must be short. @@ -118,13 +103,14 @@ NVIM IS... NOT *design-not* Nvim is not an operating system; instead it should be composed with other tools or hosted as a component. Marvim once said: "Unlike Emacs, Nvim does not -include the kitchen sink... but you can use it for plumbing." +include the kitchen sink... but it's good for plumbing." ============================================================================== -2. Design decisions *design-decisions* +Developer guidelines *dev* -JARGON *dev-jargon* + +JARGON *dev-jargon* API client ~ All external UIs and remote plugins (as opposed to regular Vim plugins) are @@ -150,15 +136,16 @@ the xterm window, a window inside Vim to view a buffer. To avoid confusion, other items that are sometimes called window have been given another name. Here is an overview of the related items: -screen The whole display. For the GUI it's something like 1024x768 - pixels. The Vim shell can use the whole screen or part of it. +screen The whole display. shell The Vim application. This can cover the whole screen (e.g., when running in a console) or part of it (xterm or GUI). window View on a buffer. There can be several windows in Vim, together with the command line, menubar, toolbar, etc. they fit in the shell. +frame Windows are kept in a tree of frames. Each frame contains + a column, row, or window ("leaf" frame). -PROVIDERS *dev-provider* +PROVIDERS *dev-provider* A goal of Nvim is to allow extension of the editor without special knowledge in the core. But some Vim components are too tightly coupled; in those cases @@ -201,8 +188,20 @@ defined if a valid external Python host is found. That works well with the Python host isn't installed then the plugin will "think" it is running in a Vim compiled without the |+python| feature. +DOCUMENTATION *dev-doc* -API *dev-api* +- Do not prefix help tags with "nvim-". Use |vim_diff.txt| to document + differences from Vim; no other distinction is necessary. +- If a Vim feature is removed, delete its help section and move its tag to + |vim_diff.txt|. +- Move deprecated features to |deprecated.txt|. +- Use consistent language. + - "terminal" in a help tag always means "the embedded terminal emulator", not + "the user host terminal". + - Use "tui-" to prefix help tags related to the host terminal, and "TUI" + in prose if possible. + +API *dev-api* Use this pattern to name new API functions: nvim_{thing}_{action}_{arbitrary-qualifiers} @@ -233,4 +232,47 @@ _not_ a Buffer). The common {action} "list" indicates that it lists all bufs (plural) in the global context. +API-CLIENT *dev-api-client* + +Package Naming ~ +API client packages should NOT be named something ambiguous like "neovim" or +"python-client". Use "nvim" as a prefix/suffix to some other identifier +following ecosystem conventions. + +For example, Python packages tend to have "py" in the name, so "pynvim" is +a good name: it's idiomatic and unambiguous. If the package is named "neovim", +it confuses users, and complicates documentation and discussions. + +Examples of API-client package names: + GOOD: nvim-racket + GOOD: pynvim + BAD: python-client + BAD: neovim + +Implementation ~ +Consider using libmpack instead of the msgpack.org C/C++ library. libmpack is +small, efficient, and C89-compatible. It can be easily inlined in your +C project source, too. https://github.com/libmpack/libmpack/ + + +EXTERNAL UI *dev-ui* + +Compatibility ~ +External UIs should be aware of the |api-contract|. In particular, future +versions of Nvim may add new items to existing events. The API is strongly +backwards-compatible, but clients must not break if new fields are added to +existing events. + +Common Features ~ +External UIs are expected to implement these common features: +- Cursor style (shape, color) should respond to the 'guicursor' properties + delivered with the mode_info_set UI event. +- Send the "super" key (Windows key, Apple key) as a | + autocmd OptionSet guifont call rpcnotify(42, 'option-changed', 'guifont', &guifont) + + vim:tw=78:ts=8:ft=help:norl: diff --git a/runtime/doc/diff.txt b/runtime/doc/diff.txt index 6b45f8552f..b9dccc42a8 100644 --- a/runtime/doc/diff.txt +++ b/runtime/doc/diff.txt @@ -1,4 +1,4 @@ -*diff.txt* For Vim version 7.4. Last change: 2016 Aug 24 +*diff.txt* Nvim VIM REFERENCE MANUAL by Bram Moolenaar @@ -10,14 +10,10 @@ eight versions of the same file. The basics are explained in section |08.7| of the user manual. -1. Starting diff mode |diff-mode| -2. Viewing diffs |view-diffs| -3. Jumping to diffs |jumpto-diffs| -4. Copying diffs |copy-diffs| -5. Diff options |diff-options| + Type |gO| to see the table of contents. ============================================================================== -1. Starting diff mode +1. Starting diff mode *start-vimdiff* To start editing in diff mode, run "nvim -d". This starts Nvim as usual, and additionally sets up for viewing the differences between the arguments. > @@ -123,6 +119,8 @@ file for a moment and come back to the same file and be in diff mode again. related options only happens in a window that has 'diff' set, if the current window does not have 'diff' set then no options in it are changed. + Hidden buffers are also removed from the list of diff'ed + buffers. The `:diffoff` command resets the relevant options to the values they had when using `:diffsplit`, `:diffpatch` , `:diffthis`. or starting Vim in diff mode. @@ -156,7 +154,8 @@ The alignment of text will go wrong when: All the buffers edited in a window where the 'diff' option is set will join in the diff. This is also possible for hidden buffers. They must have been -edited in a window first for this to be possible. +edited in a window first for this to be possible. To get rid of the hidden +buffers use `:diffoff!`. *:DiffOrig* *diff-original-file* Since 'diff' is a window-local option, it's possible to view the same buffer @@ -215,8 +214,8 @@ The diffs are highlighted with these groups: (searching from the end of the line). The text in between is highlighted. This means that parts in the middle that are still the - same are highlighted anyway. Only "iwhite" of - 'diffopt' is used here. + same are highlighted anyway. The 'diffopt' + flags "iwhite" and "icase" are used here. |hl-DiffDelete| DiffDelete Deleted lines. Also called filler lines, because they don't really exist in this buffer. @@ -315,7 +314,7 @@ g:diff_translations to zero: > let g:diff_translations = 0 < -After setting this variable, Reload the syntax script: > +After setting this variable, reload the syntax script: > set syntax=diff < diff --git a/runtime/doc/digraph.txt b/runtime/doc/digraph.txt index 84024fd1b3..d3b03c6ef6 100644 --- a/runtime/doc/digraph.txt +++ b/runtime/doc/digraph.txt @@ -1,4 +1,4 @@ -*digraph.txt* For Vim version 7.4. Last change: 2014 Jun 19 +*digraph.txt* Nvim VIM REFERENCE MANUAL by Bram Moolenaar @@ -14,9 +14,7 @@ with CTRL-V (see |i_CTRL-V|). There is a brief introduction on digraphs in the user manual: |24.9| An alternative is using the 'keymap' option. -1. Defining digraphs |digraphs-define| -2. Using digraphs |digraphs-use| -3. Default digraphs |digraphs-default| + Type |gO| to see the table of contents. ============================================================================== 1. Defining digraphs *digraphs-define* @@ -145,7 +143,7 @@ a standard meaning: Two 2 Hook Nine 9 Horn - Equals = Cyrillic (= used as second char) + Equals = Cyrillic (= used as second char) Asterisk * Greek Percent sign % Greek/Cyrillic special Plus + smalls: Arabic, capitals: Hebrew @@ -924,6 +922,7 @@ char digraph hex dec official name ~ † /- 2020 8224 DAGGER ‡ /= 2021 8225 DOUBLE DAGGER ‥ .. 2025 8229 TWO DOT LEADER +… ,. 2026 8230 HORIZONTAL ELLIPSIS ‰ %0 2030 8240 PER MILLE SIGN ′ 1' 2032 8242 PRIME ″ 2' 2033 8243 DOUBLE PRIME diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt index 5bfffac1f1..1b9a1b38fb 100644 --- a/runtime/doc/editing.txt +++ b/runtime/doc/editing.txt @@ -1,4 +1,4 @@ -*editing.txt* For Vim version 7.4. Last change: 2016 Aug 06 +*editing.txt* Nvim VIM REFERENCE MANUAL by Bram Moolenaar @@ -6,17 +6,7 @@ Editing files *edit-files* -1. Introduction |edit-intro| -2. Editing a file |edit-a-file| -3. The argument list |argument-list| -4. Writing |writing| -5. Writing and quitting |write-quit| -6. Dialogs |edit-dialogs| -7. The current directory |current-directory| -8. Editing binary files |edit-binary| -9. Encryption |encryption| -10. Timestamps |timestamps| -11. File Searching |file-searching| + Type |gO| to see the table of contents. ============================================================================== 1. Introduction *edit-intro* @@ -160,7 +150,8 @@ start editing another file, Vim will refuse this. In order to overrule this protection, add a '!' to the command. The changes will then be lost. For example: ":q" will not work if the buffer was changed, but ":q!" will. To see whether the buffer was changed use the "CTRL-G" command. The message includes -the string "[Modified]" if the buffer has been changed. +the string "[Modified]" if the buffer has been changed, or "+" if the 'm' flag +is in 'shortmess'. If you want to automatically save the changes without asking, switch on the 'autowriteall' option. 'autowrite' is the associated Vi-compatible option @@ -245,7 +236,7 @@ If you want to keep the changed buffer without saving it, switch on the *:vie* *:view* :vie[w][!] [++opt] [+cmd] file - When used in Ex mode: Leave |Ex mode|, go back to + When used in Ex mode: Leave |Ex-mode|, go back to Normal mode. Otherwise same as |:edit|, but set 'readonly' option for this buffer. @@ -910,11 +901,12 @@ WRITING WITH MULTIPLE BUFFERS *buffer-write* *:wa* *:wall* :wa[ll] Write all changed buffers. Buffers without a file - name or which are readonly are not written. + name cause an error message. Buffers which are + readonly are not written. :wa[ll]! Write all changed buffers, even the ones that are readonly. Buffers without a file name are not - written. + written and cause an error message. Vim will warn you if you try to overwrite a file that has been changed @@ -1040,6 +1032,7 @@ The names can be in upper- or lowercase. window in the current tab page the current tab page is closed |tab-page|. Triggers the |QuitPre| autocommand event. + See |CTRL-W_q| for quitting another window. :conf[irm] q[uit] Quit, but give prompt when changes have been made, or the last file in the argument list has not been @@ -1273,14 +1266,14 @@ Commands for changing the working directory can be suffixed with a bang "!" *:lc* *:lcd* :lc[d][!] {path} Like |:cd|, but only set the current directory for the current window. The current directory for other - windows or any tabs is not changed. + windows or tabs is not changed. *:lch* *:lchdir* :lch[dir][!] Same as |:lcd|. *:lcd-* :lcd[!] - Change to the previous current directory (before the - previous ":tcd {path}" command). + previous ":lcd {path}" command). *:pw* *:pwd* *E187* :pw[d] Print the current directory name. @@ -1372,6 +1365,13 @@ If you want to automatically reload a file when it has been changed outside of Vim, set the 'autoread' option. This doesn't work at the moment you write the file though, only when the file wasn't changed inside of Vim. +If you do not want to be asked or automatically reload the file, you can use +this: > + set buftype=nofile + +Or, when starting gvim from a shell: > + gvim file.log -c "set buftype=nofile" + Note that if a FileChangedShell autocommand is defined you will not get a warning message or prompt. The autocommand is expected to handle this. @@ -1542,7 +1542,7 @@ There are three different types of searching: This searches the same directories, but in a different order. Note that completion for ":find", ":sfind", and ":tabfind" commands do not - currently work with 'path' items that contain a url or use the double star + currently work with 'path' items that contain a URL or use the double star with depth limiter (/usr/**2) or upward search (;) notations. vim:tw=78:ts=8:ft=help:norl: diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index d94b3b7a2e..d2a3a962e6 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 7.4. Last change: 2016 Aug 27 +*eval.txt* Nvim VIM REFERENCE MANUAL by Bram Moolenaar @@ -12,23 +12,7 @@ Note: Expression evaluation can be disabled at compile time. If this has been done, the features in this document are not available. See |+eval| and |no-eval-feature|. -1. Variables |variables| - 1.1 Variable types - 1.2 Function references |Funcref| - 1.3 Lists |Lists| - 1.4 Dictionaries |Dictionaries| - 1.5 More about variables |more-variables| -2. Expression syntax |expression-syntax| -3. Internal variable |internal-variables| -4. Builtin Functions |functions| -5. Defining functions |user-functions| -6. Curly braces names |curly-braces-names| -7. Commands |expression-commands| -8. Exception handling |exception-handling| -9. Examples |eval-examples| -10. No +eval feature |no-eval-feature| -11. The sandbox |eval-sandbox| -12. Textlock |textlock| + Type |gO| to see the table of contents. ============================================================================== 1. Variables *variables* @@ -38,7 +22,9 @@ done, the features in this document are not available. See |+eval| and There are six types of variables: Number A 32 or 64 bit signed number. |expr-number| *Number* - Examples: -123 0x10 0177 + 64-bit Number is available only when compiled with the + |+num64| feature. + Examples: -123 0x10 0177 0b1011 Float A floating point number. |floating-point-format| *Float* Examples: 123.456 1.15e-6 -1.1e3 @@ -107,10 +93,9 @@ To test for a non-empty string, use empty(): > *non-zero-arg* Function arguments often behave slightly different from |TRUE|: If the argument is present and it evaluates to a non-zero Number, |v:true| or a -non-empty String, then the value is considere to be TRUE. -Note that " " and "0" are also non-empty strings, thus cause the mode to be -cleared. A List, Dictionary or Float is not a Number or String, thus -evaluates to FALSE. +non-empty String, then the value is considered to be TRUE. +Note that " " and "0" are also non-empty strings, thus considered to be TRUE. +A List, Dictionary or Float is not a Number or String, thus evaluate to FALSE. *E745* *E728* *E703* *E729* *E730* *E731* List, Dictionary and Funcref types are not automatically converted. @@ -247,7 +232,7 @@ it. To change a list in-place see |list-modification| below. Sublist ~ - + *sublist* A part of the List can be obtained by specifying the first and last index, separated by a colon in square brackets: > :let shortlist = mylist[2:-1] " get List [3, "four"] @@ -394,10 +379,6 @@ This works like: > : let index = index + 1 :endwhile -Note that all items in the list should be of the same type, otherwise this -results in error |E706|. To avoid this |:unlet| the variable at the end of -the loop. - If all you want to do is modify each item in the list then the |map()| function will be a simpler method than a for loop. @@ -631,13 +612,17 @@ It's possible to form a variable name with curly braces, see Expression syntax summary, from least to most significant: -|expr1| expr2 ? expr1 : expr1 if-then-else +|expr1| expr2 + expr2 ? expr1 : expr1 if-then-else -|expr2| expr3 || expr3 .. logical OR +|expr2| expr3 + expr3 || expr3 .. logical OR -|expr3| expr4 && expr4 .. logical AND +|expr3| expr4 + expr4 && expr4 .. logical AND -|expr4| expr5 == expr5 equal +|expr4| expr5 + expr5 == expr5 equal expr5 != expr5 not equal expr5 > expr5 greater than expr5 >= expr5 greater than or equal @@ -654,24 +639,28 @@ Expression syntax summary, from least to most significant: expr5 is expr5 same |List| instance expr5 isnot expr5 different |List| instance -|expr5| expr6 + expr6 .. number addition or list concatenation +|expr5| expr6 + expr6 + expr6 .. number addition or list concatenation expr6 - expr6 .. number subtraction expr6 . expr6 .. string concatenation -|expr6| expr7 * expr7 .. number multiplication +|expr6| expr7 + expr7 * expr7 .. number multiplication expr7 / expr7 .. number division expr7 % expr7 .. number modulo -|expr7| ! expr7 logical NOT +|expr7| expr8 + ! expr7 logical NOT - expr7 unary minus + expr7 unary plus -|expr8| expr8[expr1] byte of a String or item of a |List| +|expr8| expr9 + expr8[expr1] byte of a String or item of a |List| expr8[expr1 : expr1] substring of a String or sublist of a |List| expr8.name entry in a |Dictionary| expr8(expr1, ...) function call with |Funcref| variable -|expr9| number number constant +|expr9| number number constant "string" string constant, backslash is special 'string' string constant, ' is doubled [expr1, ...] |List| @@ -792,14 +781,15 @@ Examples: "abc" == "Abc" evaluates to 1 if 'ignorecase' is set, 0 otherwise *E691* *E692* -A |List| can only be compared with a |List| and only "equal", "not equal" and -"is" can be used. This compares the values of the list, recursively. -Ignoring case means case is ignored when comparing item values. +A |List| can only be compared with a |List| and only "equal", "not equal", +"is" and "isnot" can be used. This compares the values of the list, +recursively. Ignoring case means case is ignored when comparing item values. *E735* *E736* A |Dictionary| can only be compared with a |Dictionary| and only "equal", "not -equal" and "is" can be used. This compares the key/values of the |Dictionary| -recursively. Ignoring case means case is ignored when comparing item values. +equal", "is" and "isnot" can be used. This compares the key/values of the +|Dictionary| recursively. Ignoring case means case is ignored when comparing +item values. *E694* A |Funcref| can only be compared with a |Funcref| and only "equal", "not @@ -899,6 +889,11 @@ When dividing a Number by zero the result depends on the value: <0 / 0 = -0x7fffffff (like negative infinity) (before Vim 7.2 it was always 0x7fffffff) +When 64-bit Number support is enabled: + 0 / 0 = -0x8000000000000000 (like NaN for Float) + >0 / 0 = 0x7fffffffffffffff (like positive infinity) + <0 / 0 = -0x7fffffffffffffff (like negative infinity) + When the righthand side of '%' is zero, the result is 0. None of these work for |Funcref|s. @@ -931,7 +926,7 @@ expr8[expr1] item of String or |List| *expr-[]* *E111* If expr8 is a Number or String this results in a String that contains the expr1'th single byte from expr8. expr8 is used as a String, expr1 as a -Number. This doesn't recognize multi-byte encodings, see |byteidx()| for +Number. This doesn't recognize multi-byte encodings, see `byteidx()` for an alternative, or use `split()` to turn the string into a list of characters. Index zero gives the first byte. This is like it works in C. Careful: @@ -975,10 +970,10 @@ Examples: > :let s = line(".")[4:] " from the fifth byte to the end :let s = s[:-3] " remove last two bytes < - *sublist* *slice* + *slice* If expr8 is a |List| this results in a new |List| with the items indicated by the indexes expr1a and expr1b. This works like with a String, as explained -just above, except that indexes out of range cause an error. Examples: > +just above. Also see |sublist| below. Examples: > :let l = mylist[:3] " first four items :let l = mylist[4:4] " List with one item :let l = mylist[:] " shallow copy of a List @@ -1021,10 +1016,11 @@ When expr8 is a |Funcref| type variable, invoke the function it refers to. *expr9* number ------ -number number constant *expr-number* - *hex-number* *octal-number* +number number constant *expr-number* + *hex-number* *octal-number* *binary-number* -Decimal, Hexadecimal (starting with 0x or 0X), or Octal (starting with 0). +Decimal, Hexadecimal (starting with 0x or 0X), Binary (starting with 0b or 0B) +and Octal (starting with 0). *floating-point-format* Floating point numbers can be written in two forms: @@ -1213,8 +1209,8 @@ The arguments are optional. Example: > < error function *closure* Lambda expressions can access outer scope variables and arguments. This is -often called a closure. Example where "i" a and "a:arg" are used in a lambda -while they exists in the function scope. They remain valid even after the +often called a closure. Example where "i" and "a:arg" are used in a lambda +while they exist in the function scope. They remain valid even after the function returns: > :function Foo(arg) : let i = 3 @@ -1232,7 +1228,7 @@ Examples for using a lambda expression with |sort()|, |map()| and |filter()|: > :echo sort([3,7,2,1,4], {a, b -> a - b}) < [1, 2, 3, 4, 7] -The lambda expression is also useful for Channel, Job and timer: > +The lambda expression is also useful for jobs and timers: > :let timer = timer_start(500, \ {-> execute("echo 'Handler called'", "")}, \ {'repeat': 3}) @@ -1296,7 +1292,8 @@ b:changedtick The total number of changes to the current buffer. It is : let my_changedtick = b:changedtick : call My_Update() :endif -< +< You cannot change or delete the b:changedtick variable. + *window-variable* *w:var* *w:* A variable name that is preceded with "w:" is local to the current window. It is deleted when the window is closed. @@ -1425,8 +1422,8 @@ v:beval_winnr The number of the window, over which the mouse pointer is. Only window gets a number). *v:beval_winid* *beval_winid-variable* -v:beval_winid The window ID of the window, over which the mouse pointer is. - Otherwise like v:beval_winnr. +v:beval_winid The |window-ID| of the window, over which the mouse pointer + is. Otherwise like v:beval_winnr. *v:char* *char-variable* v:char Argument for evaluating 'formatexpr' and used for the typed @@ -1477,7 +1474,6 @@ v:count The count given for the last Normal mode command. Can be used When there are two counts, as in "3d2w", they are multiplied, just like what happens in the command, "d6w" for the example. Also used for evaluating the 'formatexpr' option. - "count" also works, for backwards compatibility. *v:count1* *count1-variable* v:count1 Just like "v:count", but defaults to one when no count is @@ -1524,16 +1520,28 @@ v:errors Errors found by assert functions, such as |assert_true()|. list by the assert function. *v:event* *event-variable* -v:event Dictionary of event data for the current |autocommand|. The - available keys differ per event type and are specified at the - documentation for each |event|. The possible keys are: - operator The operation performed. Unlike - |v:operator|, it is set also for an Ex - mode command. For instance, |:yank| is - translated to "|y|". +v:event Dictionary of event data for the current |autocommand|. Valid + only during the event lifetime; storing or passing v:event is + invalid! Copy it instead: > + au TextYankPost * let g:foo = deepcopy(v:event) +< Keys vary by event; see the documentation for the specific + event, e.g. |DirChanged| or |TextYankPost|. + KEY DESCRIPTION ~ + abort Whether the event triggered during + an aborting condition, i e |c_Esc| or + |c_CTRL-c|for |CmdlineLeave|. + cmdlevel Level of cmdline. + cmdtype Type of cmdline, |cmdline-char|. + cwd Current working directory. + scope Event-specific scope name. + operator Current |operator|. Also set for Ex + commands (unlike |v:operator|). For + example if |TextYankPost| is triggered + by the |:yank| Ex command then + `v:event.operator` is "y". regcontents Text stored in the register as a |readfile()|-style list of lines. - regname Requested register (e.g "x" for "xyy) + regname Requested register (e.g "x" for "xyy) or the empty string for an unnamed operation. regtype Type of register as returned by @@ -1681,7 +1689,7 @@ v:mouse_win Window number for a mouse click obtained with |getchar()|. zero when there was no mouse button click. *v:mouse_winid* *mouse_winid-variable* -v:mouse_winid Window ID for a mouse click obtained with |getchar()|. +v:mouse_winid |window-ID| for a mouse click obtained with |getchar()|. The value is zero when there was no mouse button click. *v:mouse_lnum* *mouse_lnum-variable* @@ -1754,9 +1762,7 @@ v:profiling Normally zero. Set to one after using ":profile start". See |profiling|. *v:progname* *progname-variable* -v:progname Contains the name (with path removed) with which Nvim was - invoked. Allows you to do special initialisations for any - name you might symlink to Nvim. +v:progname The name by which Nvim was invoked (with path removed). Read-only. *v:progpath* *progpath-variable* @@ -1783,11 +1789,11 @@ v:scrollstart String describing the script or function that caused the *v:servername* *servername-variable* *$NVIM_LISTEN_ADDRESS* -v:servername Default {Nvim} server address. Equivalent to +v:servername Default Nvim server address. Equivalent to |$NVIM_LISTEN_ADDRESS| on startup. |serverstop()| Read-only. - + v:searchforward *v:searchforward* *searchforward-variable* Search direction: 1 after a forward search, 0 after a backward search. It is reset to forward when directly setting @@ -1812,6 +1818,13 @@ v:shell_error Result of the last shell command. When non-zero, the last *v:statusmsg* *statusmsg-variable* v:statusmsg Last given status message. It's allowed to set this variable. + *v:stderr* *stderr-variable* +v:stderr Channel id for stderr. Unlike stdin and stdout (see + |stdioopen()|), stderr is always open for writing. This channel + ID is always 2, but this variable can be used to be explicit. + Example: > + :call chansend(v:stderr, "something bad happened\n") +< *v:swapname* *swapname-variable* v:swapname Only valid when executing |SwapExists| autocommands: Name of the swap file found. Read-only. @@ -1852,10 +1865,11 @@ v:t_number Value of Number type. Read-only. See: |type()| v:t_string Value of String type. Read-only. See: |type()| *v:termresponse* *termresponse-variable* -v:termresponse The escape sequence returned by the terminal for the |t_RV| - termcap entry. It is set when Vim receives an escape sequence - that starts with ESC [ or CSI and ends in a 'c', with only - digits, ';' and '.' in between. +v:termresponse The escape sequence returned by the terminal for the DA + (request primary device attributes) control sequence. It is + set when Vim receives an escape sequence that starts with ESC + [ or CSI and ends in a 'c', with only digits, ';' and '.' in + between. When this option is set, the TermResponse autocommand event is fired, so that you can react to the response from the terminal. @@ -1867,6 +1881,8 @@ v:termresponse The escape sequence returned by the terminal for the |t_RV| *v:testing* *testing-variable* v:testing Must be set before using `test_garbagecollect_now()`. + Also, when set certain error messages won't be shown for 2 + seconds. (e.g. "'dictionary' option is empty") *v:this_session* *this_session-variable* v:this_session Full filename of the last loaded or saved session file. See @@ -1917,9 +1933,10 @@ v:vim_did_enter Zero until most of startup is done. It is set to one just v:warningmsg Last given warning message. It's allowed to set this variable. *v:windowid* *windowid-variable* -v:windowid Application-specific window ID ("window handle" in MS-Windows) - which may be set by any attached UI. Defaults to zero. - Note: for windows inside Vim use |winnr()| or |win_getid()|. +v:windowid Application-specific window "handle" which may be set by any + attached UI. Defaults to zero. + Note: For Nvim |windows| use |winnr()| or |win_getid()|, see + |window-ID|. ============================================================================== 4. Builtin Functions *functions* @@ -1942,16 +1959,23 @@ argidx() Number current index in the argument list arglistid([{winnr} [, {tabnr}]]) Number argument list id argv({nr}) String {nr} entry of the argument list argv() List the argument list -assert_equal({exp}, {act} [, {msg}]) none assert {exp} is equal to {act} -assert_exception( {error} [, {msg}]) none assert {error} is in v:exception -assert_fails( {cmd} [, {error}]) none assert {cmd} fails -assert_false({actual} [, {msg}]) none assert {actual} is false +assert_equal({exp}, {act} [, {msg}]) + none assert {exp} is equal to {act} +assert_exception({error} [, {msg}]) + none assert {error} is in v:exception +assert_fails({cmd} [, {error}]) none assert {cmd} fails +assert_false({actual} [, {msg}]) + none assert {actual} is false assert_inrange({lower}, {upper}, {actual} [, {msg}]) - none assert {actual} is inside the range -assert_match( {pat}, {text} [, {msg}]) none assert {pat} matches {text} -assert_notequal( {exp}, {act} [, {msg}]) none assert {exp} is not equal {act} -assert_notmatch( {pat}, {text} [, {msg}]) none assert {pat} not matches {text} -assert_true({actual} [, {msg}]) none assert {actual} is true + none assert {actual} is inside the range +assert_match({pat}, {text} [, {msg}]) + none assert {pat} matches {text} +assert_notequal({exp}, {act} [, {msg}]) + none assert {exp} is not equal {act} +assert_notmatch({pat}, {text} [, {msg}]) + none assert {pat} not matches {text} +assert_report({msg}) none report a test failure +assert_true({actual} [, {msg}]) none assert {actual} is true asin({expr}) Float arc sine of {expr} atan({expr}) Float arc tangent of {expr} atan2({expr}, {expr}) Float arc tangent of {expr1} / {expr2} @@ -1963,7 +1987,7 @@ buflisted({expr}) Number |TRUE| if buffer {expr} is listed bufloaded({expr}) Number |TRUE| if buffer {expr} is loaded bufname({expr}) String Name of the buffer {expr} bufnr({expr} [, {create}]) Number Number of the buffer {expr} -bufwinid({expr}) Number window ID of buffer {expr} +bufwinid({expr}) Number |window-ID| of buffer {expr} bufwinnr({expr}) Number window number of buffer {expr} byte2line({byte}) Number line number at byte count {byte} byteidx({expr}, {nr}) Number byte index of {nr}'th char in {expr} @@ -1972,6 +1996,8 @@ call({func}, {arglist} [, {dict}]) any call {func} with arguments {arglist} ceil({expr}) Float round {expr} up changenr() Number current change number +chanclose({id}[, {stream}]) Number Closes a channel or one of its streams +chansend({id}, {data}) Number Writes {data} to channel char2nr({expr}[, {utf8}]) Number ASCII/UTF8 value of first char in {expr} cindent({lnum}) Number C indent for line {lnum} clearmatches() none clear all matches @@ -1986,7 +2012,7 @@ cos({expr}) Float cosine of {expr} cosh({expr}) Float hyperbolic cosine of {expr} count({list}, {expr} [, {ic} [, {start}]]) Number count how many {expr} are in {list} -cscope_connection([{num} , {dbpath} [, {prepend}]]) +cscope_connection([{num}, {dbpath} [, {prepend}]]) Number checks existence of cscope connection cursor({lnum}, {col} [, {off}]) Number move cursor to {lnum}, {col}, {off} @@ -2016,11 +2042,11 @@ expand({expr} [, {nosuf} [, {list}]]) feedkeys({string} [, {mode}]) Number add key sequence to typeahead buffer filereadable({file}) Number |TRUE| if {file} is a readable file filewritable({file}) Number |TRUE| if {file} is a writable file -filter({expr}, {string}) List/Dict remove items from {expr} where - {string} is 0 -finddir({name}[, {path}[, {count}]]) +filter({expr1}, {expr2}) List/Dict remove items from {expr1} where + {expr2} is 0 +finddir({name} [, {path} [, {count}]]) String find directory {name} in {path} -findfile({name}[, {path}[, {count}]]) +findfile({name} [, {path} [, {count}]]) String find file {name} in {path} float2nr({expr}) Number convert Float {expr} to a Number floor({expr}) Float round {expr} down @@ -2041,7 +2067,7 @@ garbagecollect([{atexit}]) none free memory, breaking cyclic references get({list}, {idx} [, {def}]) any get item {idx} from {list} or {def} get({dict}, {key} [, {def}]) any get item {key} from {dict} or {def} get({func}, {what}) any get property of funcref/partial {func} -getbufinfo( [{expr}]) List information about buffers +getbufinfo([{expr}]) List information about buffers getbufline({expr}, {lnum} [, {end}]) List lines {lnum} to {end} of buffer {expr} getbufvar({expr}, {varname} [, {def}]) @@ -2064,7 +2090,7 @@ getftime({fname}) Number last modification time of file getftype({fname}) String description of type of file {fname} getline({lnum}) String line {lnum} of current buffer getline({lnum}, {end}) List lines {lnum} to {end} of current buffer -getloclist({nr}[, {what}]) List list of location list items +getloclist({nr} [, {what}]) List list of location list items getmatches() List list of current matches getpid() Number process ID of Vim getpos({expr}) List position of cursor, mark, etc. @@ -2106,7 +2132,8 @@ index({list}, {expr} [, {start} [, {ic}]]) Number index in {list} where {expr} appears input({prompt} [, {text} [, {completion}]]) String get input from the user -inputdialog({p} [, {t} [, {c}]]) String like input() but in a GUI dialog +inputdialog({prompt} [, {text} [, {completion}]]) + String like input() but in a GUI dialog inputlist({textlist}) Number let the user pick from a choice list inputrestore() Number restore typeahead inputsave() Number save and clear typeahead @@ -2119,13 +2146,11 @@ isdirectory({directory}) Number |TRUE| if {directory} is a directory islocked({expr}) Number |TRUE| if {expr} is locked id({expr}) String identifier of the container items({dict}) List key-value pairs in {dict} -jobclose({job}[, {stream}]) Number Closes a job stream(s) -jobpid({job}) Number Returns pid of a job. -jobresize({job}, {width}, {height}) - Number Resize {job}'s pseudo terminal window -jobsend({job}, {data}) Number Writes {data} to {job}'s stdin +jobpid({id}) Number Returns pid of a job. +jobresize({id}, {width}, {height}) + Number Resize pseudo terminal window of a job jobstart({cmd}[, {opts}]) Number Spawns {cmd} as a job -jobstop({job}) Number Stops a job +jobstop({id}) Number Stops a job jobwait({ids}[, {timeout}]) Number Wait for a set of jobs join({list} [, {sep}]) String join {list} items into one String json_decode({expr}) any Convert {expr} from JSON @@ -2140,7 +2165,8 @@ lispindent({lnum}) Number Lisp indent for line {lnum} localtime() Number current time log({expr}) Float natural logarithm (base e) of {expr} log10({expr}) Float logarithm of Float {expr} to base 10 -map({expr}, {string}) List/Dict change each item in {expr} to {expr} +luaeval({expr}[, {expr}]) any evaluate Lua expression +map({expr1}, {expr2}) List/Dict change each item in {expr1} to {expr} maparg({name}[, {mode} [, {abbr} [, {dict}]]]) String or Dict rhs of mapping {name} in mode {mode} @@ -2162,8 +2188,8 @@ matchstr({expr}, {pat}[, {start}[, {count}]]) String {count}'th match of {pat} in {expr} matchstrpos({expr}, {pat}[, {start}[, {count}]]) List {count}'th match of {pat} in {expr} -max({list}) Number maximum value of items in {list} -min({list}) Number minimum value of items in {list} +max({expr}) Number maximum value of items in {expr} +min({expr}) Number minimum value of items in {expr} mkdir({name} [, {path} [, {prot}]]) Number create directory {name} mode([expr]) String current editing mode @@ -2187,12 +2213,13 @@ readfile({fname} [, {binary} [, {max}]]) reltime([{start} [, {end}]]) List get time value reltimefloat({time}) Float turn the time value into a Float reltimestr({time}) String turn time value into a String -remote_expr({server}, {string} [, {idvar}]) +remote_expr({server}, {string} [, {idvar} [, {timeout}]]) String send expression remote_foreground({server}) Number bring Vim server to the foreground remote_peek({serverid} [, {retvar}]) Number check for reply string -remote_read({serverid}) String read reply string +remote_read({serverid} [, {timeout}]) + String read reply string remote_send({server}, {string} [, {idvar}]) String send key sequence remove({list}, {idx} [, {end}]) any remove items {idx}-{end} from {list} @@ -2206,7 +2233,6 @@ rpcnotify({channel}, {event}[, {args}...]) Sends an |RPC| notification to {channel} rpcrequest({channel}, {method}[, {args}...]) Sends an |RPC| request to {channel} -rpcstop({channel}) Closes an |RPC| {channel} screenattr({row}, {col}) Number attribute at screen position screenchar({row}, {col}) Number character at screen position screencol() Number current cursor column @@ -2248,6 +2274,8 @@ shiftwidth() Number effective value of 'shiftwidth' simplify({filename}) String simplify filename as much as possible sin({expr}) Float sine of {expr} sinh({expr}) Float hyperbolic sine of {expr} +sockconnect({mode}, {address} [, {opts}]) + Number Connects to socket sort({list} [, {func} [, {dict}]]) List sort {list}, using {func} to compare soundfold({word}) String sound-fold {word} @@ -2257,25 +2285,26 @@ spellsuggest({word} [, {max} [, {capital}]]) split({expr} [, {pat} [, {keepempty}]]) List make |List| from {pat} separated {expr} sqrt({expr}) Float square root of {expr} +stdioopen({dict}) Number open stdio in a headless instance. str2float({expr}) Float convert String to Float str2nr({expr} [, {base}]) Number convert String to Number strchars({expr} [, {skipcc}]) Number character length of the String {expr} -strcharpart({str}, {start}[, {len}]) +strcharpart({str}, {start} [, {len}]) String {len} characters of {str} at {start} strdisplaywidth({expr} [, {col}]) Number display length of the String {expr} -strftime({format}[, {time}]) String time in specified format +strftime({format} [, {time}]) String time in specified format strgetchar({str}, {index}) Number get char {index} from {str} -stridx({haystack}, {needle}[, {start}]) +stridx({haystack}, {needle} [, {start}]) Number index of {needle} in {haystack} string({expr}) String String representation of {expr} value strlen({expr}) Number length of the String {expr} -strpart({str}, {start}[, {len}]) +strpart({str}, {start} [, {len}]) String {len} characters of {str} at {start} strridx({haystack}, {needle} [, {start}]) Number last index of {needle} in {haystack} strtrans({expr}) String translate string to make it printable strwidth({expr}) Number display cell length of the String {expr} -submatch({nr}[, {list}]) String or List +submatch({nr} [, {list}]) String or List specific match in ":s" or substitute() substitute({expr}, {pat}, {sub}, {flags}) String all {pat} in {expr} replaced with {sub} @@ -2291,15 +2320,18 @@ tabpagebuflist([{arg}]) List list of buffer numbers in tab page tabpagenr([{arg}]) Number number of current or last tab page tabpagewinnr({tabarg}[, {arg}]) Number number of current window in tab page -taglist({expr}) List list of tags matching {expr} +taglist({expr}[, {filename}]) List list of tags matching {expr} tagfiles() List tags files used tan({expr}) Float tangent of {expr} tanh({expr}) Float hyperbolic tangent of {expr} tempname() String name for a temporary file test_garbagecollect_now() none free memory right now for testing +timer_info([{id}]) List information about timers +timer_pause({id}, {pause}) none pause or unpause a timer timer_start({time}, {callback} [, {options}]) Number create a timer timer_stop({timer}) none stop a timer +timer_stopall() none stop all timers tolower({expr}) String the String {expr} switched to lowercase toupper({expr}) String the String {expr} switched to uppercase tr({src}, {fromstr}, {tostr}) String translate chars of {src} in {fromstr} @@ -2315,10 +2347,10 @@ virtcol({expr}) Number screen column of cursor or mark visualmode([expr]) String last visual mode used wildmenumode() Number whether 'wildmenu' mode is active win_findbuf({bufnr}) List find windows containing {bufnr} -win_getid([{win} [, {tab}]]) Number get window ID for {win} in {tab} -win_gotoid({expr}) Number go to window with ID {expr} -win_id2tabwin({expr}) List get tab and window nr from window ID -win_id2win({expr}) Number get window nr from window ID +win_getid([{win} [, {tab}]]) Number get |window-ID| for {win} in {tab} +win_gotoid({expr}) Number go to |window-ID| {expr} +win_id2tabwin({expr}) List get tab and window nr from |window-ID| +win_id2win({expr}) Number get window nr from |window-ID| winbufnr({nr}) Number buffer number of window {nr} wincol() Number window column of the cursor winheight({nr}) Number height of window {nr} @@ -2409,7 +2441,7 @@ arglistid([{winnr} [, {tabnr}]]) With {winnr} only use this window in the current tab page. With {winnr} and {tabnr} use the window in the specified tab page. - {winnr} can be the window number or the window ID. + {winnr} can be the window number or the |window-ID|. *argv()* argv([{nr}]) The result is the {nr}th file in the argument list of the @@ -2455,7 +2487,7 @@ assert_exception({error} [, {msg}]) *assert_exception()* assert_fails({cmd} [, {error}]) *assert_fails()* Run {cmd} and add an error message to |v:errors| if it does NOT produce an error. - When {error} is given it must match |v:errmsg|. + When {error} is given it must match in |v:errmsg|. assert_false({actual} [, {msg}]) *assert_false()* When {actual} is not false an error message is added to @@ -2503,6 +2535,9 @@ assert_notmatch({pattern}, {actual} [, {msg}]) The opposite of `assert_match()`: add an error message to |v:errors| when {pattern} matches {actual}. +assert_report({msg}) *assert_report()* + Report a test failure directly, using {msg}. + assert_true({actual} [, {msg}]) *assert_true()* When {actual} is not true an error message is added to |v:errors|, like with |assert_equal()|. @@ -2644,7 +2679,7 @@ bufnr({expr} [, {create}]) them. Use bufexists() to test for the existence of a buffer. bufwinid({expr}) *bufwinid()* - The result is a Number, which is the window ID of the first + The result is a Number, which is the |window-ID| of the first window associated with buffer {expr}. For the use of {expr}, see |bufname()| above. If buffer {expr} doesn't exist or there is no such window, -1 is returned. Example: > @@ -2735,7 +2770,36 @@ changenr() *changenr()* redo it is the number of the redone change. After undo it is one less than the number of the undone change. -char2nr({expr}[, {utf8}]) *char2nr()* +chanclose({id}[, {stream}]) {Nvim} *chanclose()* + Close a channel or a specific stream associated with it. + For a job, {stream} can be one of "stdin", "stdout", + "stderr" or "rpc" (closes stdin/stdout for a job started + with `"rpc":v:true`) If {stream} is omitted, all streams + are closed. If the channel is a pty, this will then close the + pty master, sending SIGHUP to the job process. + For a socket, there is only one stream, and {stream} should be + ommited. + +chansend({id}, {data}) {Nvim} *chansend()* + Send data to channel {id}. For a job, it writes it to the + stdin of the process. For the stdio channel |channel-stdio|, + it writes to Nvim's stdout. Returns the number of bytes + written if the write succeeded, 0 otherwise. + See |channel-bytes| for more information. + + {data} may be a string, string convertible, or a list. If + {data} is a list, the items will be joined by newlines; any + newlines in an item will be sent as NUL. To send a final + newline, include a final empty string. Example: > + :call chansend(id, ["abc", "123\n456", ""]) +< will send "abc123456". + + chansend() writes raw data, not RPC messages. If the channel + was created with `"rpc":v:true` then the channel expects RPC + messages, use |rpcnotify()| and |rpcrequest()| instead. + + +char2nr({expr} [, {utf8}]) *char2nr()* Return number value of the first char in {expr}. Examples: > char2nr(" ") returns 32 char2nr("ABC") returns 65 @@ -2847,8 +2911,6 @@ confirm({msg} [, {choices} [, {default} [, {type}]]]) Confirm() offers the user a dialog, from which a choice can be made. It returns the number of the choice. For the first choice this is 1. - Note: confirm() is only supported when compiled with dialog - support, see |+dialog_con| and |+dialog_gui|. {msg} is displayed in a |dialog| with {choices} as the alternatives. When {choices} is missing or empty, "&OK" is @@ -3034,6 +3096,8 @@ delete({fname} [, {flags}]) *delete()* When {flags} is "rf": Deletes the directory by the name {fname} and everything in it, recursively. BE CAREFUL! + Note: on MS-Windows it is not possible to delete a directory + that is being used. The result is a Number, which is 0 if the delete operation was successful and -1 when the deletion failed or partly failed. @@ -3088,6 +3152,7 @@ did_filetype() Returns |TRUE| when autocommands are being executed and the FileType event has been triggered at least once. Can be used to avoid triggering the FileType event again in the scripts that detect the file type. |FileType| + Returns |FALSE| when `:setf FALLBACK` was used. When editing another file, the counter is reset, thus this really checks if the FileType event has been triggered for the current buffer. This allows an autocommand that starts @@ -3179,7 +3244,7 @@ execute({command} [, {silent}]) *execute()* "" no `:silent` used "silent" `:silent` used "silent!" `:silent!` used - The default is 'silent'. Note that with "silent!", unlike + The default is "silent". Note that with "silent!", unlike `:redir`, error messages are dropped. To get a list of lines use |split()| on the result: > @@ -3198,8 +3263,12 @@ exepath({expr}) *exepath()* *exists()* exists({expr}) The result is a Number, which is |TRUE| if {expr} is - defined, zero otherwise. The {expr} argument is a string, - which contains one of these: + defined, zero otherwise. + + For checking for a supported feature use |has()|. + For checking if a file exists use |filereadable()|. + + The {expr} argument is a string, which contains one of these: &option-name Vim option (only checks if it exists, not if it really works) +option-name Vim option that works. @@ -3247,7 +3316,6 @@ exists({expr}) The result is a Number, which is |TRUE| if {expr} is event and pattern. ##event autocommand for this event is supported. - For checking for a supported feature use |has()|. Examples: > exists("&mouse") @@ -3465,9 +3533,10 @@ filter({expr1}, {expr2}) *filter()* is zero remove the item from the |List| or |Dictionary|. {expr2} must be a |string| or |Funcref|. - if {expr2} is a |string|, inside {expr2} |v:val| has the value + If {expr2} is a |string|, inside {expr2} |v:val| has the value of the current item. For a |Dictionary| |v:key| has the key - of the current item. + of the current item and for a |List| |v:key| has the index of + the current item. For a |Dictionary| |v:key| has the key of the current item. Examples: > call filter(mylist, 'v:val !~ "OLD"') @@ -3490,6 +3559,10 @@ filter({expr1}, {expr2}) *filter()* return a:idx % 2 == 1 endfunc call filter(mylist, function('Odd')) +< It is shorter when using a |lambda|: > + call filter(myList, {idx, val -> idx * val <= 42}) +< If you do not use "val" you can leave it out: > + call filter(myList, {idx -> idx % 2 == 1}) < The operation is done in-place. If you want a |List| or |Dictionary| to remain unmodified make a copy first: > @@ -3502,7 +3575,7 @@ filter({expr1}, {expr2}) *filter()* defined with the "abort" flag. -finddir({name}[, {path}[, {count}]]) *finddir()* +finddir({name} [, {path} [, {count}]]) *finddir()* Find directory {name} in {path}. Supports both downwards and upwards recursive directory searches. See |file-searching| for the syntax of {path}. @@ -3517,7 +3590,7 @@ finddir({name}[, {path}[, {count}]]) *finddir()* {only available when compiled with the |+file_in_path| feature} -findfile({name}[, {path}[, {count}]]) *findfile()* +findfile({name} [, {path} [, {count}]]) *findfile()* Just like |finddir()|, but find a file instead of a directory. Uses 'suffixesadd'. Example: > @@ -3530,17 +3603,19 @@ float2nr({expr}) *float2nr()* decimal point. {expr} must evaluate to a |Float| or a Number. When the value of {expr} is out of range for a |Number| the - result is truncated to 0x7fffffff or -0x7fffffff. NaN results - in -0x80000000. + result is truncated to 0x7fffffff or -0x7fffffff (or when + 64-bit Number support is enabled, 0x7fffffffffffffff or + -0x7fffffffffffffff. NaN results in -0x80000000 (or when + 64-bit Number support is enabled, -0x8000000000000000). Examples: > echo float2nr(3.95) < 3 > echo float2nr(-23.45) < -23 > echo float2nr(1.0e100) -< 2147483647 > +< 2147483647 (or 9223372036854775807) > echo float2nr(-1.0e150) -< -2147483647 > +< -2147483647 (or -9223372036854775807) > echo float2nr(1.0e-100) < 0 @@ -3626,11 +3701,14 @@ foldtext() Returns a String, to be displayed for a closed fold. This is |v:foldstart|, |v:foldend| and |v:folddashes| variables. The returned string looks like this: > +-- 45 lines: abcdef -< The number of dashes depends on the foldlevel. The "45" is - the number of lines in the fold. "abcdef" is the text in the - first non-blank line of the fold. Leading white space, "//" - or "/*" and the text from the 'foldmarker' and 'commentstring' - options is removed. +< The number of leading dashes depends on the foldlevel. The + "45" is the number of lines in the fold. "abcdef" is the text + in the first non-blank line of the fold. Leading white space, + "//" or "/*" and the text from the 'foldmarker' and + 'commentstring' options is removed. + When used to draw the actual foldtext, the rest of the line + will be filled with the fold char from the 'fillchars' + setting. {not available when compiled without the |+folding| feature} foldtextresult({lnum}) *foldtextresult()* @@ -3679,7 +3757,7 @@ function({name} [, {arglist}] [, {dict}]) When {arglist} or {dict} is present this creates a partial. That mans the argument list and/or the dictionary is stored in the Funcref and will be used when the Funcref is called. - + The arguments are passed to the function in front of other arguments. Example: > func Callback(arg1, arg2, name) @@ -3744,10 +3822,10 @@ get({dict}, {key} [, {default}]) get({func}, {what}) Get item {what} from Funcref {func}. Possible values for {what} are: - 'name' The function name - 'func' The function - 'dict' The dictionary - 'args' The list with arguments + "name" The function name + "func" The function + "dict" The dictionary + "args" The list with arguments *getbufinfo()* getbufinfo([{expr}]) @@ -3998,6 +4076,7 @@ getcompletion({pat}, {type} [, {filtered}]) *getcompletion()* augroup autocmd groups buffer buffer names behave :behave suboptions + cmdline |cmdline-completion| color color schemes command Ex command (and arguments) compiler compilers @@ -4016,7 +4095,9 @@ getcompletion({pat}, {type} [, {filtered}]) *getcompletion()* locale locale names (as output of locale -a) mapping mapping name menu menus + messages |:messages| suboptions option options + packadd optional package |pack-add| names shellcmd Shell command sign |:sign| suboptions syntax syntax file names |'syntax'| @@ -4026,7 +4107,7 @@ getcompletion({pat}, {type} [, {filtered}]) *getcompletion()* user user names var user variables - If {pat} is an empty string, then all the matches are returned. + If {pat} is an empty string then all matches are returned. Otherwise only items matching {pat} are returned. See |wildcards| for the use of special characters in {pat}. @@ -4041,13 +4122,16 @@ getcompletion({pat}, {type} [, {filtered}]) *getcompletion()* getcurpos() Get the position of the cursor. This is like getpos('.'), but includes an extra item in the list: [bufnum, lnum, col, off, curswant] ~ - The "curswant" number is the preferred column when moving the - cursor vertically. - This can be used to save and restore the cursor position: > - let save_cursor = getcurpos() - MoveTheCursorAround - call setpos('.', save_cursor) -< + The "curswant" number is the preferred column when moving the + cursor vertically. Also see |getpos()|. + + This can be used to save and restore the cursor position: > + let save_cursor = getcurpos() + MoveTheCursorAround + call setpos('.', save_cursor) +< Note that this only works within the window. See + |winrestview()| for restoring more state. + getcwd([{winnr}[, {tabnr}]]) *getcwd()* With no arguments the result is a String, which is the name of the current effective working directory. With {winnr} or @@ -4059,7 +4143,7 @@ getcwd([{winnr}[, {tabnr}]]) *getcwd()* getcwd(0) getcwd(0, 0) < If {winnr} is -1 it is ignored, only the tab is resolved. - {winnr} can be the window number or the window ID. + {winnr} can be the window number or the |window-ID|. getfsize({fname}) *getfsize()* @@ -4154,7 +4238,7 @@ getline({lnum} [, {end}]) getloclist({nr},[, {what}]) *getloclist()* Returns a list with all the entries in the location list for - window {nr}. {nr} can be the window number or the window ID. + window {nr}. {nr} can be the window number or the |window-ID|. When {nr} is zero the current window is used. For a location list window, the displayed location list is @@ -4229,7 +4313,7 @@ getqflist([{what}]) *getqflist()* type type of the error, 'E', '1', etc. valid |TRUE|: recognized error message - When there is no error list or it's empty an empty list is + When there is no error list or it's empty, an empty list is returned. Quickfix list entries with non-existing buffer number are returned with "bufnr" set to zero. @@ -4243,9 +4327,10 @@ getqflist([{what}]) *getqflist()* If the optional {what} dictionary argument is supplied, then returns only the items listed in {what} as a dictionary. The following string items are supported in {what}: - nr get information for this quickfix list - title get list title - winid get window id (if opened) + nr get information for this quickfix list; zero + means the current quickfix list + title get the list title + winid get the |window-ID| (if opened) all all of the above quickfix properties Non-string items in {what} are ignored. If "nr" is not present then the current quickfix list is used. @@ -4255,7 +4340,7 @@ getqflist([{what}]) *getqflist()* The returned dictionary contains the following entries: nr quickfix list number title quickfix list title text - winid quickfix window id (if opened) + winid quickfix |window-ID| (if opened) Examples: > :echo getqflist({'all': 1}) @@ -4266,7 +4351,7 @@ getreg([{regname} [, 1 [, {list}]]]) *getreg()* The result is a String, which is the contents of register {regname}. Example: > :let cliptext = getreg('*') -< When {regname} was not set the result is a empty string. +< When {regname} was not set the result is an empty string. getreg('=') returns the last evaluated value of the expression register. (For use in maps.) @@ -4302,10 +4387,10 @@ gettabinfo([{arg}]) *gettabinfo()* empty List is returned. Each List item is a Dictionary with the following entries: - nr tab page number. + tabnr tab page number. variables a reference to the dictionary with tabpage-local variables - windows List of window IDs in the tag page. + windows List of |window-ID|s in the tag page. gettabvar({tabnr}, {varname} [, {def}]) *gettabvar()* Get the value of a tab-local variable {varname} in tab page @@ -4329,7 +4414,7 @@ gettabwinvar({tabnr}, {winnr}, {varname} [, {def}]) *gettabwinvar()* Note that {varname} must be the name without "w:". Tabs are numbered starting with one. For the current tabpage use |getwinvar()|. - {winnr} can be the window number or the window ID. + {winnr} can be the window number or the |window-ID|. When {winnr} is zero the current window is used. This also works for a global option, buffer-local option and window-local option, but it doesn't work for a global variable @@ -4344,11 +4429,13 @@ gettabwinvar({tabnr}, {winnr}, {varname} [, {def}]) *gettabwinvar()* getwinposx() The result is a Number, which is the X coordinate in pixels of the left hand side of the GUI Vim window. The result will be -1 if the information is not available. + The value can be used with `:winpos`. *getwinposy()* getwinposy() The result is a Number, which is the Y coordinate in pixels of the top of the GUI Vim window. The result will be -1 if the information is not available. + The value can be used with `:winpos`. getwininfo([{winid}]) *getwininfo()* Returns information about windows as a List with Dictionaries. @@ -4357,20 +4444,22 @@ getwininfo([{winid}]) *getwininfo()* is returned. If the window does not exist the result is an empty list. - Without an information about all the windows in all the tab - pages is returned. + Without {winid} information about all the windows in all the + tab pages is returned. Each List item is a Dictionary with the following entries: - bufnum number of buffer in the window - height window height + bufnr number of buffer in the window + height window height (excluding winbar) + winbar 1 if the window has a toolbar, 0 + otherwise loclist 1 if showing a location list - nr window number quickfix 1 if quickfix or location list window - tpnr tab page number + tabnr tab page number variables a reference to the dictionary with window-local variables width window width - winid window ID + winid |window-ID| + winnr window number To obtain all window-local variables use: > gettabwinvar({tabnr}, {winnr}, '&') @@ -4474,9 +4563,8 @@ has_key({dict}, {key}) *has_key()* an entry with key {key}. Zero otherwise. haslocaldir([{winnr}[, {tabnr}]]) *haslocaldir()* - The result is a Number, which is 1 when the specified tabpage - or window has a local path set via |:lcd| or |:tcd|, and - 0 otherwise. + The result is a Number, which is 1 when the tabpage or window + has set a local path via |:tcd| or |:lcd|, otherwise 0. Tabs and windows are identified by their respective numbers, 0 means current tab or window. Missing argument implies 0. @@ -4484,7 +4572,9 @@ haslocaldir([{winnr}[, {tabnr}]]) *haslocaldir()* haslocaldir() haslocaldir(0) haslocaldir(0, 0) -< {winnr} can be the window number or the window ID. +< With {winnr} use that window in the current tabpage. + With {winnr} and {tabnr} use the window in that tabpage. + {winnr} can be the window number or the |window-ID|. If {winnr} is -1 it is ignored, only the tab is resolved. hasmapto({what} [, {mode} [, {abbr}]]) *hasmapto()* @@ -4523,6 +4613,7 @@ histadd({history}, {item}) *histadd()* "expr" or "=" typed expression history "input" or "@" input line history "debug" or ">" debug command history + empty the current or last used history The {history} string does not need to be the whole name, one character is sufficient. If {item} does already exist in the history, it will be @@ -4652,10 +4743,24 @@ index({list}, {expr} [, {start} [, {ic}]]) *index()* input({prompt} [, {text} [, {completion}]]) *input()* +input({opts}) The result is a String, which is whatever the user typed on the command-line. The {prompt} argument is either a prompt string, or a blank string (for no prompt). A '\n' can be used in the prompt to start a new line. + + In the second form it accepts a single dictionary with the + following keys, any of which may be omitted: + + Key Default Description ~ + prompt "" Same as {prompt} in the first form. + default "" Same as {text} in the first form. + completion nothing Same as {completion} in the first form. + cancelreturn "" Same as {cancelreturn} from + |inputdialog()|. Also works with + input(). + highlight nothing Highlight handler: |Funcref|. + The highlighting set with |:echohl| is used for the prompt. The input is entered just like a command-line, with the same editing commands and mappings. There is a separate history @@ -4677,7 +4782,60 @@ input({prompt} [, {text} [, {completion}]]) *input()* "-complete=" argument. Refer to |:command-completion| for more information. Example: > let fname = input("File: ", "", "file") + +< *input()-highlight* *E5400* *E5402* + The optional `highlight` key allows specifying function which + will be used for highlighting user input. This function + receives user input as its only argument and must return + a list of 3-tuples [hl_start_col, hl_end_col + 1, hl_group] + where + hl_start_col is the first highlighted column, + hl_end_col is the last highlighted column (+ 1!), + hl_group is |:hl| group used for highlighting. + *E5403* *E5404* *E5405* *E5406* + Both hl_start_col and hl_end_col + 1 must point to the start + of the multibyte character (highlighting must not break + multibyte characters), hl_end_col + 1 may be equal to the + input length. Start column must be in range [0, len(input)), + end column must be in range (hl_start_col, len(input)], + sections must be ordered so that next hl_start_col is greater + then or equal to previous hl_end_col. + + Example (try some input with parentheses): > + highlight RBP1 guibg=Red ctermbg=red + highlight RBP2 guibg=Yellow ctermbg=yellow + highlight RBP3 guibg=Green ctermbg=green + highlight RBP4 guibg=Blue ctermbg=blue + let g:rainbow_levels = 4 + function! RainbowParens(cmdline) + let ret = [] + let i = 0 + let lvl = 0 + while i < len(a:cmdline) + if a:cmdline[i] is# '(' + call add(ret, [i, i + 1, 'RBP' . ((lvl % g:rainbow_levels) + 1)]) + let lvl += 1 + elseif a:cmdline[i] is# ')' + let lvl -= 1 + call add(ret, [i, i + 1, 'RBP' . ((lvl % g:rainbow_levels) + 1)]) + endif + let i += 1 + endwhile + return ret + endfunction + call input({'prompt':'>','highlight':'RainbowParens'}) < + Highlight function is called at least once for each new + displayed input string, before command-line is redrawn. It is + expected that function is pure for the duration of one input() + call, i.e. it produces the same output for the same input, so + output may be memoized. Function is run like under |:silent| + modifier. If the function causes any errors, it will be + skipped for the duration of the current input() call. + + Currently coloring is disabled when command-line contains + arabic characters. + NOTE: This function must not be used in a startup file, for the versions that only run in GUI mode (e.g., the Win32 GUI). Note: When input() is called from within a mapping it will @@ -4697,6 +4855,7 @@ input({prompt} [, {text} [, {completion}]]) *input()* :endfunction inputdialog({prompt} [, {text} [, {cancelreturn}]]) *inputdialog()* +inputdialog({opts}) Like |input()|, but when the GUI is running and text dialogs are supported, a dialog window pops up to input the text. Example: > @@ -4708,7 +4867,6 @@ inputdialog({prompt} [, {text} [, {cancelreturn}]]) *inputdialog()* omitted an empty string is returned. Hitting works like pressing the OK button. Hitting works like pressing the Cancel button. - NOTE: Command-line completion is not supported. inputlist({textlist}) *inputlist()* {textlist} must be a |List| of strings. This |List| is @@ -4811,64 +4969,58 @@ items({dict}) *items()* entry and the value of this entry. The |List| is in arbitrary order. -jobclose({job}[, {stream}]) {Nvim} *jobclose()* - Close {job}'s {stream}, which can be one of "stdin", "stdout", - "stderr" or "rpc" (closes the rpc channel for a job started - with the "rpc" option.) If {stream} is omitted, all streams - are closed. If the job is a pty job, this will then close the - pty master, sending SIGHUP to the job process. -jobpid({job}) {Nvim} *jobpid()* - Return the pid (process id) of {job}. +jobpid({job}) *jobpid()* + Return the PID (process id) of |job-id| {job}. -jobresize({job}, {width}, {height}) {Nvim} *jobresize()* - Resize {job}'s pseudo terminal window to {width} and {height}. - This function will fail if used on jobs started without the - "pty" option. +jobresize({job}, {width}, {height}) *jobresize()* + Resize the pseudo terminal window of |job-id| {job} to {width} + columns and {height} rows. + Fails if the job was not started with `"pty":v:true`. -jobsend({job}, {data}) {Nvim} *jobsend()* - Send data to {job} by writing it to the stdin of the process. - Returns 1 if the write succeeded, 0 otherwise. - See |job-control| for more information. - - {data} may be a string, string convertible, or a list. If - {data} is a list, the items will be separated by newlines and - any newlines in an item will be sent as a NUL. A final newline - can be sent by adding a final empty string. For example: > - :call jobsend(j, ["abc", "123\n456", ""]) -< will send "abc123456". - - If the job was started with the rpc option this function - cannot be used, instead use |rpcnotify()| and |rpcrequest()| - to communicate with the job. - -jobstart({cmd}[, {opts}]) {Nvim} *jobstart()* - Spawns {cmd} as a job. If {cmd} is a |List| it is run - directly. If {cmd} is a |String| it is processed like this: > +jobstart({cmd}[, {opts}]) *jobstart()* + Spawns {cmd} as a job. + If {cmd} is a List it runs directly (no 'shell'). + If {cmd} is a String it runs in the 'shell', like this: > :call jobstart(split(&shell) + split(&shellcmdflag) + ['{cmd}']) -< NOTE: This only shows the idea; see |shell-unquoting| before - constructing lists with 'shell' or 'shellcmdflag'. +< (See |shell-unquoting| for details.) - NOTE: On Windows if {cmd} is a List, cmd[0] must be a valid - executable (.exe, .com). If the executable is in $PATH it can - be called by name, with or without an extension: > - :call jobstart(['ping', 'neovim.io']) -< If it is a path (not a name), it must include the extension: > - :call jobstart(['System32\ping.exe', 'neovim.io']) -< + Returns |job-id| on success, 0 on invalid arguments (or job + table is full), -1 if {cmd}[0] or 'shell' is not executable. + For communication over the job's stdio, it is represented as a + |channel|, and a channel ID is returned on success. Use + |chansend()| (or |rpcnotify()| and |rpcrequest()| if "rpc" option + was used) to send data to stdin and |chanclose()| to close stdio + streams without stopping the job explicitly. + + See |job-control| and |rpc|. + + NOTE: on Windows if {cmd} is a List: + - cmd[0] must be an executable (not a "built-in"). If it is + in $PATH it can be called by name, without an extension: > + :call jobstart(['ping', 'neovim.io']) +< If it is a full or partial path, extension is required: > + :call jobstart(['System32\ping.exe', 'neovim.io']) +< - {cmd} is collapsed to a string of quoted args as expected + by CommandLineToArgvW https://msdn.microsoft.com/bb776391 + unless cmd[0] is some form of "cmd.exe". + + *jobstart-options* {opts} is a dictionary with these keys: - on_stdout: stdout event handler (function name or |Funcref|) - on_stderr: stderr event handler (function name or |Funcref|) - on_exit : exit event handler (function name or |Funcref|) + |on_stdout|: stdout event handler (function name or |Funcref|) + stdout_buffered : read stdout in |buffered| mode. + |on_stderr|: stderr event handler (function name or |Funcref|) + stderr_buffered : read stderr in |buffered| mode. + |on_exit| : exit event handler (function name or |Funcref|) cwd : Working directory of the job; defaults to |current-directory|. rpc : If set, |msgpack-rpc| will be used to communicate with the job over stdin and stdout. "on_stdout" is then ignored, but "on_stderr" can still be used. pty : If set, the job will be connected to a new pseudo - terminal, and the job streams are connected to - the master file descriptor. "on_stderr" is ignored - as all output will be received on stdout. + terminal and the job streams are connected to the + master file descriptor. "on_stderr" is ignored, + "on_stdout" receives all output. width : (pty only) Width of the terminal screen height : (pty only) Height of the terminal screen @@ -4876,43 +5028,36 @@ jobstart({cmd}[, {opts}]) {Nvim} *jobstart()* detach : (non-pty only) Detach the job process from the nvim process. The process will not get killed when nvim exits. If the process dies before - nvim exits, on_exit will still be invoked. + nvim exits, "on_exit" will still be invoked. - {opts} is passed as |self| to the callback; the caller may - pass arbitrary data by setting other keys. + {opts} is passed as |self| dictionary to the callback; the + caller may set other keys to pass application-specific data. Returns: - - The job ID on success, which is used by |jobsend()| (or - |rpcnotify()| and |rpcrequest()| if "rpc" option was used) - and |jobstop()| - - 0 on invalid arguments or if the job table is full + - The channel ID on success + - 0 on invalid arguments - -1 if {cmd}[0] is not executable. - See |job-control| and |msgpack-rpc| for more information. + See |job-control|, |channels|, and |msgpack-rpc| for more information. -jobstop({job}) {Nvim} *jobstop()* - Stop a job created with |jobstart()| by sending a `SIGTERM` - to the corresponding process. If the process doesn't exit - cleanly soon, a `SIGKILL` will be sent. When the job is - finally closed, the exit handler provided to |jobstart()| or - |termopen()| will be run. - See |job-control| for more information. +jobstop({id}) *jobstop()* + Stop |job-id| {id} by sending SIGTERM to the job process. If + the process does not terminate after a timeout then SIGKILL + will be sent. When the job terminates its |on_exit| handler + (if any) will be invoked. + See |job-control|. -jobwait({ids}[, {timeout}]) {Nvim} *jobwait()* +jobwait({ids}[, {timeout}]) *jobwait()* Wait for a set of jobs to finish. The {ids} argument is a list - of ids for jobs that will be waited for. If passed, {timeout} - is the maximum number of milliseconds to wait. While this - function is executing, callbacks for jobs not in the {ids} - list can be executed. Also, the screen wont be updated unless - |:redraw| is invoked by one of the callbacks. + of |job-id|s to wait for. {timeout} is the maximum number of + milliseconds to wait. During jobwait(), callbacks for jobs not + in the {ids} list may be invoked. The screen will not redraw + unless |:redraw| is invoked by a callback. - Returns a list of integers with the same length as {ids}, with - each integer representing the wait result for the - corresponding job id. The possible values for the resulting - integers are: - - * the job return code if the job exited - * -1 if the wait timed out for the job - * -2 if the job was interrupted - * -3 if the job id is invalid. + Returns a list of len({ids}) integers, where each integer is + the wait-result of the corresponding job. Each wait-result is: + Job exit-code, if the job exited + -1 if the wait timed out for the job + -2 if the job was interrupted + -3 if the |job-id| is invalid. join({list} [, {sep}]) *join()* Join the items in {list} together into one String. @@ -4943,8 +5088,8 @@ json_decode({expr}) *json_decode()* json_encode({expr}) *json_encode()* Convert {expr} into a JSON string. Accepts - |msgpack-special-dict| as the input. Will not convert |Funcref|s, - mappings with non-string keys (can be created as + |msgpack-special-dict| as the input. Will not convert + |Funcref|s, mappings with non-string keys (can be created as |msgpack-special-dict|), values with self-referencing containers, strings which contain non-UTF-8 characters, pseudo-UTF-8 strings which contain codepoints reserved for @@ -5047,7 +5192,10 @@ line({expr}) The result is a Number, which is the line number of the file < *last-position-jump* This autocommand jumps to the last known position in a file just after opening it, if the '" mark is set: > - :au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g`\"" | endif + :au BufReadPost * + \ if line("'\"") > 1 && line("'\"") <= line("$") && &ft !~# 'commit' + \ | exe "normal! g`\"" + \ | endif line2byte({lnum}) *line2byte()* Return the byte count from the start of the buffer for line @@ -5095,6 +5243,9 @@ log10({expr}) *log10()* :echo log10(0.01) < -2.0 +luaeval({expr}[, {expr}]) + Evaluate Lua expression {expr} and return its result converted + to Vim data structures. See |lua-luaeval| for more details. map({expr1}, {expr2}) *map()* {expr1} must be a |List| or a |Dictionary|. @@ -5123,6 +5274,10 @@ map({expr1}, {expr2}) *map()* return a:key . '-' . a:val endfunc call map(myDict, function('KeyValue')) +< It is shorter when using a |lambda|: > + call map(myDict, {key, val -> key . '-' . val}) +< If you do not use "val" you can leave it out: > + call map(myDict, {key -> 'item: ' . key}) < The operation is done in-place. If you want a |List| or |Dictionary| to remain unmodified make a copy first: > @@ -5135,12 +5290,12 @@ map({expr1}, {expr2}) *map()* defined with the "abort" flag. -maparg({name}[, {mode} [, {abbr} [, {dict}]]]) *maparg()* +maparg({name} [, {mode} [, {abbr} [, {dict}]]]) *maparg()* When {dict} is omitted or zero: Return the rhs of mapping {name} in mode {mode}. The returned String has special characters translated like in the output of the ":map" command listing. - + When there is no mapping for {name}, an empty String is returned. @@ -5156,6 +5311,7 @@ maparg({name}[, {mode} [, {abbr} [, {dict}]]]) *maparg()* "s" Select "x" Visual "l" langmap |language-mapping| + "t" Terminal "" Normal, Visual and Operator-pending When {mode} is omitted, the modes for "" are used. @@ -5189,7 +5345,7 @@ maparg({name}[, {mode} [, {abbr} [, {dict}]]]) *maparg()* exe 'nnoremap ==' . maparg('', 'n') -mapcheck({name}[, {mode} [, {abbr}]]) *mapcheck()* +mapcheck({name} [, {mode} [, {abbr}]]) *mapcheck()* Check if there is a mapping that matches with {name} in mode {mode}. See |maparg()| for {mode} and special names in {name}. @@ -5221,7 +5377,7 @@ mapcheck({name}[, {mode} [, {abbr}]]) *mapcheck()* < This avoids adding the "_vv" mapping when there already is a mapping for "_v" or for "_vvv". -match({expr}, {pat}[, {start}[, {count}]]) *match()* +match({expr}, {pat} [, {start} [, {count}]]) *match()* When {expr} is a |List| then this returns the index of the first item where {pat} matches. Each item is used as a String, |Lists| and |Dictionaries| are used as echoed. @@ -5329,7 +5485,8 @@ matchadd({group}, {pattern}[, {priority}[, {id} [, {dict}]]]) available from |getmatches()|. All matches can be deleted in one operation by |clearmatches()|. -matchaddpos({group}, {pos}[, {priority}[, {id}[, {dict}]]]) *matchaddpos()* + *matchaddpos()* +matchaddpos({group}, {pos} [, {priority} [, {id} [, {dict}]]]) Same as |matchadd()|, but requires a list of positions {pos} instead of a pattern. This command is faster than |matchadd()| because it does not require to handle regular expressions and @@ -5349,7 +5506,7 @@ matchaddpos({group}, {pos}[, {priority}[, {id}[, {dict}]]]) *matchaddpos()* be highlighted. - A list with three numbers, e.g., [23, 11, 3]. As above, but the third number gives the length of the highlight in bytes. - + The maximum number of positions is 8. Example: > @@ -5382,7 +5539,7 @@ matchdelete({id}) *matchdelete()* *E802* *E803* otherwise -1. See example for |matchadd()|. All matches can be deleted in one operation by |clearmatches()|. -matchend({expr}, {pat}[, {start}[, {count}]]) *matchend()* +matchend({expr}, {pat} [, {start} [, {count}]]) *matchend()* Same as |match()|, but return the index of first character after the match. Example: > :echo matchend("testing", "ing") @@ -5401,7 +5558,7 @@ matchend({expr}, {pat}[, {start}[, {count}]]) *matchend()* < result is "-1". When {expr} is a |List| the result is equal to |match()|. -matchlist({expr}, {pat}[, {start}[, {count}]]) *matchlist()* +matchlist({expr}, {pat} [, {start} [, {count}]]) *matchlist()* Same as |match()|, but return a |List|. The first item in the list is the matched string, same as what matchstr() would return. Following items are submatches, like "\1", "\2", etc. @@ -5411,7 +5568,7 @@ matchlist({expr}, {pat}[, {start}[, {count}]]) *matchlist()* < Results in: ['acd', 'a', '', 'c', 'd', '', '', '', '', ''] When there is no match an empty list is returned. -matchstr({expr}, {pat}[, {start}[, {count}]]) *matchstr()* +matchstr({expr}, {pat} [, {start} [, {count}]]) *matchstr()* Same as |match()|, but return the matched string. Example: > :echo matchstr("testing", "ing") < results in "ing". @@ -5424,7 +5581,7 @@ matchstr({expr}, {pat}[, {start}[, {count}]]) *matchstr()* When {expr} is a |List| then the matching item is returned. The type isn't changed, it's not necessarily a String. -matchstrpos({expr}, {pat}[, {start}[, {count}]]) *matchstrpos()* +matchstrpos({expr}, {pat} [, {start} [, {count}]]) *matchstrpos()* Same as |matchstr()|, but return the matched string, the start position and the end position of the match. Example: > :echo matchstrpos("testing", "ing") @@ -5443,16 +5600,65 @@ matchstrpos({expr}, {pat}[, {start}[, {count}]]) *matchstrpos()* The type isn't changed, it's not necessarily a String. *max()* -max({list}) Return the maximum value of all items in {list}. - If {list} is not a list or one of the items in {list} cannot - be used as a Number this results in an error. - An empty |List| results in zero. +max({expr}) Return the maximum value of all items in {expr}. + {expr} can be a list or a dictionary. For a dictionary, + it returns the maximum of all values in the dictionary. + If {expr} is neither a list nor a dictionary, or one of the + items in {expr} cannot be used as a Number this results in + an error. An empty |List| or |Dictionary| results in zero. + +menu_get({path}, {modes}) *menu_get()* + Returns a |List| of |Dictionaries| describing |menus| (defined + by |:menu|, |:amenu|, etc.). + {path} limits the result to a subtree of the menu hierarchy + (empty string matches all menus). E.g. to get items in the + "File" menu subtree: > + :echo menu_get('File','') +< + {modes} is a string of zero or more modes (see |maparg()| or + |creating-menus| for the list of modes). "a" means "all". + + For example: > + nnoremenu &Test.Test inormal + inoremenu Test.Test insert + vnoremenu Test.Test x + echo menu_get("") +< + returns something like this: +> + [ { + "hidden": 0, + "name": "Test", + "priority": 500, + "shortcut": 84, + "submenus": [ { + "hidden": 0, + "mappings": { + i": { + "enabled": 1, + "noremap": 1, + "rhs": "insert", + "sid": 1, + "silent": 0 + }, + n": { ... }, + s": { ... }, + v": { ... } + }, + "name": "Test", + "priority": 500, + "shortcut": 0 + } ] + } ] +< *min()* -min({list}) Return the minimum value of all items in {list}. - If {list} is not a list or one of the items in {list} cannot - be used as a Number this results in an error. - An empty |List| results in zero. +min({expr}) Return the minimum value of all items in {expr}. + {expr} can be a list or a dictionary. For a dictionary, + it returns the minimum of all values in the dictionary. + If {expr} is neither a list nor a dictionary, or one of the + items in {expr} cannot be used as a Number this results in + an error. An empty |List| or |Dictionary| results in zero. *mkdir()* *E739* mkdir({name} [, {path} [, {prot}]]) @@ -5487,16 +5693,20 @@ mode([expr]) Return a string that indicates the current mode. S Select by line CTRL-S Select blockwise i Insert + ic Insert mode completion |compl-generic| + ix Insert mode |i_CTRL-X| completion R Replace |R| + Rc Replace mode completion |compl-generic| Rv Virtual Replace |gR| - t Terminal {Nvim} - c Command-line + Rx Replace mode |i_CTRL-X| completion + c Command-line editing cv Vim Ex mode |gQ| ce Normal Ex mode |Q| r Hit-enter prompt rm The -- more -- prompt r? A |:confirm| query of some sort ! Shell or external command is executing + t Terminal mode: keys go to the job This is useful in the 'statusline' option or when used with |remote_expr()| In most other places it always returns "c" or "n". @@ -5600,7 +5810,7 @@ nextnonblank({lnum}) *nextnonblank()* below it, zero is returned. See also |prevnonblank()|. -nr2char({expr}[, {utf8}]) *nr2char()* +nr2char({expr} [, {utf8}]) *nr2char()* Return a string with a single character, which has the number value {expr}. Examples: > nr2char(64) returns "@" @@ -5638,7 +5848,7 @@ pathshorten({expr}) *pathshorten()* components in the path are reduced to single letters. Leading '~' and '.' characters are kept. Example: > :echo pathshorten('~/.config/nvim/autoload/file1.vim') -< ~/.v/a/file1.vim ~ +< ~/.c/n/a/file1.vim ~ It doesn't matter if the path exists or not. pow({x}, {y}) *pow()* @@ -5683,11 +5893,12 @@ printf({fmt}, {expr1} ...) *printf()* %04x hex number padded with zeros to at least 4 characters %X hex number using upper case letters %o octal number - %f floating point number in the form 123.456 - %e floating point number in the form 1.234e3 - %E floating point number in the form 1.234E3 + %f floating point number as 12.23, inf, -inf or nan + %F floating point number as 12.23, INF, -INF or NAN + %e floating point number as 1.23e3, inf, -inf or nan + %E floating point number as 1.23E3, INF, -INF or NAN %g floating point number, as %f or %e depending on value - %G floating point number, as %f or %E depending on value + %G floating point number, as %F or %E depending on value %% the % character itself %p representation of the pointer to the container @@ -5798,6 +6009,9 @@ printf({fmt}, {expr1} ...) *printf()* s The text of the String argument is used. If a precision is specified, no more bytes than the number specified are used. + If the argument is not a String type, it is + automatically converted to text with the same format + as ":echo". *printf-S* S The text of the String argument is used. If a precision is specified, no more display cells than the @@ -5805,13 +6019,14 @@ printf({fmt}, {expr1} ...) *printf()* feature works just like 's'. *printf-f* *E807* - f F The Float argument is converted into a string of the + f F The Float argument is converted into a string of the form 123.456. The precision specifies the number of digits after the decimal point. When the precision is zero the decimal point is omitted. When the precision is not specified 6 is used. A really big number - (out of range or dividing by zero) results in "inf". - "0.0 / 0.0" results in "nan". + (out of range or dividing by zero) results in "inf" + or "-inf" with %f (INF or -INF with %F). + "0.0 / 0.0" results in "nan" with %f (NAN with %F). Example: > echo printf("%.2f", 12.115) < 12.12 @@ -5870,10 +6085,10 @@ py3eval({expr}) *py3eval()* pyeval({expr}) *pyeval()* Evaluate Python expression {expr} and return its result converted to Vim data structures. - Numbers and strings are returned as they are (strings are + Numbers and strings are returned as they are (strings are copied though). Lists are represented as Vim |List| type. - Dictionaries are represented as Vim |Dictionary| type, + Dictionaries are represented as Vim |Dictionary| type, non-string keys result in error. {only available when compiled with the |+python| feature} @@ -5899,9 +6114,9 @@ range({expr} [, {max} [, {stride}]]) *range()* *readfile()* readfile({fname} [, {binary} [, {max}]]) Read file {fname} and return a |List|, each line of the file - as an item. Lines broken at NL characters. Macintosh files - separated with CR will result in a single long line (unless a - NL appears somewhere). + as an item. Lines are broken at NL characters. Macintosh + files separated with CR will result in a single long line + (unless a NL appears somewhere). All NUL characters are replaced with a NL character. When {binary} contains "b" binary mode is used: - When the last line ends in a NL an extra empty list item is @@ -5984,6 +6199,12 @@ remote_expr({server}, {string} [, {idvar}]) {only available when compiled with the |+clientserver| feature} Note: Any errors will cause a local error message to be issued and the result will be the empty string. + + Variables will be evaluated in the global namespace, + independent of a function currently being active. Except + when in debug mode, then local function variables and + arguments can be evaluated. + Examples: > :echo remote_expr("gvim", "2+2") :echo remote_expr("gvim1", "b:current_syntax") @@ -6135,20 +6356,18 @@ rpcstart({prog}[, {argv}]) {Nvim} *rpcstart()* :let id = jobstart(['prog', 'arg1', 'arg2'], {'rpc': v:true}) rpcstop({channel}) {Nvim} *rpcstop()* - Closes an |RPC| {channel}. If the channel is a job - started with |jobstart()| the job is killed. - It is better to use |jobstop()| in this case, or use - |jobclose|(id, "rpc") to only close the channel without - killing the job. - Closes the socket connection if the channel was opened by - connecting to |v:servername|. + Deprecated. This function was used to stop a job with |rpc| + channel, and additionally closed rpc sockets. Instead use + |jobstop()| to stop any job, and |chanclose|(id, "rpc") to close + rpc communication without stopping the job. Use |chanclose|(id) + to close any socket. -screenattr(row, col) *screenattr()* - Like screenchar(), but return the attribute. This is a rather +screenattr({row}, {col}) *screenattr()* + Like |screenchar()|, but return the attribute. This is a rather arbitrary number that can only be used to compare to the attribute at other positions. -screenchar(row, col) *screenchar()* +screenchar({row}, {col}) *screenchar()* The result is a Number, which is the character at position [row, col] on the screen. This works for every possible screen position, also status lines, window separators and the @@ -6204,7 +6423,7 @@ search({pattern} [, {flags} [, {stopline} [, {timeout}]]]) *search()* flag. 'ignorecase', 'smartcase' and 'magic' are used. - + When the 'z' flag is not given, searching always starts in column zero and then matches before the cursor are skipped. When the 'c' flag is present in 'cpo' the next search starts @@ -6419,11 +6638,32 @@ serverlist() *serverlist()* nvim --cmd "echo serverlist()" --cmd "q" < serverstart([{address}]) *serverstart()* - Opens a named pipe or TCP socket at {address} for clients to - connect to and returns {address}. If no address is given, it - is equivalent to: > + Opens a socket or named pipe at {address} and listens for + |RPC| messages. Clients can send |API| commands to the address + to control Nvim. Returns the address string. + + If {address} does not contain a colon ":" it is interpreted as + a named pipe or Unix domain socket path. + + Example: > + if has('win32') + call serverstart('\\.\pipe\nvim-pipe-1234') + else + call serverstart('nvim.sock') + endif +< + If {address} contains a colon ":" it is interpreted as a TCP + address where the last ":" separates the host and port. + Assigns a random port if it is empty or 0. Supports IPv4/IPv6. + + Example: > + :call serverstart('::1:12345') +< + If no address is given, it is equivalent to: > :call serverstart(tempname()) + < |$NVIM_LISTEN_ADDRESS| is set to {address} if not already set. + *--servername* The Vim command-line option `--servername` can be imitated: > nvim --cmd "let g:server_addr = serverstart('foo')" @@ -6520,7 +6760,7 @@ setline({lnum}, {text}) *setline()* setloclist({nr}, {list} [, {action}[, {what}]]) *setloclist()* Create or replace or add to the location list for window {nr}. - {nr} can be the window number or the window ID. + {nr} can be the window number or the |window-ID|. When {nr} is zero the current window is used. For a location list window, the displayed location list is @@ -6651,13 +6891,13 @@ setqflist({list} [, {action}[, {what}]]) *setqflist()* This function can be used to create a quickfix list independent of the 'errorformat' setting. Use a command like - ":cc 1" to jump to the first position. + `:cc 1` to jump to the first position. *setreg()* setreg({regname}, {value} [, {options}]) Set the register {regname} to {value}. - {value} may be any value returned by |getreg()|, including + {value} may be any value returned by |getreg()|, including a |List|. If {options} contains "a" or {regname} is upper case, then the value is appended. @@ -6669,16 +6909,18 @@ setreg({regname}, {value} [, {options}]) used as the width of the selection - if it is not specified then the width of the block is set to the number of characters in the longest line (counting a as 1 character). + If {options} contains "u" or '"', then the unnamed register is + set to point to register {regname}. If {options} contains no register settings, then the default - is to use character mode unless {value} ends in a for - string {value} and linewise mode for list {value}. Blockwise + is to use character mode unless {value} ends in a for + string {value} and linewise mode for list {value}. Blockwise mode is never selected automatically. Returns zero for success, non-zero for failure. *E883* - Note: you may not use |List| containing more than one item to - set search and expression registers. Lists containing no + Note: you may not use |List| containing more than one item to + set search and expression registers. Lists containing no items act like empty strings. Examples: > @@ -6712,7 +6954,7 @@ settabwinvar({tabnr}, {winnr}, {varname}, {val}) *settabwinvar()* {val}. Tabs are numbered starting with one. For the current tabpage use |setwinvar()|. - {winnr} can be the window number or the window ID. + {winnr} can be the window number or the |window-ID|. When {winnr} is zero the current window is used. This also works for a global or local buffer option, but it doesn't work for a global or local buffer variable. @@ -6813,10 +7055,30 @@ sinh({expr}) *sinh()* :echo sinh(-0.9) < -1.026517 +sockconnect({mode}, {address}, {opts}) *sockconnect()* + Connect a socket to an address. If {mode} is "pipe" then + {address} should be the path of a named pipe. If {mode} is + "tcp" then {address} should be of the form "host:port" where + the host should be an ip adderess or host name, and port the + port number. + + Returns a |channel| ID. Close the socket with |chanclose()|. + Use |chansend()| to send data over a bytes socket, and + |rpcrequest()| and |rpcnotify()| to communicate with a RPC + socket. + + {opts} is a dictionary with these keys: + |on_data| : callback invoked when data was read from socket + data_buffered : read data from socket in |buffered| mode. + rpc : If set, |msgpack-rpc| will be used to communicate + over the socket. + Returns: + - The channel ID on success (greater than zero) + - 0 on invalid arguments or connection failure. sort({list} [, {func} [, {dict}]]) *sort()* *E702* Sort the items in {list} in-place. Returns {list}. - + If you want a list to remain unmodified make a copy first: > :let sortedlist = sort(copy(mylist)) @@ -6827,7 +7089,7 @@ sort({list} [, {func} [, {dict}]]) *sort()* *E702* When {func} is given and it is '1' or 'i' then case is ignored. - + When {func} is given and it is 'n' then all items will be sorted numerical (Implementation detail: This uses the strtod() function to parse numbers, Strings, Lists, Dicts and @@ -6963,6 +7225,27 @@ sqrt({expr}) *sqrt()* "nan" may be different, it depends on system libraries. +stdioopen({opts}) *stdioopen()* + In a nvim launched with the |--headless| option, this opens + stdin and stdout as a |channel|. This function can only be + invoked once per instance. See |channel-stdio| for more + information and examples. Note that stderr is not handled by + this function, see |v:stderr|. + + Returns a |channel| ID. Close the stdio descriptors with |chanclose()|. + Use |chansend()| to send data to stdout, and + |rpcrequest()| and |rpcnotify()| to communicate over RPC. + + {opts} is a dictionary with these keys: + |on_stdin| : callback invoked when stdin is written to. + stdin_buffered : read stdin in |buffered| mode. + rpc : If set, |msgpack-rpc| will be used to communicate + over stdio + Returns: + - The channel ID on success (this is always 1) + - 0 on invalid arguments + + str2float({expr}) *str2float()* Convert String {expr} to a Float. This mostly works the same as when using a floating point number in an expression, see @@ -6997,7 +7280,7 @@ strchars({expr} [, {skipcc}]) *strchars()* counted separately. When {skipcc} set to 1, Composing characters are ignored. Also see |strlen()|, |strdisplaywidth()| and |strwidth()|. - + {skipcc} is only available after 7.4.755. For backward compatibility, you can define a wrapper function: > if has("patch-7.4.755") @@ -7014,15 +7297,15 @@ strchars({expr} [, {skipcc}]) *strchars()* endfunction endif < -strcharpart({src}, {start}[, {len}]) *strcharpart()* +strcharpart({src}, {start} [, {len}]) *strcharpart()* Like |strpart()| but using character index and length instead of byte index and length. When a character index is used where a character does not - exist it is assumed to be one byte. For example: > + exist it is assumed to be one character. For example: > strcharpart('abc', -1, 2) < results in 'a'. -strdisplaywidth({expr}[, {col}]) *strdisplaywidth()* +strdisplaywidth({expr} [, {col}]) *strdisplaywidth()* The result is a Number, which is the number of display cells String {expr} occupies on the screen when it starts at {col}. When {col} is omitted zero is used. Otherwise it is the @@ -7111,7 +7394,7 @@ strlen({expr}) The result is a Number, which is the length of the String |strchars()|. Also see |len()|, |strdisplaywidth()| and |strwidth()|. -strpart({src}, {start}[, {len}]) *strpart()* +strpart({src}, {start} [, {len}]) *strpart()* The result is a String, which is part of {src}, starting from byte {start}, with the byte length {len}. To count characters instead of bytes use |strcharpart()|. @@ -7163,7 +7446,7 @@ strwidth({expr}) *strwidth()* Ambiguous, this function's return value depends on 'ambiwidth'. Also see |strlen()|, |strdisplaywidth()| and |strchars()|. -submatch({nr}[, {list}]) *submatch()* +submatch({nr} [, {list}]) *submatch()* *E935* Only for an expression in a |:substitute| command or substitute() function. Returns the {nr}'th submatch of the matched text. When {nr} @@ -7172,14 +7455,17 @@ submatch({nr}[, {list}]) *submatch()* multi-line match or a NUL character in the text. Also see |sub-replace-expression|. - If {list} is present and non-zero then submatch() returns - a list of strings, similar to |getline()| with two arguments. + If {list} is present and non-zero then submatch() returns + a list of strings, similar to |getline()| with two arguments. NL characters in the text represent NUL characters in the text. Only returns more than one item for |:substitute|, inside |substitute()| this list will always contain one or zero items, since there are no real line breaks. + When substitute() is used recursively only the submatches in + the current (deepest) call can be obtained. + Example: > :s/\d\+/\=submatch(0) + 1/ < This finds the first number in the line and adds one to it. @@ -7190,7 +7476,7 @@ substitute({expr}, {pat}, {sub}, {flags}) *substitute()* the first match of {pat} is replaced with {sub}. When {flags} is "g", all matches of {pat} in {expr} are replaced. Otherwise {flags} should be "". - + This works like the ":substitute" command (without any flags). But the matching with {pat} is always done like the 'magic' option is set and 'cpoptions' is empty (to make scripts @@ -7378,16 +7664,16 @@ systemlist({cmd} [, {input} [, {keepempty}]]) *systemlist()* output separated by NL) with NULs transformed into NLs. Output is the same as |readfile()| will output with {binary} argument set to "b", except that a final newline is not preserved, - unless {keepempty} is present and it's non-zero. + unless {keepempty} is non-zero. + Note that on MS-Windows you may get trailing CR characters. - Returns an empty string on error, so be careful not to run - into |E706|. + Returns an empty string on error. tabpagebuflist([{arg}]) *tabpagebuflist()* The result is a |List|, where each item is the number of the buffer associated with each window in the current tab page. - {arg} specifies the number of tab page to be used. When + {arg} specifies the number of the tab page to be used. When omitted the current tab page is used. When {arg} is invalid the number zero is returned. To get a list of all buffers in all tabs use this: > @@ -7424,8 +7710,13 @@ tagfiles() Returns a |List| with the file names used to search for tags for the current buffer. This is the 'tags' option expanded. -taglist({expr}) *taglist()* +taglist({expr} [, {filename}]) *taglist()* Returns a list of tags matching the regular expression {expr}. + + If {filename} is passed it is used to prioritize the results + in the same way that |:tselect| does. See |tag-priority|. + {filename} should be the full path of the file. + Each list item is a dictionary with at least the following entries: name Name of the tag. @@ -7448,7 +7739,7 @@ taglist({expr}) *taglist()* may appear, they give the name of the entity the tag is contained in. - The ex-command 'cmd' can be either an ex search pattern, a + The ex-command "cmd" can be either an ex search pattern, a line number or a line number followed by a byte number. If there are no matching tags, then an empty list is returned. @@ -7483,7 +7774,7 @@ termopen({cmd}[, {opts}]) {Nvim} *termopen()* and `$TERM` is set to "xterm-256color". Returns the same values as |jobstart()|. - See |terminal-emulator| for more information. + See |terminal| for more information. test_garbagecollect_now() *test_garbagecollect_now()* Like garbagecollect(), but executed right away. This must @@ -7513,7 +7804,36 @@ tanh({expr}) *tanh()* < -0.761594 - *timer_start()* + *timer_info()* +timer_info([{id}]) + Return a list with information about timers. + When {id} is given only information about this timer is + returned. When timer {id} does not exist an empty list is + returned. + When {id} is omitted information about all timers is returned. + + For each timer the information is stored in a Dictionary with + these items: + "id" the timer ID + "time" time the timer was started with + "repeat" number of times the timer will still fire; + -1 means forever + "callback" the callback + +timer_pause({timer}, {paused}) *timer_pause()* + Pause or unpause a timer. A paused timer does not invoke its + callback when its time expires. Unpausing a timer may cause + the callback to be invoked almost immediately if enough time + has passed. + + Pausing a timer is useful to avoid the callback to be called + for a short time. + + If {paused} evaluates to a non-zero Number or a non-empty + String, then the timer is paused, otherwise it is unpaused. + See |non-zero-arg|. + + *timer_start()* *timer* *timers* timer_start({time}, {callback} [, {options}]) Create a timer and return the timer ID. @@ -7522,13 +7842,14 @@ timer_start({time}, {callback} [, {options}]) busy or Vim is not waiting for input the time will be longer. {callback} is the function to call. It can be the name of a - function or a Funcref. It is called with one argument, which + function or a |Funcref|. It is called with one argument, which is the timer ID. The callback is only invoked when Vim is waiting for input. {options} is a dictionary. Supported entries: "repeat" Number of times to repeat calling the - callback. -1 means forever. + callback. -1 means forever. When not present + the callback will be called once. Example: > func MyHandler(timer) @@ -7538,12 +7859,16 @@ timer_start({time}, {callback} [, {options}]) \ {'repeat': 3}) < This will invoke MyHandler() three times at 500 msec intervals. - {only available when compiled with the |+timers| feature} timer_stop({timer}) *timer_stop()* Stop a timer. The timer callback will no longer be invoked. {timer} is an ID returned by timer_start(), thus it must be a - Number. + Number. If {timer} does not exist there is no error. + +timer_stopall() *timer_stopall()* + Stop all timers. The timer callbacks will no longer be + invoked. Useful if some timers is misbehaving. If there are + no timers there is no error. tolower({expr}) *tolower()* The result is a copy of the String given, with all uppercase @@ -7633,7 +7958,7 @@ undotree() *undotree()* "save_last" Number of the last file write. Zero when no write yet. "save_cur" Number of the current position in the undo - tree. + tree. "synced" Non-zero when the last undo block was synced. This happens when waiting from input from the user. See |undo-blocks|. @@ -7745,11 +8070,11 @@ wildmenumode() *wildmenumode()* win_findbuf({bufnr}) *win_findbuf()* - Returns a list with window IDs for windows that contain buffer - {bufnr}. When there is none the list is empty. + Returns a list with |window-ID|s for windows that contain + buffer {bufnr}. When there is none the list is empty. win_getid([{win} [, {tab}]]) *win_getid()* - Get the window ID for the specified window. + Get the |window-ID| for the specified window. When {win} is missing use the current window. With {win} this is the window number. The top window has number 1. @@ -7774,7 +8099,7 @@ win_id2win({expr}) *win_id2win()* *winbufnr()* winbufnr({nr}) The result is a Number, which is the number of the buffer associated with window {nr}. {nr} can be the window number or - the window ID. + the |window-ID|. When {nr} is zero, the number of the buffer in the current window is returned. When window {nr} doesn't exist, -1 is returned. @@ -7788,10 +8113,11 @@ wincol() The result is a Number, which is the virtual column of the winheight({nr}) *winheight()* The result is a Number, which is the height of window {nr}. - {nr} can be the window number or the window ID. + {nr} can be the window number or the |window-ID|. When {nr} is zero, the height of the current window is returned. When window {nr} doesn't exist, -1 is returned. An existing window always has a height of zero or more. + This excludes any window toolbar line. Examples: > :echo "The current window has " . winheight(0) . " lines." < @@ -7814,7 +8140,7 @@ winnr([{arg}]) The result is a Number, which is the number of the current is returned. The number can be used with |CTRL-W_w| and ":wincmd w" |:wincmd|. - Also see |tabpagewinnr()|. + Also see |tabpagewinnr()| and |win_getid()|. *winrestcmd()* winrestcmd() Returns a sequence of |:resize| commands that should restore @@ -7868,7 +8194,7 @@ winsaveview() Returns a |Dictionary| that contains information to restore winwidth({nr}) *winwidth()* The result is a Number, which is the width of window {nr}. - {nr} can be the window number or the window ID. + {nr} can be the window number or the |window-ID|. When {nr} is zero, the width of the current window is returned. When window {nr} doesn't exist, -1 is returned. An existing window always has a width of zero or more. @@ -7877,7 +8203,10 @@ winwidth({nr}) *winwidth()* :if winwidth(0) <= 50 : exe "normal 50\|" :endif -< +< For getting the terminal or screen size, see the 'columns' + option. + + wordcount() *wordcount()* The result is a dictionary of byte/chars/word statistics for the current buffer. This is the same info as provided by @@ -7913,6 +8242,12 @@ writefile({list}, {fname} [, {flags}]) appended to the file: > :call writefile(["foo"], "event.log", "a") :call writefile(["bar"], "event.log", "a") +< + When {flags} contains "S" fsync() call is not used, with "s" + it is used, 'fsync' option applies by default. No fsync() + means that writefile() will finish faster, but writes may be + left in OS buffers and not yet written to disk. Such changes + will disappear if system crashes before OS does writing. All NL characters are replaced with a NUL character. Inserting CR characters needs to be done before passing {list} @@ -7942,11 +8277,11 @@ There are four types of features: :if has("cindent") 2. Features that are only supported when certain conditions have been met. Example: > - :if has("gui_running") + :if has("win32") < *has-patch* -3. {Nvim} version. The "nvim-1.2.3" feature means that the Nvim version is - 1.2.3 or later. Example: > - :if has("nvim-1.2.3") +3. Nvim version. The "nvim-0.2.1" feature means that the Nvim version is + 0.2.1 or later. Example: > + :if has("nvim-0.2.1") < 4. Included patches. The "patch123" feature means that patch 123 has been included. Note that this form does not check the version of Vim, you need @@ -7977,17 +8312,14 @@ browse Compiled with |:browse| support, and browse() will browsefilter Compiled with support for |browsefilter|. byte_offset Compiled with support for 'o' in 'statusline' cindent Compiled with 'cindent' support. -clientserver Compiled with remote invocation support |clientserver|. clipboard Compiled with 'clipboard' support. cmdline_compl Compiled with |cmdline-completion| support. cmdline_hist Compiled with |cmdline-history| support. cmdline_info Compiled with 'showcmd' and 'ruler' support. comments Compiled with |'comments'| support. -compatible Compiled to be very Vi compatible. cscope Compiled with |cscope| support. debug Compiled with "DEBUG" defined. dialog_con Compiled with console dialog support. -dialog_gui Compiled with GUI dialog support. digraphs Compiled with support for digraphs. eval Compiled with expression evaluation support. Always true, of course! @@ -8005,9 +8337,6 @@ fname_case Case in file names matters (for Windows this is not present). folding Compiled with |folding| support. gettext Compiled with message translation |multi-lang| -gui Compiled with GUI enabled. -gui_running Vim is running in the GUI, or it will start soon. -gui_win32 Compiled with MS Windows Win32 GUI. iconv Can use iconv() for conversion. insert_expand Compiled with support for CTRL-X expansion commands in Insert mode. @@ -8022,8 +8351,7 @@ lispindent Compiled with support for lisp indenting. listcmds Compiled with commands for the buffer list |:files| and the argument list |arglist|. localmap Compiled with local mappings and abbr. |:map-local| -mac Macintosh version of Vim. -macunix Macintosh version of Vim, using Unix files (OS-X). +mac macOS version of Nvim. menu Compiled with support for |:menu|. mksession Compiled with support for |:mksession|. modify_fname Compiled with file name modifiers. |filename-modifiers| @@ -8031,17 +8359,16 @@ mouse Compiled with support mouse. mouseshape Compiled with support for 'mouseshape'. multi_byte Compiled with support for 'encoding' multi_byte_encoding 'encoding' is set to a multi-byte encoding. -multi_byte_ime Compiled with support for IME input method. multi_lang Compiled with support for multiple languages. +num64 Compiled with 64-bit |Number| support. nvim This is Nvim. |has-patch| -ole Compiled with OLE automation support for Win32. path_extra Compiled with up/downwards search in 'path' and 'tags' persistent_undo Compiled with support for persistent undo history. postscript Compiled with PostScript file printing. printer Compiled with |:hardcopy| support. profile Compiled with |:profile| support. -python Compiled with Python 2.x interface. |has-python| -python3 Compiled with Python 3.x interface. |has-python| +python Legacy Vim Python 2.x API is available. |has-python| +python3 Legacy Vim Python 3.x API is available. |has-python| quickfix Compiled with |quickfix| support. reltime Compiled with |reltime()| support. rightleft Compiled with 'rightleft' support. @@ -8064,15 +8391,14 @@ tag_old_static Compiled with support for old static tags |tag-old-static|. tag_any_white Compiled with support for any white characters in tags files |tag-any-white|. -terminfo Compiled with terminfo instead of termcap. termresponse Compiled with support for |t_RV| and |v:termresponse|. textobjects Compiled with support for |text-objects|. -tgetent Compiled with tgetent support, able to use a termcap - or terminfo file. timers Compiled with |timer_start()| support. title Compiled with window title support |'title'|. -toolbar Compiled with support for |gui-toolbar|. +ttyin input is a terminal (tty) +ttyout output is a terminal (tty) unix Unix version of Vim. +unnamedplus Compiled with support for "unnamedplus" in 'clipboard' user_commands User-defined commands. vertsplit Compiled with vertically split windows |:vsplit|. vim_starting True while initial source'ing takes place. |startup| @@ -8085,17 +8411,9 @@ vreplace Compiled with |gR| and |gr| commands. wildignore Compiled with 'wildignore' option. wildmenu Compiled with 'wildmenu' option. win32 Windows version of Vim (32 or 64 bit). -win32unix Windows version of Vim, using Unix files (Cygwin). -win64 Windows version of Vim (64 bit). winaltkeys Compiled with 'winaltkeys' option. windows Compiled with support for more than one window. writebackup Compiled with 'writebackup' default on. -xfontset Compiled with X fontset support |xfontset|. -xim Compiled with X input method support |xim|. -xpm Compiled with pixmap support. -xpm_w32 Compiled with pixmap support for Win32. (Only for - backward compatibility. Use "xpm" instead.) -x11 Compiled with X11 support. *string-match* Matching a pattern in a String @@ -8166,13 +8484,16 @@ See |:verbose-cmd| for more information. *E124* *E125* *E853* *E884* :fu[nction][!] {name}([arguments]) [range] [abort] [dict] [closure] - Define a new function by the name {name}. The name - must be made of alphanumeric characters and '_', and - must start with a capital or "s:" (see above). Note - that using "b:" or "g:" is not allowed. (since patch - 7.4.260 E884 is given if the function name has a colon - in the name, e.g. for "foo:bar()". Before that patch - no error was given). + Define a new function by the name {name}. The body of + the function follows in the next lines, until the + matching |:endfunction|. + + The name must be made of alphanumeric characters and + '_', and must start with a capital or "s:" (see + above). Note that using "b:" or "g:" is not allowed. + (since patch 7.4.260 E884 is given if the function + name has a colon in the name, e.g. for "foo:bar()". + Before that patch no error was given). {name} can also be a |Dictionary| entry that is a |Funcref|: > @@ -8220,7 +8541,7 @@ See |:verbose-cmd| for more information. : let x += 1 : return x : endfunction - : return function('Bar') + : return funcref('Bar') :endfunction :let F = Foo() @@ -8287,9 +8608,10 @@ to the number of named arguments. When using "...", the number of arguments may be larger. It is also possible to define a function without any arguments. You must -still supply the () then. The body of the function follows in the next lines, -until the matching |:endfunction|. It is allowed to define another function -inside a function body. +still supply the () then. + +It is allowed to define another function inside a function +body. *local-variables* Inside a function local variables can be used. These will disappear when the @@ -8567,6 +8889,11 @@ This does NOT work: > value and the global value are changed. Example: > :let &path = &path . ',/usr/local/include' +< This also works for terminal codes in the form t_xx. + But only for alphanumerical names. Example: > + :let &t_k1 = "\[234;" +< When the code does not exist yet it will be created as + a terminal key code, there is no error. :let &{option-name} .= {expr1} For a string option: Append {expr1} to the value. @@ -10139,7 +10466,7 @@ code can be used: > redir => scriptnames_output silent scriptnames redir END - + " Split the output into lines and parse each line. Add an entry to the " "scripts" dictionary. let scripts = {} @@ -10176,6 +10503,22 @@ missing: > : echo "You will _never_ see this message" :endif +To execute a command only when the |+eval| feature is disabled requires a trick, +as this example shows: > + if 1 + nnoremap : :" + endif + normal :set history=111 + if 1 + nunmap : + endif + +The "" here is a real CR character, type CTRL-V Enter to get it. + +When the |+eval| feature is available the ":" is remapped to add a double +quote, which has the effect of commenting-out the command. without the +|+eval| feature the nnoremap command is skipped and the command is executed. + ============================================================================== 11. The sandbox *eval-sandbox* *sandbox* *E48* diff --git a/runtime/doc/farsi.txt b/runtime/doc/farsi.txt index b85c0a357c..a824c469b0 100644 --- a/runtime/doc/farsi.txt +++ b/runtime/doc/farsi.txt @@ -1,4 +1,4 @@ -*farsi.txt* For Vim version 7.4. Last change: 2010 Aug 07 +*farsi.txt* Nvim VIM REFERENCE MANUAL by Mortaza Ghassab Shiran diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt index d15815191e..78402b47fe 100644 --- a/runtime/doc/filetype.txt +++ b/runtime/doc/filetype.txt @@ -1,4 +1,4 @@ -*filetype.txt* For Vim version 7.4. Last change: 2016 Jun 20 +*filetype.txt* Nvim VIM REFERENCE MANUAL by Bram Moolenaar @@ -6,12 +6,10 @@ Filetypes *filetype* *file-type* -1. Filetypes |filetypes| -2. Filetype plugin |filetype-plugins| -3. Docs for the default filetype plugins. |ftplugin-docs| - Also see |autocmd.txt|. + Type |gO| to see the table of contents. + ============================================================================== 1. Filetypes *filetypes* *file-types* @@ -34,7 +32,7 @@ Detail: The ":filetype on" command will load one of these files: BufNewFile and BufRead events. If the file type is not found by the name, the file $VIMRUNTIME/scripts.vim is used to detect it from the contents of the file. - When the GUI is running or will start soon, the menu.vim script is + When the GUI is running or will start soon, the |menu.vim| script is also sourced. See |'go-M'| about avoiding that. To add your own file types, see |new-filetype| below. To search for help on a @@ -311,12 +309,12 @@ define yourself. There are a few ways to avoid this: You need to define your own mapping before the plugin is loaded (before editing a file of that type). The plugin will then skip installing the default mapping. - + *no_mail_maps* 3. Disable defining mappings for a specific filetype by setting a variable, which contains the name of the filetype. For the "mail" filetype this would be: > :let no_mail_maps = 1 - +< *no_plugin_maps* 4. Disable defining mappings for all filetypes by setting a variable: > :let no_plugin_maps = 1 < @@ -542,6 +540,7 @@ K or CTRL-] Jump to the manpage for the under the cursor. Takes a count for the section. CTRL-T Jump back to the location that the manpage was opened from. +gO Show the manpage outline. |gO| q :quit if invoked as $MANPAGER, otherwise :close. Variables: @@ -565,6 +564,17 @@ These maps can be disabled with > :let g:no_pdf_maps = 1 < +PYTHON *ft-python-plugin* *PEP8* + +By default the following options are set, in accordance with PEP8: > + + setlocal expandtab shiftwidth=4 softtabstop=4 tabstop=8 + +To disable this behaviour, set the following variable in your vimrc: > + + let g:python_recommended_style = 0 + + RPM SPEC *ft-spec-plugin* Since the text for this plugin is rather long it has been put in a separate @@ -714,6 +724,12 @@ Format description: not recognized here as well. +RUST *ft-rust* + +Since the text for this plugin is rather long it has been put in a separate +file: |ft_rust.txt|. + + SQL *ft-sql* Since the text for this plugin is rather long it has been put in a separate diff --git a/runtime/doc/fold.txt b/runtime/doc/fold.txt index 680e3270f2..c644d63280 100644 --- a/runtime/doc/fold.txt +++ b/runtime/doc/fold.txt @@ -1,4 +1,4 @@ -*fold.txt* For Vim version 7.4. Last change: 2016 Jan 02 +*fold.txt* Nvim VIM REFERENCE MANUAL by Bram Moolenaar @@ -9,10 +9,7 @@ Folding *Folding* *folding* *folds* You can find an introduction on folding in chapter 28 of the user manual. |usr_28.txt| -1. Fold methods |fold-methods| -2. Fold commands |fold-commands| -3. Fold options |fold-options| -4. Behavior of folds |fold-behavior| + Type |gO| to see the table of contents. ============================================================================== 1. Fold methods *fold-methods* @@ -61,7 +58,7 @@ whichever is lower. These are empty or white lines and lines starting with a character in 'foldignore'. White space is skipped before checking for characters in 'foldignore'. For C use "#" to ignore preprocessor lines. -When you want to ignore lines in another way, use the 'expr' method. The +When you want to ignore lines in another way, use the "expr" method. The |indent()| function can be used in 'foldexpr' to get the indent of a line. @@ -76,7 +73,7 @@ This will call a function to compute the fold level: > :set foldexpr=MyFoldLevel(v:lnum) This will make a fold out of paragraphs separated by blank lines: > :set foldexpr=getline(v:lnum)=~'^\\s*$'&&getline(v:lnum+1)=~'\\S'?'<1':1 -this does the same: > +This does the same: > :set foldexpr=getline(v:lnum-1)=~'^\\s*$'&&getline(v:lnum)=~'\\S'?'>1':1 Note that backslashes must be used to escape characters that ":set" handles @@ -136,7 +133,7 @@ fold level. But note that foldlevel() may return -1 if the level is not known yet. And it returns the level at the start of the line, while a fold might end in that line. -It may happened that folds are not updated properly. You can use |zx| or |zX| +It may happen that folds are not updated properly. You can use |zx| or |zX| to force updating folds. @@ -200,7 +197,7 @@ and the level given by the marker: 1. If a marker with the same fold level is encountered, the previous fold ends and another fold with the same level starts. 2. If a marker with a higher fold level is found, a nested fold is started. -3. if a marker with a lower fold level is found, all folds up to and including +3. If a marker with a lower fold level is found, all folds up to and including this level end and a fold with the specified level starts. The number indicates the fold level. A zero cannot be used (a marker with diff --git a/runtime/doc/ft_ada.txt b/runtime/doc/ft_ada.txt index 1e81acff67..c1aa0904c4 100644 --- a/runtime/doc/ft_ada.txt +++ b/runtime/doc/ft_ada.txt @@ -1,4 +1,4 @@ -*ft_ada.txt* For Vim version 7.4. Last change: 2010 Jul 20 +*ft_ada.txt* Nvim ADA FILE TYPE PLUG-INS REFERENCE MANUAL~ @@ -116,7 +116,7 @@ NOTE: "gnat xref -v" is very tricky to use as it has almost no diagnostic then "gnat xref -v *.ad?" 4) Project manager support is completely broken - don't even try "gnat xref -Padacl.gpr". -5) VIM is faster when the tags file is sorted - use "sort --unique +5) Vim is faster when the tags file is sorted - use "sort --unique --ignore-case --output=tags tags" . 6) Remember to insert "!_TAG_FILE_SORTED 2 %sort ui" as first line to mark the file assorted. diff --git a/runtime/doc/ft_rust.txt b/runtime/doc/ft_rust.txt new file mode 100644 index 0000000000..750ba76afc --- /dev/null +++ b/runtime/doc/ft_rust.txt @@ -0,0 +1,237 @@ +*ft_rust.txt* Filetype plugin for Rust + +============================================================================== +CONTENTS *rust* + +1. Introduction |rust-intro| +2. Settings |rust-settings| +3. Commands |rust-commands| +4. Mappings |rust-mappings| + +============================================================================== +INTRODUCTION *rust-intro* + +This plugin provides syntax and supporting functionality for the Rust +filetype. + +============================================================================== +SETTINGS *rust-settings* + +This plugin has a few variables you can define in your vimrc that change the +behavior of the plugin. + + *g:rustc_path* +g:rustc_path~ + Set this option to the path to rustc for use in the |:RustRun| and + |:RustExpand| commands. If unset, "rustc" will be located in $PATH: > + let g:rustc_path = $HOME."/bin/rustc" +< + + *g:rustc_makeprg_no_percent* +g:rustc_makeprg_no_percent~ + Set this option to 1 to have 'makeprg' default to "rustc" instead of + "rustc %": > + let g:rustc_makeprg_no_percent = 1 +< + + *g:rust_conceal* +g:rust_conceal~ + Set this option to turn on the basic |conceal| support: > + let g:rust_conceal = 1 +< + + *g:rust_conceal_mod_path* +g:rust_conceal_mod_path~ + Set this option to turn on |conceal| for the path connecting token + "::": > + let g:rust_conceal_mod_path = 1 +< + + *g:rust_conceal_pub* +g:rust_conceal_pub~ + Set this option to turn on |conceal| for the "pub" token: > + let g:rust_conceal_pub = 1 +< + + *g:rust_recommended_style* +g:rust_recommended_style~ + Set this option to enable vim indentation and textwidth settings to + conform to style conventions of the rust standard library (i.e. use 4 + spaces for indents and sets 'textwidth' to 99). This option is enabled + by default. To disable it: > + let g:rust_recommended_style = 0 +< + + *g:rust_fold* +g:rust_fold~ + Set this option to turn on |folding|: > + let g:rust_fold = 1 +< + Value Effect ~ + 0 No folding + 1 Braced blocks are folded. All folds are open by + default. + 2 Braced blocks are folded. 'foldlevel' is left at the + global value (all folds are closed by default). + + *g:rust_bang_comment_leader* +g:rust_bang_comment_leader~ + Set this option to 1 to preserve the leader on multi-line doc comments + using the /*! syntax: > + let g:rust_bang_comment_leader = 1 +< + + *g:ftplugin_rust_source_path* +g:ftplugin_rust_source_path~ + Set this option to a path that should be prepended to 'path' for Rust + source files: > + let g:ftplugin_rust_source_path = $HOME.'/dev/rust' +< + + *g:rustfmt_command* +g:rustfmt_command~ + Set this option to the name of the 'rustfmt' executable in your $PATH. If + not specified it defaults to 'rustfmt' : > + let g:rustfmt_command = 'rustfmt' +< + *g:rustfmt_autosave* +g:rustfmt_autosave~ + Set this option to 1 to run |:RustFmt| automatically when saving a + buffer. If not specified it defaults to 0 : > + let g:rustfmt_autosave = 0 +< + *g:rustfmt_fail_silently* +g:rustfmt_fail_silently~ + Set this option to 1 to prevent 'rustfmt' from populating the + |location-list| with errors. If not specified it defaults to 0: > + let g:rustfmt_fail_silently = 0 +< + *g:rustfmt_options* +g:rustfmt_options~ + Set this option to a string of options to pass to 'rustfmt'. The + write-mode is already set to 'overwrite'. If not specified it + defaults to '' : > + let g:rustfmt_options = '' +< + + *g:rust_playpen_url* +g:rust_playpen_url~ + Set this option to override the URL for the playpen to use: > + let g:rust_playpen_url = 'https://play.rust-lang.org/' +< + + *g:rust_shortener_url* +g:rust_shortener_url~ + Set this option to override the URL for the URL shortener: > + let g:rust_shortener_url = 'https://is.gd/' +< + + +============================================================================== +COMMANDS *rust-commands* + +:RustRun [args] *:RustRun* +:RustRun! [rustc-args] [--] [args] + Compiles and runs the current file. If it has unsaved changes, + it will be saved first using |:update|. If the current file is + an unnamed buffer, it will be written to a temporary file + first. The compiled binary is always placed in a temporary + directory, but is run from the current directory. + + The arguments given to |:RustRun| will be passed to the + compiled binary. + + If ! is specified, the arguments are passed to rustc instead. + A "--" argument will separate the rustc arguments from the + arguments passed to the binary. + + If |g:rustc_path| is defined, it is used as the path to rustc. + Otherwise it is assumed rustc can be found in $PATH. + +:RustExpand [args] *:RustExpand* +:RustExpand! [TYPE] [args] + Expands the current file using --pretty and displays the + results in a new split. If the current file has unsaved + changes, it will be saved first using |:update|. If the + current file is an unnamed buffer, it will be written to a + temporary file first. + + The arguments given to |:RustExpand| will be passed to rustc. + This is largely intended for specifying various --cfg + configurations. + + If ! is specified, the first argument is the expansion type to + pass to rustc --pretty. Otherwise it will default to + "expanded". + + If |g:rustc_path| is defined, it is used as the path to rustc. + Otherwise it is assumed rustc can be found in $PATH. + +:RustEmitIr [args] *:RustEmitIr* + Compiles the current file to LLVM IR and displays the results + in a new split. If the current file has unsaved changes, it + will be saved first using |:update|. If the current file is an + unnamed buffer, it will be written to a temporary file first. + + The arguments given to |:RustEmitIr| will be passed to rustc. + + If |g:rustc_path| is defined, it is used as the path to rustc. + Otherwise it is assumed rustc can be found in $PATH. + +:RustEmitAsm [args] *:RustEmitAsm* + Compiles the current file to assembly and displays the results + in a new split. If the current file has unsaved changes, it + will be saved first using |:update|. If the current file is an + unnamed buffer, it will be written to a temporary file first. + + The arguments given to |:RustEmitAsm| will be passed to rustc. + + If |g:rustc_path| is defined, it is used as the path to rustc. + Otherwise it is assumed rustc can be found in $PATH. + +:RustPlay *:RustPlay* + This command will only work if you have web-api.vim installed + (available at https://github.com/mattn/webapi-vim). It sends the + current selection, or if nothing is selected, the entirety of the + current buffer to the Rust playpen, and emits a message with the + shortened URL to the playpen. + + |g:rust_playpen_url| is the base URL to the playpen, by default + "https://play.rust-lang.org/". + + |g:rust_shortener_url| is the base URL for the shortener, by + default "https://is.gd/" + +:RustFmt *:RustFmt* + Runs |g:rustfmt_command| on the current buffer. If + |g:rustfmt_options| is set then those will be passed to the + executable. + + If |g:rustfmt_fail_silently| is 0 (the default) then it + will populate the |location-list| with the errors from + |g:rustfmt_command|. If |g:rustfmt_fail_silently| is set to 1 + then it will not populate the |location-list|. + +:RustFmtRange *:RustFmtRange* + Runs |g:rustfmt_command| with selected range. See + |:RustFmt| for any other information. + +============================================================================== +MAPPINGS *rust-mappings* + +This plugin defines mappings for |[[| and |]]| to support hanging indents. + +It also has a few other mappings: + + *rust_* + Executes |:RustRun| with no arguments. + Note: This binding is only available in MacVim. + + *rust_* + Populates the command line with |:RustRun|! using the + arguments given to the last invocation, but does not + execute it. + Note: This binding is only available in MacVim. + +============================================================================== + vim:tw=78:sw=4:noet:ts=8:ft=help:norl: diff --git a/runtime/doc/ft_sql.txt b/runtime/doc/ft_sql.txt index 75c55269ef..29268f5753 100644 --- a/runtime/doc/ft_sql.txt +++ b/runtime/doc/ft_sql.txt @@ -1,4 +1,4 @@ -*ft_sql.txt* For Vim version 7.4. Last change: 2013 May 15 +*ft_sql.txt* Nvim by David Fishburn diff --git a/runtime/doc/gui.txt b/runtime/doc/gui.txt index 1e8bb408d9..904c4be19c 100644 --- a/runtime/doc/gui.txt +++ b/runtime/doc/gui.txt @@ -1,4 +1,4 @@ -*gui.txt* For Vim version 7.4. Last change: 2014 Mar 08 +*gui.txt* Nvim VIM REFERENCE MANUAL by Bram Moolenaar @@ -6,34 +6,17 @@ Vim's Graphical User Interface *gui* *GUI* -1. Starting the GUI |gui-start| -2. Scrollbars |gui-scrollbars| -3. Mouse Control |gui-mouse| -4. Making GUI Selections |gui-selections| -5. Menus |menus| -6. Extras |gui-extras| - -Other GUI documentation: -|gui_w32.txt| For specific items of the Win32 GUI. + Type |gO| to see the table of contents. ============================================================================== 1. Starting the GUI *gui-start* *E229* *E233* -First you must make sure you actually have a version of Vim with the GUI code -included. - -How to start the GUI depends on the system used. Mostly you can run the -GUI version of Vim with: - gvim [options] [files...] - *ginit.vim* *gui-init* *gvimrc* *$MYGVIMRC* The gvimrc file is where GUI-specific startup commands should be placed. It is always sourced after the |init.vim| file. If you have one then the $MYGVIMRC environment variable has its name. When the GUI starts up initializations are carried out, in this order: -- The 'term' option is set to "builtin_gui" and terminal options are reset to - their default value for the GUI |terminal-options|. - If the system menu file exists, it is sourced. The name of this file is normally "$VIMRUNTIME/menu.vim". You can check this with ":version". Also see |$VIMRUNTIME|. To skip loading the system menu include 'M' in @@ -63,7 +46,8 @@ When the GUI starts up initializations are carried out, in this order: already set. NOTE: All but the first one are not carried out if Vim was started with -"-u NONE" and no "-U" argument was given, or when started with "-U NONE". +"-u NONE" or "-u DEFAULTS" and no "-U" argument was given, or when started +with "-U NONE". All this happens AFTER the normal Vim initializations, like reading your vimrc file. See |initialization|. @@ -83,28 +67,6 @@ Recommended place for your personal GUI initializations: The personal initialization files are searched in the order specified above and only the first one that is found is read. -There are a number of options which only have meaning in the GUI version of -Vim. These are 'guicursor', 'guifont', and 'guioptions'. They are -documented in |options.txt| with all the other options. - -Another way to set the colors for different occasions is with highlight -groups. The "Normal" group is used to set the background and foreground -colors. Example (which looks nice): > - - :highlight Normal guibg=grey90 - -The "guibg" and "guifg" settings override the normal background and -foreground settings. The other settings for the Normal highlight group are -not used. Use the 'guifont' option to set the font. - -Also check out the 'guicursor' option, to set the colors for the cursor in -various modes. - -Vim tries to make the window fit on the screen when it starts up. This avoids -that you can't see part of it. On the X Window System this requires a bit of -guesswork. You can change the height that is used for the window title and a -task bar with the 'guiheadroom' option. - *:winp* *:winpos* *E188* :winp[os] Display current position of the top left corner of the GUI vim @@ -114,8 +76,7 @@ task bar with the 'guiheadroom' option. :winp[os] {X} {Y} *E466* Put the GUI vim window at the given {X} and {Y} coordinates. The coordinates should specify the position in pixels of the - top left corner of the window. Does not work in all versions. - Does work in an (new) xterm |xterm-color|. + top left corner of the window. When the GUI window has not been opened yet, the values are remembered until the window is opened. The position is adjusted to make the window fit on the screen (if possible). @@ -124,21 +85,6 @@ task bar with the 'guiheadroom' option. :win[size] {width} {height} Set the window height to {width} by {height} characters. Obsolete, use ":set lines=11 columns=22". - If you get less lines than expected, check the 'guiheadroom' - option. - -If you are running the X Window System, you can get information about the -window Vim is running in with these commands: > - :!xwininfo -id $WINDOWID - :!xprop -id $WINDOWID - :execute '!xwininfo -id ' . v:windowid - :execute '!xprop -id ' . v:windowid -< - *gui-IME* *iBus* -Input methods for international characters in X that rely on the XIM -framework, most notably iBus, have been known to produce undesirable results -in gVim. These may include an inability to enter spaces, or long delays -between typing a character and it being recognized by the application. ============================================================================== 2. Scrollbars *gui-scrollbars* @@ -437,6 +383,7 @@ menus and menu items. They are most useful for things that you can't remember what the key sequence was. For creating menus in a different language, see |:menutrans|. +If you don't want to use menus at all, see |'go-M'|. *menu.vim* The default menus are read from the file "$VIMRUNTIME/menu.vim". See @@ -453,7 +400,11 @@ in the menu (which can take a bit of time to load). If you want to have all filetypes already present at startup, add: > :let do_syntax_sel_menu = 1 -< +Note that the menu.vim is sourced when `:syntax on` or `:filetype on` is +executed or after your .vimrc file is sourced. This means that the 'encoding' +option and the language of messages (`:language messages`) must be set before +that (if you want to change them). + *console-menus* Although this documentation is in the GUI section, you can actually use menus in console mode too. You will have to load |menu.vim| explicitly then, it is @@ -545,9 +496,6 @@ expression register: > :amenu Insert.foobar "='foobar'P -Note that the '<' and 'k' flags in 'cpoptions' also apply here (when -included they make the <> form and raw key codes not being recognized). - Note that in Cmdline mode executes the command, like in a mapping. This is Vi compatible. Use CTRL-C to quit Cmdline mode. @@ -559,21 +507,13 @@ The ":set ic" will not be echoed when using this menu. Messages from the executed command are still given though. To shut them up too, add a ":silent" in the executed command: > :menu Search.Header :exe ":silent normal /Header\r" -"" may also appear just after "" or "+ contains=@phpClTop + syn region phpRegionSc matchgroup=Delimiter start=++ contains=@phpClTop if exists("php_asp_tags") - syn region phpRegionAsp matchgroup=Delimiter start="<%\(=\)\=" end="%>" contains=@phpClTop + syn region phpRegionAsp matchgroup=Delimiter start="<%\(=\)\=" end="%>" contains=@phpClTop endif else if exists("php_noShortTags") - syn region phpRegion matchgroup=Delimiter start="" contains=@phpClTop keepend + syn region phpRegion matchgroup=Delimiter start="" contains=@phpClTop keepend else - syn region phpRegion matchgroup=Delimiter start="" contains=@phpClTop keepend + syn region phpRegion matchgroup=Delimiter start="" contains=@phpClTop keepend endif - syn region phpRegionSc matchgroup=Delimiter start=++ contains=@phpClTop keepend + syn region phpRegionSc matchgroup=Delimiter start=++ contains=@phpClTop keepend if exists("php_asp_tags") - syn region phpRegionAsp matchgroup=Delimiter start="<%\(=\)\=" end="%>" contains=@phpClTop keepend + syn region phpRegionAsp matchgroup=Delimiter start="<%\(=\)\=" end="%>" contains=@phpClTop keepend endif endif " Fold if exists("php_folding") && php_folding==1 " match one line constructs here and skip them at folding - syn keyword phpSCKeyword abstract final private protected public static contained - syn keyword phpFCKeyword function contained - syn keyword phpStorageClass global contained - syn match phpDefine "\(\s\|^\)\(abstract\s\+\|final\s\+\|private\s\+\|protected\s\+\|public\s\+\|static\s\+\)*function\(\s\+.*[;}]\)\@=" contained contains=phpSCKeyword - syn match phpStructure "\(\s\|^\)\(abstract\s\+\|final\s\+\)*class\(\s\+.*}\)\@=" contained - syn match phpStructure "\(\s\|^\)interface\(\s\+.*}\)\@=" contained - syn match phpException "\(\s\|^\)try\(\s\+.*}\)\@=" contained - syn match phpException "\(\s\|^\)catch\(\s\+.*}\)\@=" contained + syn keyword phpSCKeyword abstract final private protected public static contained + syn keyword phpFCKeyword function contained + syn keyword phpStorageClass global contained + syn match phpDefine "\(\s\|^\)\(abstract\s\+\|final\s\+\|private\s\+\|protected\s\+\|public\s\+\|static\s\+\)*function\(\s\+.*[;}]\)\@=" contained contains=phpSCKeyword + syn match phpStructure "\(\s\|^\)\(abstract\s\+\|final\s\+\)*\(trait\|class\)\(\s\+.*}\)\@=" contained + syn match phpStructure "\(\s\|^\)interface\(\s\+.*}\)\@=" contained + syn match phpException "\(\s\|^\)try\(\s\+.*}\)\@=" contained + syn match phpException "\(\s\|^\)catch\(\s\+.*}\)\@=" contained + syn match phpException "\(\s\|^\)finally\(\s\+.*}\)\@=" contained set foldmethod=syntax - syn region phpFoldHtmlInside matchgroup=Delimiter start="?>" end="" end="" end="" end="= 508 || !exists("did_php_syn_inits") - if version < 508 - let did_php_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink phpConstant Constant - HiLink phpCoreConstant Constant - HiLink phpComment Comment - HiLink phpDocTags PreProc - HiLink phpDocCustomTags Type - HiLink phpException Exception - HiLink phpBoolean Boolean - HiLink phpStorageClass StorageClass - HiLink phpSCKeyword StorageClass - HiLink phpFCKeyword Define - HiLink phpStructure Structure - HiLink phpStringSingle String - HiLink phpStringDouble String - HiLink phpBacktick String - HiLink phpNumber Number - HiLink phpFloat Float - HiLink phpMethods Function - HiLink phpFunctions Function - HiLink phpBaselib Function - HiLink phpRepeat Repeat - HiLink phpConditional Conditional - HiLink phpLabel Label - HiLink phpStatement Statement - HiLink phpKeyword Statement - HiLink phpType Type - HiLink phpInclude Include - HiLink phpDefine Define - HiLink phpBackslashSequences SpecialChar - HiLink phpBackslashDoubleQuote SpecialChar - HiLink phpBackslashSingleQuote SpecialChar - HiLink phpParent Delimiter - HiLink phpBrackets Delimiter - HiLink phpIdentifierConst Delimiter - HiLink phpParentError Error - HiLink phpOctalError Error - HiLink phpInterpSimpleError Error - HiLink phpInterpBogusDollarCurley Error - HiLink phpInterpDollarCurly1 Error - HiLink phpInterpDollarCurly2 Error - HiLink phpInterpSimpleBracketsInner String - HiLink phpInterpSimpleCurly Delimiter - HiLink phpInterpVarname Identifier - HiLink phpTodo Todo - HiLink phpDocTodo Todo - HiLink phpMemberSelector Structure - if exists("php_oldStyle") - hi phpIntVar guifg=Red ctermfg=DarkRed - hi phpEnvVar guifg=Red ctermfg=DarkRed - hi phpOperator guifg=SeaGreen ctermfg=DarkGreen - hi phpVarSelector guifg=SeaGreen ctermfg=DarkGreen - hi phpRelation guifg=SeaGreen ctermfg=DarkGreen - hi phpIdentifier guifg=DarkGray ctermfg=Brown - hi phpIdentifierSimply guifg=DarkGray ctermfg=Brown - else - HiLink phpIntVar Identifier - HiLink phpEnvVar Identifier - HiLink phpOperator Operator - HiLink phpVarSelector Operator - HiLink phpRelation Operator - HiLink phpIdentifier Identifier - HiLink phpIdentifierSimply Identifier - endif - - delcommand HiLink +hi def link phpConstant Constant +hi def link phpCoreConstant Constant +hi def link phpComment Comment +hi def link phpDocTags PreProc +hi def link phpDocCustomTags Type +hi def link phpException Exception +hi def link phpBoolean Boolean +hi def link phpStorageClass StorageClass +hi def link phpSCKeyword StorageClass +hi def link phpFCKeyword Define +hi def link phpStructure Structure +hi def link phpStringSingle String +hi def link phpStringDouble String +hi def link phpBacktick String +hi def link phpNumber Number +hi def link phpFloat Float +hi def link phpMethods Function +hi def link phpFunctions Function +hi def link phpBaselib Function +hi def link phpRepeat Repeat +hi def link phpConditional Conditional +hi def link phpLabel Label +hi def link phpStatement Statement +hi def link phpKeyword Statement +hi def link phpType Type +hi def link phpInclude Include +hi def link phpDefine Define +hi def link phpBackslashSequences SpecialChar +hi def link phpBackslashDoubleQuote SpecialChar +hi def link phpBackslashSingleQuote SpecialChar +hi def link phpParent Delimiter +hi def link phpBrackets Delimiter +hi def link phpIdentifierConst Delimiter +hi def link phpParentError Error +hi def link phpOctalError Error +hi def link phpInterpSimpleError Error +hi def link phpInterpBogusDollarCurley Error +hi def link phpInterpDollarCurly1 Error +hi def link phpInterpDollarCurly2 Error +hi def link phpInterpSimpleBracketsInner String +hi def link phpInterpSimpleCurly Delimiter +hi def link phpInterpVarname Identifier +hi def link phpTodo Todo +hi def link phpDocTodo Todo +hi def link phpMemberSelector Structure +if exists("php_oldStyle") + hi def phpIntVar guifg=Red ctermfg=DarkRed + hi def phpEnvVar guifg=Red ctermfg=DarkRed + hi def phpOperator guifg=SeaGreen ctermfg=DarkGreen + hi def phpVarSelector guifg=SeaGreen ctermfg=DarkGreen + hi def phpRelation guifg=SeaGreen ctermfg=DarkGreen + hi def phpIdentifier guifg=DarkGray ctermfg=Brown + hi def phpIdentifierSimply guifg=DarkGray ctermfg=Brown +else + hi def link phpIntVar Identifier + hi def link phpEnvVar Identifier + hi def link phpOperator Operator + hi def link phpVarSelector Operator + hi def link phpRelation Operator + hi def link phpIdentifier Identifier + hi def link phpIdentifierSimply Identifier endif + let b:current_syntax = "php" if main_syntax == 'php' diff --git a/runtime/syntax/pic.vim b/runtime/syntax/pic.vim index adc964ea96..bcb01f4dbd 100644 --- a/runtime/syntax/pic.vim +++ b/runtime/syntax/pic.vim @@ -5,11 +5,8 @@ " URL: http://galeb.etf.bg.ac.yu/~alexa/vim/syntax/pic.vim " Revision: 1.01 -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -91,36 +88,26 @@ syn match picDirective "#\=DEFINE" " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_pic16f84_syntax_inits") - if version < 508 - let did_pic16f84_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink picTodo Todo - HiLink picComment Comment - HiLink picDirective Statement - HiLink picLabel Label - HiLink picString String +hi def link picTodo Todo +hi def link picComment Comment +hi def link picDirective Statement +hi def link picLabel Label +hi def link picString String - "HiLink picOpcode Keyword - "HiLink picRegister Structure - "HiLink picRegisterPart Special +"hi def link picOpcode Keyword +"hi def link picRegister Structure +"hi def link picRegisterPart Special - HiLink picASCII String - HiLink picBinary Number - HiLink picDecimal Number - HiLink picHexadecimal Number - HiLink picOctal Number +hi def link picASCII String +hi def link picBinary Number +hi def link picDecimal Number +hi def link picHexadecimal Number +hi def link picOctal Number - HiLink picIdentifier Identifier +hi def link picIdentifier Identifier - delcommand HiLink -endif let b:current_syntax = "pic" diff --git a/runtime/syntax/pike.vim b/runtime/syntax/pike.vim index efbafd5d82..ccd122c46c 100644 --- a/runtime/syntax/pike.vim +++ b/runtime/syntax/pike.vim @@ -3,11 +3,8 @@ " Maintainer: Francesco Chemolli " Last Change: 2001 May 10 -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -104,51 +101,41 @@ syn match pikeBitField ";\s*\I\i*\s*:\s*[1-9]"me=e-1 syn sync ccomment pikeComment minlines=10 " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_pike_syntax_inits") - if version < 508 - let did_pike_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink pikeLabel Label - HiLink pikeUserLabel Label - HiLink pikeConditional Conditional - HiLink pikeRepeat Repeat - HiLink pikeCharacter Character - HiLink pikeSpecialCharacter pikeSpecial - HiLink pikeNumber Number - HiLink pikeFloat Float - HiLink pikeOctalError pikeError - HiLink pikeParenError pikeError - HiLink pikeInParen pikeError - HiLink pikeCommentError pikeError - HiLink pikeOperator Operator - HiLink pikeInclude Include - HiLink pikePreProc PreProc - HiLink pikeDefine Macro - HiLink pikeIncluded pikeString - HiLink pikeError Error - HiLink pikeStatement Statement - HiLink pikePreCondit PreCondit - HiLink pikeType Type - HiLink pikeCommentError pikeError - HiLink pikeCommentString pikeString - HiLink pikeComment2String pikeString - HiLink pikeCommentSkip pikeComment - HiLink pikeString String - HiLink pikeComment Comment - HiLink pikeSpecial SpecialChar - HiLink pikeTodo Todo - HiLink pikeException pikeStatement - HiLink pikeCompoundType Constant - "HiLink pikeIdentifier Identifier +hi def link pikeLabel Label +hi def link pikeUserLabel Label +hi def link pikeConditional Conditional +hi def link pikeRepeat Repeat +hi def link pikeCharacter Character +hi def link pikeSpecialCharacter pikeSpecial +hi def link pikeNumber Number +hi def link pikeFloat Float +hi def link pikeOctalError pikeError +hi def link pikeParenError pikeError +hi def link pikeInParen pikeError +hi def link pikeCommentError pikeError +hi def link pikeOperator Operator +hi def link pikeInclude Include +hi def link pikePreProc PreProc +hi def link pikeDefine Macro +hi def link pikeIncluded pikeString +hi def link pikeError Error +hi def link pikeStatement Statement +hi def link pikePreCondit PreCondit +hi def link pikeType Type +hi def link pikeCommentError pikeError +hi def link pikeCommentString pikeString +hi def link pikeComment2String pikeString +hi def link pikeCommentSkip pikeComment +hi def link pikeString String +hi def link pikeComment Comment +hi def link pikeSpecial SpecialChar +hi def link pikeTodo Todo +hi def link pikeException pikeStatement +hi def link pikeCompoundType Constant +"hi def link pikeIdentifier Identifier - delcommand HiLink -endif let b:current_syntax = "pike" diff --git a/runtime/syntax/pilrc.vim b/runtime/syntax/pilrc.vim index 86d5611589..f0e5f9bbc7 100644 --- a/runtime/syntax/pilrc.vim +++ b/runtime/syntax/pilrc.vim @@ -4,10 +4,8 @@ " Last change: 2003 May 11 " Available on: http://www.schau.com/pilrcvim/pilrc.vim -" Remove any old syntax -if version < 600 - syn clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -119,30 +117,20 @@ syn region pilrcInclude start="public class" end="}" syn sync ccomment pilrcComment -if version >= 508 || !exists("did_pilrc_syntax_inits") - if version < 508 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - let did_pilrc_syntax_inits = 1 +" The default methods for highlighting +hi def link pilrcKeyword Statement +hi def link pilrcType Type +hi def link pilrcError Error +hi def link pilrcCountry SpecialChar +hi def link pilrcLanguage SpecialChar +hi def link pilrcString SpecialChar +hi def link pilrcNumber Number +hi def link pilrcComment Comment +hi def link pilrcConstant Constant +hi def link pilrcFunction Function +hi def link pilrcInclude SpecialChar +hi def link pilrcIdentifier Number - " The default methods for highlighting - HiLink pilrcKeyword Statement - HiLink pilrcType Type - HiLink pilrcError Error - HiLink pilrcCountry SpecialChar - HiLink pilrcLanguage SpecialChar - HiLink pilrcString SpecialChar - HiLink pilrcNumber Number - HiLink pilrcComment Comment - HiLink pilrcConstant Constant - HiLink pilrcFunction Function - HiLink pilrcInclude SpecialChar - HiLink pilrcIdentifier Number - - delcommand HiLink -endif let b:current_syntax = "pilrc" diff --git a/runtime/syntax/pine.vim b/runtime/syntax/pine.vim index 4c64b9bbc7..aadf50be15 100644 --- a/runtime/syntax/pine.vim +++ b/runtime/syntax/pine.vim @@ -3,19 +3,12 @@ " Maintainer: David Pascoe " Last Change: Thu Feb 27 10:18:48 WST 2003, update for pine 4.53 -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif -if version >= 600 - setlocal iskeyword=@,48-57,_,128-167,224-235,- -else - set iskeyword=@,48-57,_,128-167,224-235,- -endif +setlocal iskeyword=@,48-57,_,128-167,224-235,- syn keyword pineConfig addrbook-sort-rule syn keyword pineConfig address-book @@ -351,21 +344,11 @@ syn keyword pineOption vertical-folder-list syn match pineComment "^#.*$" " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_pine_syn_inits") - if version < 508 - let did_pine_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink pineConfig Type - HiLink pineComment Comment - HiLink pineOption Macro - delcommand HiLink -endif +hi def link pineConfig Type +hi def link pineComment Comment +hi def link pineOption Macro let b:current_syntax = "pine" diff --git a/runtime/syntax/pinfo.vim b/runtime/syntax/pinfo.vim index bf4126e59a..cb9e60ebb3 100644 --- a/runtime/syntax/pinfo.vim +++ b/runtime/syntax/pinfo.vim @@ -1,7 +1,7 @@ " Vim syntax file -" Language: pinfo(1) configuration file -" Maintainer: Nikolai Weibull -" Latest Revision: 2007-06-17 +" Language: pinfo(1) configuration file +" Previous Maintainer: Nikolai Weibull +" Latest Revision: 2007-06-17 if exists("b:current_syntax") finish diff --git a/runtime/syntax/plaintex.vim b/runtime/syntax/plaintex.vim index 7020c68e9b..5cb49a0bfc 100644 --- a/runtime/syntax/plaintex.vim +++ b/runtime/syntax/plaintex.vim @@ -1,7 +1,7 @@ " Vim syntax file -" Language: TeX (plain.tex format) -" Maintainer: Nikolai Weibull -" Latest Revision: 2006-10-26 +" Language: TeX (plain.tex format) +" Previous Maintainer: Nikolai Weibull +" Latest Revision: 2006-10-26 if exists("b:current_syntax") finish diff --git a/runtime/syntax/pli.vim b/runtime/syntax/pli.vim index f8d7e51cf3..a274cc40bf 100644 --- a/runtime/syntax/pli.vim +++ b/runtime/syntax/pli.vim @@ -3,9 +3,8 @@ " using keywords from http://www.kednos.com/pli/docs/reference_manual/6291pro_contents.html " 2012-11-13 Alan Thompson -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -222,57 +221,46 @@ endif syn sync minlines=10 maxlines=100 " Define the default highlighting. -" For version 5.x and earlier, only when not done already. -" For version 5.8 and later, only when and item doesn't have highlighting -" yet. -if version >= 508 || !exists("did_pl1_syn_inits") - if version < 508 - let did_pl1_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when and item doesn't have highlighting yet. - HiLink pl1Attribute Macro - HiLink pl1BlockError Error - HiLink pl1BooleanLiteral Boolean - HiLink pl1CharLiteral Character - HiLink pl1Comment Comment - HiLink pl1CommentL Comment - HiLink pl1Conditional Conditional - HiLink pl1Error Error - HiLink pl1ErrInBracket Error - HiLink pl1ErrInBlock Error - HiLink pl1ErrInParen Error - HiLink pl1Exception Function - HiLink pl1FloatLiteral Float - HiLink pl1Function Function - HiLink pl1Garbage Error - HiLink pl1HostIdentifier Label - HiLink pl1Identifier Normal - HiLink pl1IntLiteral Number - HiLink pl1Operator Operator - HiLink pl1Paren Normal - HiLink pl1ParenError Error - HiLink pl1SpaceError Error - HiLink pl1Pseudo PreProc - HiLink pl1PreProc PreProc - HiLink pl1PreProcSym PreProc - HiLink pl1Keyword Keyword - HiLink pl1Other Keyword - HiLink pl1Repeat Repeat - HiLink pl1Statement Keyword - HiLink pl1Storage StorageClass - HiLink pl1StringError Error - HiLink pl1StringLiteral String - HiLink pl1CommentString String - HiLink pl1Comment2String String - HiLink pl1Symbol Normal - HiLink pl1Trigger Function - HiLink pl1TypeAttribute StorageClass - HiLink pl1Todo Todo +hi def link pl1Attribute Macro +hi def link pl1BlockError Error +hi def link pl1BooleanLiteral Boolean +hi def link pl1CharLiteral Character +hi def link pl1Comment Comment +hi def link pl1CommentL Comment +hi def link pl1Conditional Conditional +hi def link pl1Error Error +hi def link pl1ErrInBracket Error +hi def link pl1ErrInBlock Error +hi def link pl1ErrInParen Error +hi def link pl1Exception Function +hi def link pl1FloatLiteral Float +hi def link pl1Function Function +hi def link pl1Garbage Error +hi def link pl1HostIdentifier Label +hi def link pl1Identifier Normal +hi def link pl1IntLiteral Number +hi def link pl1Operator Operator +hi def link pl1Paren Normal +hi def link pl1ParenError Error +hi def link pl1SpaceError Error +hi def link pl1Pseudo PreProc +hi def link pl1PreProc PreProc +hi def link pl1PreProcSym PreProc +hi def link pl1Keyword Keyword +hi def link pl1Other Keyword +hi def link pl1Repeat Repeat +hi def link pl1Statement Keyword +hi def link pl1Storage StorageClass +hi def link pl1StringError Error +hi def link pl1StringLiteral String +hi def link pl1CommentString String +hi def link pl1Comment2String String +hi def link pl1Symbol Normal +hi def link pl1Trigger Function +hi def link pl1TypeAttribute StorageClass +hi def link pl1Todo Todo - delcommand HiLink -endif let b:current_syntax = "pl1" diff --git a/runtime/syntax/plm.vim b/runtime/syntax/plm.vim index bf7c32fd1c..c6618adacb 100644 --- a/runtime/syntax/plm.vim +++ b/runtime/syntax/plm.vim @@ -3,11 +3,8 @@ " Maintainer: Philippe Coulonges " Last change: 2003 May 11 -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -103,43 +100,33 @@ syn keyword plm386w16BuiltIn SETD SKIPD SKIPRD syn sync lines=50 " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_plm_syntax_inits") - if version < 508 - let did_plm_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - " The default methods for highlighting. Can be overridden later -" HiLink plmLabel Label -" HiLink plmConditional Conditional -" HiLink plmRepeat Repeat - HiLink plmTodo Todo - HiLink plmNumber Number - HiLink plmOperator Operator - HiLink plmDelimiter Operator - "HiLink plmShowTab Error - "HiLink plmShowTabc Error - HiLink plmIdentifier Identifier - HiLink plmBuiltIn Statement - HiLink plm286BuiltIn Statement - HiLink plm386BuiltIn Statement - HiLink plm386w16BuiltIn Statement - HiLink plmReserved Statement - HiLink plm386Reserved Statement - HiLink plmPreProc PreProc - HiLink plmCommentError plmError - HiLink plmCommentString plmString - HiLink plmComment2String plmString - HiLink plmCommentSkip plmComment - HiLink plmString String - HiLink plmComment Comment +" The default methods for highlighting. Can be overridden later +" hi def link plmLabel Label +" hi def link plmConditional Conditional +" hi def link plmRepeat Repeat +hi def link plmTodo Todo +hi def link plmNumber Number +hi def link plmOperator Operator +hi def link plmDelimiter Operator +"hi def link plmShowTab Error +"hi def link plmShowTabc Error +hi def link plmIdentifier Identifier +hi def link plmBuiltIn Statement +hi def link plm286BuiltIn Statement +hi def link plm386BuiltIn Statement +hi def link plm386w16BuiltIn Statement +hi def link plmReserved Statement +hi def link plm386Reserved Statement +hi def link plmPreProc PreProc +hi def link plmCommentError plmError +hi def link plmCommentString plmString +hi def link plmComment2String plmString +hi def link plmCommentSkip plmComment +hi def link plmString String +hi def link plmComment Comment - delcommand HiLink -endif let b:current_syntax = "plm" diff --git a/runtime/syntax/plp.vim b/runtime/syntax/plp.vim index f59702d3b5..48dc4b249e 100644 --- a/runtime/syntax/plp.vim +++ b/runtime/syntax/plp.vim @@ -7,11 +7,8 @@ " Add to filetype.vim the following line (without quote sign): " au BufNewFile,BufRead *.plp setf plp -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -19,14 +16,9 @@ if !exists("main_syntax") let main_syntax = 'perlscript' endif -if version < 600 - so :p:h/html.vim - syn include @PLPperl :p:h/perl.vim -else - runtime! syntax/html.vim - unlet b:current_syntax - syn include @PLPperl syntax/perl.vim -endif +runtime! syntax/html.vim +unlet b:current_syntax +syn include @PLPperl syntax/perl.vim syn cluster htmlPreproc add=PLPperlblock diff --git a/runtime/syntax/plsql.vim b/runtime/syntax/plsql.vim index 6e513660f8..1868c9cb16 100644 --- a/runtime/syntax/plsql.vim +++ b/runtime/syntax/plsql.vim @@ -9,11 +9,8 @@ " Austin Ziegler (austin at halostatue dot ca) " Added 8i+ features. " -" For version 5.x, clear all syntax items. -" For version 6.x, quit when a syntax file was already loaded. -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -223,54 +220,44 @@ endif syn sync minlines=10 maxlines=100 " Define the default highlighting. -" For version 5.x and earlier, only when not done already. -" For version 5.8 and later, only when an item doesn't have highlighting yet. -if version >= 508 || !exists("did_plsql_syn_inits") - if version < 508 - let did_plsql_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet. - HiLink plsqlAttribute Macro - HiLink plsqlBlockError Error - HiLink plsqlBooleanLiteral Boolean - HiLink plsqlCharLiteral Character - HiLink plsqlComment Comment - HiLink plsqlCommentL Comment - HiLink plsqlConditional Conditional - HiLink plsqlError Error - HiLink plsqlErrInBracket Error - HiLink plsqlErrInBlock Error - HiLink plsqlErrInParen Error - HiLink plsqlException Function - HiLink plsqlFloatLiteral Float - HiLink plsqlFunction Function - HiLink plsqlGarbage Error - HiLink plsqlHostIdentifier Label - HiLink plsqlIdentifier Normal - HiLink plsqlIntLiteral Number - HiLink plsqlOperator Operator - HiLink plsqlParen Normal - HiLink plsqlParenError Error - HiLink plsqlSpaceError Error - HiLink plsqlPseudo PreProc - HiLink plsqlKeyword Keyword - HiLink plsqlRepeat Repeat - HiLink plsqlStorage StorageClass - HiLink plsqlSQLKeyword Function - HiLink plsqlStringError Error - HiLink plsqlStringLiteral String - HiLink plsqlCommentString String - HiLink plsqlComment2String String - HiLink plsqlSymbol Normal - HiLink plsqlTrigger Function - HiLink plsqlTypeAttribute StorageClass - HiLink plsqlTodo Todo +hi def link plsqlAttribute Macro +hi def link plsqlBlockError Error +hi def link plsqlBooleanLiteral Boolean +hi def link plsqlCharLiteral Character +hi def link plsqlComment Comment +hi def link plsqlCommentL Comment +hi def link plsqlConditional Conditional +hi def link plsqlError Error +hi def link plsqlErrInBracket Error +hi def link plsqlErrInBlock Error +hi def link plsqlErrInParen Error +hi def link plsqlException Function +hi def link plsqlFloatLiteral Float +hi def link plsqlFunction Function +hi def link plsqlGarbage Error +hi def link plsqlHostIdentifier Label +hi def link plsqlIdentifier Normal +hi def link plsqlIntLiteral Number +hi def link plsqlOperator Operator +hi def link plsqlParen Normal +hi def link plsqlParenError Error +hi def link plsqlSpaceError Error +hi def link plsqlPseudo PreProc +hi def link plsqlKeyword Keyword +hi def link plsqlRepeat Repeat +hi def link plsqlStorage StorageClass +hi def link plsqlSQLKeyword Function +hi def link plsqlStringError Error +hi def link plsqlStringLiteral String +hi def link plsqlCommentString String +hi def link plsqlComment2String String +hi def link plsqlSymbol Normal +hi def link plsqlTrigger Function +hi def link plsqlTypeAttribute StorageClass +hi def link plsqlTodo Todo - delcommand HiLink -endif let b:current_syntax = "plsql" diff --git a/runtime/syntax/po.vim b/runtime/syntax/po.vim index 2ab13ac0b1..15d09b18bd 100644 --- a/runtime/syntax/po.vim +++ b/runtime/syntax/po.vim @@ -6,11 +6,8 @@ " Leonardo Fontenelle (Spell checking) " Nam SungHyun (Original maintainer) -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif let s:keepcpo= &cpo @@ -82,61 +79,51 @@ syn match poAcceleratorStr contained "[^&_~][&_~]\(\a\|\d\)[^:]"ms=s+1,me=e-1 c syn match poVariable contained "%\d" " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_po_syn_inits") - if version < 508 - let did_po_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink poCommentSources PreProc - HiLink poComment Comment - HiLink poCommentAutomatic Comment - HiLink poCommentTranslator Comment - HiLink poCommentFlags Special - HiLink poCommentDiff Comment - HiLink poCopyrightUnset Todo - HiLink poFlagFuzzy Todo - HiLink poDiffOld Todo - HiLink poDiffNew Special - HiLink poObsolete Comment +hi def link poCommentSources PreProc +hi def link poComment Comment +hi def link poCommentAutomatic Comment +hi def link poCommentTranslator Comment +hi def link poCommentFlags Special +hi def link poCommentDiff Comment +hi def link poCopyrightUnset Todo +hi def link poFlagFuzzy Todo +hi def link poDiffOld Todo +hi def link poDiffNew Special +hi def link poObsolete Comment - HiLink poStatementMsgid Statement - HiLink poStatementMsgstr Statement - HiLink poStatementMsgidplural Statement - HiLink poStatementMsgCTxt Statement - HiLink poPluralCaseN Constant +hi def link poStatementMsgid Statement +hi def link poStatementMsgstr Statement +hi def link poStatementMsgidplural Statement +hi def link poStatementMsgCTxt Statement +hi def link poPluralCaseN Constant - HiLink poStringCTxt Comment - HiLink poStringID String - HiLink poStringSTR String - HiLink poCommentKDE Comment - HiLink poCommentKDEError Error - HiLink poPluralKDE Comment - HiLink poPluralKDEError Error - HiLink poHeaderItem Identifier - HiLink poHeaderUndefined Todo - HiLink poKDEdesktopFile Identifier +hi def link poStringCTxt Comment +hi def link poStringID String +hi def link poStringSTR String +hi def link poCommentKDE Comment +hi def link poCommentKDEError Error +hi def link poPluralKDE Comment +hi def link poPluralKDEError Error +hi def link poHeaderItem Identifier +hi def link poHeaderUndefined Todo +hi def link poKDEdesktopFile Identifier - HiLink poHtml Identifier - HiLink poHtmlNot String - HiLink poHtmlTranslatables String - HiLink poLineBreak String +hi def link poHtml Identifier +hi def link poHtmlNot String +hi def link poHtmlTranslatables String +hi def link poLineBreak String - HiLink poFormat poSpecial - HiLink poSpecial Special - HiLink poAcceleratorId Special - HiLink poAcceleratorStr Special - HiLink poVariable Special +hi def link poFormat poSpecial +hi def link poSpecial Special +hi def link poAcceleratorId Special +hi def link poAcceleratorStr Special +hi def link poVariable Special - HiLink poMsguniqError Special - HiLink poMsguniqErrorMarkers Comment +hi def link poMsguniqError Special +hi def link poMsguniqErrorMarkers Comment - delcommand HiLink -endif let b:current_syntax = "po" diff --git a/runtime/syntax/pod.vim b/runtime/syntax/pod.vim index b9f2e0854f..604713260b 100644 --- a/runtime/syntax/pod.vim +++ b/runtime/syntax/pod.vim @@ -4,7 +4,7 @@ " Previously: Scott Bigham " Homepage: http://github.com/vim-perl/vim-perl " Bugs/requests: http://github.com/vim-perl/vim-perl/issues -" Last Change: 2013-07-21 +" Last Change: 2017-09-12 " To add embedded POD documentation highlighting to your syntax file, add " the commands: @@ -19,11 +19,8 @@ " Remove any old syntax stuff hanging around (this is suppressed " automatically by ":syn include" if necessary). -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -67,28 +64,17 @@ syn match podEscape "\I\i*>"me=e-1 contained contains=@NoSpell syn match podEscape2 "\d\+>"me=e-1 contained contains=@NoSpell " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_pod_syntax_inits") - if version < 508 - let did_pod_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink podCommand Statement - HiLink podCmdText String - HiLink podOverIndent Number - HiLink podForKeywd Identifier - HiLink podFormat Identifier - HiLink podVerbatimLine PreProc - HiLink podSpecial Identifier - HiLink podEscape String - HiLink podEscape2 Number - - delcommand HiLink -endif +hi def link podCommand Statement +hi def link podCmdText String +hi def link podOverIndent Number +hi def link podForKeywd Identifier +hi def link podFormat Identifier +hi def link podVerbatimLine PreProc +hi def link podSpecial Identifier +hi def link podEscape String +hi def link podEscape2 Number if exists("perl_pod_spellcheck_headings") " Spell-check headings diff --git a/runtime/syntax/postscr.vim b/runtime/syntax/postscr.vim index 8b051d33b3..d5dc9a22d6 100644 --- a/runtime/syntax/postscr.vim +++ b/runtime/syntax/postscr.vim @@ -13,11 +13,8 @@ " postscr_encodings - highlight encoding names (there are a lot) " postscr_andornot_binary - highlight and, or, and not as binary operators (not logical) " -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -25,11 +22,7 @@ endif syn case match " Keyword characters - all 7-bit ASCII bar PS delimiters and ws -if version >= 600 - setlocal iskeyword=33-127,^(,^),^<,^>,^[,^],^{,^},^/,^% -else - set iskeyword=33-127,^(,^),^<,^>,^[,^],^{,^},^/,^% -endif +setlocal iskeyword=33-127,^(,^),^<,^>,^[,^],^{,^},^/,^% " Yer trusty old TODO highlghter! syn keyword postscrTodo contained TODO @@ -730,68 +723,58 @@ if exists("postscr_ghostscript") endif " GhostScript highlighting " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_postscr_syntax_inits") - if version < 508 - let did_postscr_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink postscrComment Comment +hi def link postscrComment Comment - HiLink postscrConstant Constant - HiLink postscrString String - HiLink postscrASCIIString postscrString - HiLink postscrHexString postscrString - HiLink postscrASCII85String postscrString - HiLink postscrNumber Number - HiLink postscrInteger postscrNumber - HiLink postscrHex postscrNumber - HiLink postscrRadix postscrNumber - HiLink postscrFloat Float - HiLink postscrBoolean Boolean +hi def link postscrConstant Constant +hi def link postscrString String +hi def link postscrASCIIString postscrString +hi def link postscrHexString postscrString +hi def link postscrASCII85String postscrString +hi def link postscrNumber Number +hi def link postscrInteger postscrNumber +hi def link postscrHex postscrNumber +hi def link postscrRadix postscrNumber +hi def link postscrFloat Float +hi def link postscrBoolean Boolean - HiLink postscrIdentifier Identifier - HiLink postscrProcedure Function +hi def link postscrIdentifier Identifier +hi def link postscrProcedure Function - HiLink postscrName Statement - HiLink postscrConditional Conditional - HiLink postscrRepeat Repeat - HiLink postscrL2Repeat postscrRepeat - HiLink postscrOperator Operator - HiLink postscrL1Operator postscrOperator - HiLink postscrL2Operator postscrOperator - HiLink postscrL3Operator postscrOperator - HiLink postscrMathOperator postscrOperator - HiLink postscrLogicalOperator postscrOperator - HiLink postscrBinaryOperator postscrOperator +hi def link postscrName Statement +hi def link postscrConditional Conditional +hi def link postscrRepeat Repeat +hi def link postscrL2Repeat postscrRepeat +hi def link postscrOperator Operator +hi def link postscrL1Operator postscrOperator +hi def link postscrL2Operator postscrOperator +hi def link postscrL3Operator postscrOperator +hi def link postscrMathOperator postscrOperator +hi def link postscrLogicalOperator postscrOperator +hi def link postscrBinaryOperator postscrOperator - HiLink postscrDSCComment SpecialComment - HiLink postscrSpecialChar SpecialChar +hi def link postscrDSCComment SpecialComment +hi def link postscrSpecialChar SpecialChar - HiLink postscrTodo Todo +hi def link postscrTodo Todo - HiLink postscrError Error - HiLink postscrSpecialCharError postscrError - HiLink postscrASCII85CharError postscrError - HiLink postscrHexCharError postscrError - HiLink postscrASCIIStringError postscrError - HiLink postscrIdentifierError postscrError +hi def link postscrError Error +hi def link postscrSpecialCharError postscrError +hi def link postscrASCII85CharError postscrError +hi def link postscrHexCharError postscrError +hi def link postscrASCIIStringError postscrError +hi def link postscrIdentifierError postscrError - if exists("postscr_ghostscript") - HiLink postscrGSOperator postscrOperator - HiLink postscrGSMathOperator postscrMathOperator - else - HiLink postscrGSOperator postscrError - HiLink postscrGSMathOperator postscrError - endif - - delcommand HiLink +if exists("postscr_ghostscript") +hi def link postscrGSOperator postscrOperator +hi def link postscrGSMathOperator postscrMathOperator +else +hi def link postscrGSOperator postscrError +hi def link postscrGSMathOperator postscrError endif + let b:current_syntax = "postscr" " vim: ts=8 diff --git a/runtime/syntax/pov.vim b/runtime/syntax/pov.vim index 4c1fd9624a..8595bcb151 100644 --- a/runtime/syntax/pov.vim +++ b/runtime/syntax/pov.vim @@ -5,14 +5,8 @@ " Required Vim Version: 6.0 " Setup -if version >= 600 - " Quit when a syntax file was already loaded - if exists("b:current_syntax") - finish - endif -else - " Croak when an old Vim is sourcing us. - echo "Sorry, but this syntax file relies on Vim 6 features. Either upgrade Vim or use a version of " . expand(":t:r") . " syntax file appropriate for Vim " . version/100 . "." . version %100 . "." +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif diff --git a/runtime/syntax/povini.vim b/runtime/syntax/povini.vim index 726fe1fc74..ac1f87875e 100644 --- a/runtime/syntax/povini.vim +++ b/runtime/syntax/povini.vim @@ -5,14 +5,8 @@ " Required Vim Version: 6.0 " Setup -if version >= 600 - " Quit when a syntax file was already loaded - if exists("b:current_syntax") - finish - endif -else - " Croak when an old Vim is sourcing us. - echo "Sorry, but this syntax file relies on Vim 6 features. Either upgrade Vim or usea version of " . expand(":t:r") . " syntax file appropriate for Vim " . version/100 . "." . version %100 . "." +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif diff --git a/runtime/syntax/ppd.vim b/runtime/syntax/ppd.vim index 192f70c05d..da67e1f39f 100644 --- a/runtime/syntax/ppd.vim +++ b/runtime/syntax/ppd.vim @@ -3,11 +3,8 @@ " Maintainer: Bjoern Jacke " Last Change: 2001-10-06 -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -21,27 +18,17 @@ syn match ppdGUIText "/.*:" syn match ppdContraints "^*UIConstraints:" " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_ahdl_syn_inits") - if version < 508 - let did_ahdl_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink ppdComment Comment - HiLink ppdDefine Statement - HiLink ppdUI Function - HiLink ppdUIGroup Function - HiLink ppdDef String - HiLink ppdGUIText Type - HiLink ppdContraints Special +hi def link ppdComment Comment +hi def link ppdDefine Statement +hi def link ppdUI Function +hi def link ppdUIGroup Function +hi def link ppdDef String +hi def link ppdGUIText Type +hi def link ppdContraints Special - delcommand HiLink -endif let b:current_syntax = "ppd" diff --git a/runtime/syntax/ppwiz.vim b/runtime/syntax/ppwiz.vim index d3d7b3a17a..514f8f36cc 100644 --- a/runtime/syntax/ppwiz.vim +++ b/runtime/syntax/ppwiz.vim @@ -6,11 +6,8 @@ " Filename: ppwiz.vim " Remove old syntax stuff -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -63,33 +60,23 @@ syn match ppwizInteger "\d\+" contained syn cluster ppwizArgVal add=ppwizString,ppwizInteger " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_ppwiz_syn_inits") - if version < 508 - let did_ppwiz_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink ppwizSpecial Special - HiLink ppwizEqual ppwizSpecial - HiLink ppwizOperator ppwizSpecial - HiLink ppwizComment Comment - HiLink ppwizDef PreProc - HiLink ppwizMacro Statement - HiLink ppwizArg Identifier - HiLink ppwizStdVar Identifier - HiLink ppwizRexxVar Identifier - HiLink ppwizString Constant - HiLink ppwizInteger Constant - HiLink ppwizCont ppwizSpecial - HiLink ppwizError Error - HiLink ppwizHTML Type +hi def link ppwizSpecial Special +hi def link ppwizEqual ppwizSpecial +hi def link ppwizOperator ppwizSpecial +hi def link ppwizComment Comment +hi def link ppwizDef PreProc +hi def link ppwizMacro Statement +hi def link ppwizArg Identifier +hi def link ppwizStdVar Identifier +hi def link ppwizRexxVar Identifier +hi def link ppwizString Constant +hi def link ppwizInteger Constant +hi def link ppwizCont ppwizSpecial +hi def link ppwizError Error +hi def link ppwizHTML Type - delcommand HiLink -endif let b:current_syntax = "ppwiz" diff --git a/runtime/syntax/prescribe.vim b/runtime/syntax/prescribe.vim index d89ee35253..cd5ddbeedd 100644 --- a/runtime/syntax/prescribe.vim +++ b/runtime/syntax/prescribe.vim @@ -4,11 +4,8 @@ " URL: http://www.hampft.de/vim/syntax/prescribe.vim " Last Change: 2005 Mar 04 -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -44,25 +41,15 @@ syn region prescribeString start=+'+ end=+'+ skip=+\\'+ syn region prescribeComment start=+CMNT+ end=+;+ " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_prescribe_syn_inits") - if version < 508 - let did_prescribe_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink prescribeSpecial PreProc - HiLink prescribeStatement Statement - HiLink prescribeNumber Number - HiLink prescribeCSETArg String - HiLink prescribeFRPOArg String - HiLink prescribeComment Comment +hi def link prescribeSpecial PreProc +hi def link prescribeStatement Statement +hi def link prescribeNumber Number +hi def link prescribeCSETArg String +hi def link prescribeFRPOArg String +hi def link prescribeComment Comment - delcommand HiLink -endif let b:current_syntax = "prescribe" diff --git a/runtime/syntax/procmail.vim b/runtime/syntax/procmail.vim index c2ffa39883..93f50fe9ef 100644 --- a/runtime/syntax/procmail.vim +++ b/runtime/syntax/procmail.vim @@ -4,11 +4,8 @@ " Last Change: 2003 Aug 14 " Author: Sonia Heimann -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -33,34 +30,24 @@ syn region procmailActionNested start=+^\s*{+ end=+^\s*}+ contains=procmailRecip syn region procmailRecipe start=+^\s*:.*$+ end=+^\s*\($\|}\)+me=e-1 contains=procmailComment,procmailCondition,procmailActionFolder,procmailActionVariable,procmailActionForward,procmailActionPipe,procmailActionNested,procmailVarDeclRegion " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_procmail_syntax_inits") - if version < 508 - let did_procmail_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink procmailComment Comment - HiLink procmailTodo Todo +hi def link procmailComment Comment +hi def link procmailTodo Todo - HiLink procmailRecipe Statement - "HiLink procmailCondition Statement +hi def link procmailRecipe Statement +"hi def link procmailCondition Statement - HiLink procmailActionFolder procmailAction - HiLink procmailActionVariable procmailAction - HiLink procmailActionForward procmailAction - HiLink procmailActionPipe procmailAction - HiLink procmailAction Function - HiLink procmailVar Identifier - HiLink procmailVarDecl Identifier +hi def link procmailActionFolder procmailAction +hi def link procmailActionVariable procmailAction +hi def link procmailActionForward procmailAction +hi def link procmailActionPipe procmailAction +hi def link procmailAction Function +hi def link procmailVar Identifier +hi def link procmailVarDecl Identifier - HiLink procmailString String +hi def link procmailString String - delcommand HiLink -endif let b:current_syntax = "procmail" diff --git a/runtime/syntax/progress.vim b/runtime/syntax/progress.vim index 85a54a6505..5e7cfef299 100644 --- a/runtime/syntax/progress.vim +++ b/runtime/syntax/progress.vim @@ -11,22 +11,15 @@ " Version: 13 " Last Change: Nov 11 2012 -" For version 5.x: Clear all syntax item -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif let s:cpo_save = &cpo set cpo&vim -if version >= 600 - setlocal iskeyword=@,48-57,_,-,!,#,$,% -else - set iskeyword=@,48-57,_,-,!,#,$,% -endif +setlocal iskeyword=@,48-57,_,-,!,#,$,% " The Progress editor doesn't cope with tabs very well. set expandtab @@ -282,44 +275,34 @@ syn keyword ProgressType char[acter] int[eger] int64 dec[imal] log[ical] da[te] syn sync lines=800 " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_progress_syntax_inits") - if version < 508 - let did_progress_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - " The default methods for highlighting. Can be overridden later. - HiLink ProgressByte Number - HiLink ProgressCase Repeat - HiLink ProgressComment Comment - HiLink ProgressConditional Conditional - HiLink ProgressDebug Debug - HiLink ProgressDo Repeat - HiLink ProgressEndError Error - HiLink ProgressFor Repeat - HiLink ProgressFunction Procedure - HiLink ProgressIdentifier Identifier - HiLink ProgressInclude Include - HiLink ProgressMatrixDelimiter Identifier - HiLink ProgressNumber Number - HiLink ProgressOperator Operator - HiLink ProgressPreProc PreProc - HiLink ProgressProcedure Procedure - HiLink ProgressQuote Delimiter - HiLink ProgressRepeat Repeat - HiLink ProgressReserved Statement - HiLink ProgressSpaceError Error - HiLink ProgressString String - HiLink ProgressTodo Todo - HiLink ProgressType Statement - HiLink ProgressShowTab Error +" The default methods for highlighting. Can be overridden later. +hi def link ProgressByte Number +hi def link ProgressCase Repeat +hi def link ProgressComment Comment +hi def link ProgressConditional Conditional +hi def link ProgressDebug Debug +hi def link ProgressDo Repeat +hi def link ProgressEndError Error +hi def link ProgressFor Repeat +hi def link ProgressFunction Procedure +hi def link ProgressIdentifier Identifier +hi def link ProgressInclude Include +hi def link ProgressMatrixDelimiter Identifier +hi def link ProgressNumber Number +hi def link ProgressOperator Operator +hi def link ProgressPreProc PreProc +hi def link ProgressProcedure Procedure +hi def link ProgressQuote Delimiter +hi def link ProgressRepeat Repeat +hi def link ProgressReserved Statement +hi def link ProgressSpaceError Error +hi def link ProgressString String +hi def link ProgressTodo Todo +hi def link ProgressType Statement +hi def link ProgressShowTab Error - delcommand HiLink -endif let b:current_syntax = "progress" diff --git a/runtime/syntax/prolog.vim b/runtime/syntax/prolog.vim index f5f0e673ec..3b09bb3548 100644 --- a/runtime/syntax/prolog.vim +++ b/runtime/syntax/prolog.vim @@ -1,17 +1,17 @@ " Vim syntax file " Language: PROLOG -" Maintainers: Thomas Koehler -" Last Change: 2013 May 23 +" Maintainer: Thomas Koehler +" Please be aware: I'm often slow to answer email due to a high +" non-computer related workload (sometimes 4-8 weeks) +" Last Change: 2016 September 6 " URL: http://gott-gehabt.de/800_wer_wir_sind/thomas/Homepage/Computer/vim/syntax/prolog.vim " There are two sets of highlighting in here: " If the "prolog_highlighting_clean" variable exists, it is rather sparse. " Otherwise you get more highlighting. -" Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -78,46 +78,36 @@ syn sync maxlines=50 " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_prolog_syn_inits") - if version < 508 - let did_prolog_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - " The default highlighting. - HiLink prologComment Comment - HiLink prologCComment Comment - HiLink prologCharCode Special +" The default highlighting. +hi def link prologComment Comment +hi def link prologCComment Comment +hi def link prologCharCode Special - if exists ("prolog_highlighting_clean") +if exists ("prolog_highlighting_clean") - HiLink prologKeyword Statement - HiLink prologClauseHead Statement - HiLink prologClause Normal +hi def link prologKeyword Statement +hi def link prologClauseHead Statement +hi def link prologClause Normal - else +else - HiLink prologKeyword Keyword - HiLink prologClauseHead Constant - HiLink prologClause Normal - HiLink prologQuestion PreProc - HiLink prologSpecialCharacter Special - HiLink prologNumber Number - HiLink prologAsIs Normal - HiLink prologCommentError Error - HiLink prologAtom String - HiLink prologString String - HiLink prologOperator Operator +hi def link prologKeyword Keyword +hi def link prologClauseHead Constant +hi def link prologClause Normal +hi def link prologQuestion PreProc +hi def link prologSpecialCharacter Special +hi def link prologNumber Number +hi def link prologAsIs Normal +hi def link prologCommentError Error +hi def link prologAtom String +hi def link prologString String +hi def link prologOperator Operator - endif - - delcommand HiLink endif + let b:current_syntax = "prolog" " vim: ts=8 diff --git a/runtime/syntax/promela.vim b/runtime/syntax/promela.vim index e812bc2749..add4514561 100644 --- a/runtime/syntax/promela.vim +++ b/runtime/syntax/promela.vim @@ -5,11 +5,8 @@ " Last Change: Thu Aug 7 21:22:48 CEST 2008 " Version: 0.5 -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif diff --git a/runtime/syntax/proto.vim b/runtime/syntax/proto.vim index 4d6a77e84a..4615e0ca0e 100644 --- a/runtime/syntax/proto.vim +++ b/runtime/syntax/proto.vim @@ -22,9 +22,8 @@ " " http://code.google.com/p/protobuf/ -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif diff --git a/runtime/syntax/protocols.vim b/runtime/syntax/protocols.vim index 1dc109caf6..f31ca5a4b7 100644 --- a/runtime/syntax/protocols.vim +++ b/runtime/syntax/protocols.vim @@ -1,7 +1,7 @@ " Vim syntax file -" Language: protocols(5) - Internet protocols definition file -" Maintainer: Nikolai Weibull -" Latest Revision: 2006-04-19 +" Language: protocols(5) - Internet protocols definition file +" Previous Maintainer: Nikolai Weibull +" Latest Revision: 2006-04-19 if exists("b:current_syntax") finish diff --git a/runtime/syntax/psf.vim b/runtime/syntax/psf.vim index 2b376f94cc..0971fe96bf 100644 --- a/runtime/syntax/psf.vim +++ b/runtime/syntax/psf.vim @@ -4,10 +4,8 @@ " Maintainer: Rex Barzee " Last change: 25 Apr 2001 -if version < 600 - " Remove any old syntax stuff hanging around - syn clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -73,27 +71,17 @@ syn match psfComment "#.*$" " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_psf_syntax_inits") - if version < 508 - let did_psf_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink psfObject Statement - HiLink psfAttrib Type - HiLink psfQuotString String - HiLink psfObjTag Identifier - HiLink psfAttAbbrev PreProc - HiLink psfObjTags Identifier +hi def link psfObject Statement +hi def link psfAttrib Type +hi def link psfQuotString String +hi def link psfObjTag Identifier +hi def link psfAttAbbrev PreProc +hi def link psfObjTags Identifier - HiLink psfComment Comment +hi def link psfComment Comment - delcommand HiLink -endif " Long descriptions and copyrights confuse the syntax highlighting, so " force vim to backup at least 100 lines before the top visible line diff --git a/runtime/syntax/ptcap.vim b/runtime/syntax/ptcap.vim index 45590cf61b..1ebeb5227b 100644 --- a/runtime/syntax/ptcap.vim +++ b/runtime/syntax/ptcap.vim @@ -4,11 +4,8 @@ " URL: http://folk.uio.no/hakonrk/vim/syntax/ptcap.vim " Last Change: 2001 May 15 -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syn clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -73,34 +70,25 @@ syn region ptcapField start=":" skip="[^\\]\(\\\\\)*\\$" end="[^\\]\(\\\\\)* syn region ptcapString matchgroup=ptcapOperator start="=" skip="[^\\]\(\\\\\)*\\:" matchgroup=ptcapDelimiter end=":"me=e-1 matchgroup=NONE end="[^\\]\(\\\\\)*[^\\]$" end="^$" contains=ptcapEscapedChar,ptcapLineCont keepend contained syn region ptcapComment start="^\s*#" end="$" contains=ptcapLeadBlank -if version >= 508 || !exists("did_ptcap_syntax_inits") - if version < 508 - let did_ptcap_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - HiLink ptcapComment Comment - HiLink ptcapDelimiter Delimiter - " The highlighting of "ptcapEntry" should always be overridden by - " its contents, so I use Todo highlighting to indicate that there - " is work to be done with the syntax file if you can see it :-) - HiLink ptcapEntry Todo - HiLink ptcapError Error - HiLink ptcapEscapedChar SpecialChar - HiLink ptcapField Type - HiLink ptcapLeadBlank NONE - HiLink ptcapLineCont Special - HiLink ptcapNames Label - HiLink ptcapNumber NONE - HiLink ptcapNumberError Error - HiLink ptcapOperator Operator - HiLink ptcapSpecialCap Type - HiLink ptcapString NONE +hi def link ptcapComment Comment +hi def link ptcapDelimiter Delimiter +" The highlighting of "ptcapEntry" should always be overridden by +" its contents, so I use Todo highlighting to indicate that there +" is work to be done with the syntax file if you can see it :-) +hi def link ptcapEntry Todo +hi def link ptcapError Error +hi def link ptcapEscapedChar SpecialChar +hi def link ptcapField Type +hi def link ptcapLeadBlank NONE +hi def link ptcapLineCont Special +hi def link ptcapNames Label +hi def link ptcapNumber NONE +hi def link ptcapNumberError Error +hi def link ptcapOperator Operator +hi def link ptcapSpecialCap Type +hi def link ptcapString NONE - delcommand HiLink -endif let b:current_syntax = "ptcap" diff --git a/runtime/syntax/purifylog.vim b/runtime/syntax/purifylog.vim index 8bcfb4b006..2143d9fe28 100644 --- a/runtime/syntax/purifylog.vim +++ b/runtime/syntax/purifylog.vim @@ -3,11 +3,8 @@ " Maintainer: Gautam H. Mudunuri " Last Change: 2003 May 11 -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -57,62 +54,52 @@ syn match purifyLogZPR "^ZPR:.*$" syn match purifyLogZPW "^ZPW:.*$" " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_purifyLog_syntax_inits") - if version < 508 - let did_purifyLog_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink purifyLogFIU purifyLogInformational - HiLink purifyLogMAF purifyLogInformational - HiLink purifyLogMIU purifyLogInformational - HiLink purifyLogSIG purifyLogInformational - HiLink purifyLogWPF purifyLogInformational - HiLink purifyLogWPM purifyLogInformational - HiLink purifyLogWPN purifyLogInformational - HiLink purifyLogWPR purifyLogInformational - HiLink purifyLogWPW purifyLogInformational - HiLink purifyLogWPX purifyLogInformational +hi def link purifyLogFIU purifyLogInformational +hi def link purifyLogMAF purifyLogInformational +hi def link purifyLogMIU purifyLogInformational +hi def link purifyLogSIG purifyLogInformational +hi def link purifyLogWPF purifyLogInformational +hi def link purifyLogWPM purifyLogInformational +hi def link purifyLogWPN purifyLogInformational +hi def link purifyLogWPR purifyLogInformational +hi def link purifyLogWPW purifyLogInformational +hi def link purifyLogWPX purifyLogInformational - HiLink purifyLogABR purifyLogWarning - HiLink purifyLogBSR purifyLogWarning - HiLink purifyLogBSW purifyLogWarning - HiLink purifyLogFMR purifyLogWarning - HiLink purifyLogMLK purifyLogWarning - HiLink purifyLogMSE purifyLogWarning - HiLink purifyLogPAR purifyLogWarning - HiLink purifyLogPLK purifyLogWarning - HiLink purifyLogSBR purifyLogWarning - HiLink purifyLogSOF purifyLogWarning - HiLink purifyLogUMC purifyLogWarning - HiLink purifyLogUMR purifyLogWarning +hi def link purifyLogABR purifyLogWarning +hi def link purifyLogBSR purifyLogWarning +hi def link purifyLogBSW purifyLogWarning +hi def link purifyLogFMR purifyLogWarning +hi def link purifyLogMLK purifyLogWarning +hi def link purifyLogMSE purifyLogWarning +hi def link purifyLogPAR purifyLogWarning +hi def link purifyLogPLK purifyLogWarning +hi def link purifyLogSBR purifyLogWarning +hi def link purifyLogSOF purifyLogWarning +hi def link purifyLogUMC purifyLogWarning +hi def link purifyLogUMR purifyLogWarning - HiLink purifyLogABW purifyLogCorrupting - HiLink purifyLogBRK purifyLogCorrupting - HiLink purifyLogFMW purifyLogCorrupting - HiLink purifyLogFNH purifyLogCorrupting - HiLink purifyLogFUM purifyLogCorrupting - HiLink purifyLogMRE purifyLogCorrupting - HiLink purifyLogSBW purifyLogCorrupting +hi def link purifyLogABW purifyLogCorrupting +hi def link purifyLogBRK purifyLogCorrupting +hi def link purifyLogFMW purifyLogCorrupting +hi def link purifyLogFNH purifyLogCorrupting +hi def link purifyLogFUM purifyLogCorrupting +hi def link purifyLogMRE purifyLogCorrupting +hi def link purifyLogSBW purifyLogCorrupting - HiLink purifyLogCOR purifyLogFatal - HiLink purifyLogNPR purifyLogFatal - HiLink purifyLogNPW purifyLogFatal - HiLink purifyLogZPR purifyLogFatal - HiLink purifyLogZPW purifyLogFatal +hi def link purifyLogCOR purifyLogFatal +hi def link purifyLogNPR purifyLogFatal +hi def link purifyLogNPW purifyLogFatal +hi def link purifyLogZPR purifyLogFatal +hi def link purifyLogZPW purifyLogFatal - HiLink purifyLogHeader Comment - HiLink purifyLogInformational PreProc - HiLink purifyLogWarning Type - HiLink purifyLogCorrupting Error - HiLink purifyLogFatal Error +hi def link purifyLogHeader Comment +hi def link purifyLogInformational PreProc +hi def link purifyLogWarning Type +hi def link purifyLogCorrupting Error +hi def link purifyLogFatal Error - delcommand HiLink -endif let b:current_syntax = "purifylog" diff --git a/runtime/syntax/pyrex.vim b/runtime/syntax/pyrex.vim index 7dc9b955b0..b860658975 100644 --- a/runtime/syntax/pyrex.vim +++ b/runtime/syntax/pyrex.vim @@ -4,21 +4,14 @@ " URL: http://marcobari.altervista.org/pyrex_vim.html " Last Change: 2009 Nov 09 -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif " Read the Python syntax to start with -if version < 600 - so :p:h/python.vim -else - runtime! syntax/python.vim - unlet b:current_syntax -endif +runtime! syntax/python.vim +unlet b:current_syntax " Pyrex extentions syn keyword pyrexStatement cdef typedef ctypedef sizeof @@ -44,24 +37,15 @@ syn match pythonInclude "from" syn match pyrexForFrom "\(for[^:]*\)\@<=from" " Default highlighting -if version >= 508 || !exists("did_pyrex_syntax_inits") - if version < 508 - let did_pyrex_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - HiLink pyrexStatement Statement - HiLink pyrexType Type - HiLink pyrexStructure Structure - HiLink pyrexInclude PreCondit - HiLink pyrexAccess pyrexStatement - if exists("python_highlight_builtins") || exists("pyrex_highlight_builtins") - HiLink pyrexBuiltin Function - endif - HiLink pyrexForFrom Statement - - delcommand HiLink +hi def link pyrexStatement Statement +hi def link pyrexType Type +hi def link pyrexStructure Structure +hi def link pyrexInclude PreCondit +hi def link pyrexAccess pyrexStatement +if exists("python_highlight_builtins") || exists("pyrex_highlight_builtins") +hi def link pyrexBuiltin Function endif +hi def link pyrexForFrom Statement + let b:current_syntax = "pyrex" diff --git a/runtime/syntax/python.vim b/runtime/syntax/python.vim index fa42b3e2d2..5aec2fe3d2 100644 --- a/runtime/syntax/python.vim +++ b/runtime/syntax/python.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: Python " Maintainer: Zvezdan Petkovic -" Last Change: 2016 Jul 21 +" Last Change: 2016 Oct 29 " Credits: Neil Schemenauer " Dmitry Vasiliev " @@ -36,11 +36,8 @@ " let python_highlight_all = 1 " -" For version 5.x: Clear all syntax items. -" For version 6.x: Quit when a syntax file was already loaded. -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded. +if exists("b:current_syntax") finish endif @@ -49,6 +46,29 @@ endif let s:cpo_save = &cpo set cpo&vim +if exists("python_no_doctest_highlight") + let python_no_doctest_code_highlight = 1 +endif + +if exists("python_highlight_all") + if exists("python_no_builtin_highlight") + unlet python_no_builtin_highlight + endif + if exists("python_no_doctest_code_highlight") + unlet python_no_doctest_code_highlight + endif + if exists("python_no_doctest_highlight") + unlet python_no_doctest_highlight + endif + if exists("python_no_exception_highlight") + unlet python_no_exception_highlight + endif + if exists("python_no_number_highlight") + unlet python_no_number_highlight + endif + let python_space_error_highlight = 1 +endif + " Keep Python keywords in alphabetical order inside groups for easy " comparison with the table in the 'Python Language Reference' " https://docs.python.org/2/reference/lexical_analysis.html#keywords, @@ -84,14 +104,31 @@ syn keyword pythonInclude from import syn keyword pythonAsync async await " Decorators (new in Python 2.4) -syn match pythonDecorator "@" display nextgroup=pythonFunction skipwhite -" The zero-length non-grouping match before the function name is -" extremely important in pythonFunction. Without it, everything is -" interpreted as a function inside the contained environment of -" doctests. " A dot must be allowed because of @MyClass.myfunc decorators. -syn match pythonFunction - \ "\%(\%(def\s\|class\s\|@\)\s*\)\@<=\h\%(\w\|\.\)*" contained +syn match pythonDecorator "@" display contained +syn match pythonDecoratorName "@\s*\h\%(\w\|\.\)*" display contains=pythonDecorator + +" Python 3.5 introduced the use of the same symbol for matrix multiplication: +" https://www.python.org/dev/peps/pep-0465/. We now have to exclude the +" symbol from highlighting when used in that context. +" Single line multiplication. +syn match pythonMatrixMultiply + \ "\%(\w\|[])]\)\s*@" + \ contains=ALLBUT,pythonDecoratorName,pythonDecorator,pythonFunction,pythonDoctestValue + \ transparent +" Multiplication continued on the next line after backslash. +syn match pythonMatrixMultiply + \ "[^\\]\\\s*\n\%(\s*\.\.\.\s\)\=\s\+@" + \ contains=ALLBUT,pythonDecoratorName,pythonDecorator,pythonFunction,pythonDoctestValue + \ transparent +" Multiplication in a parenthesized expression over multiple lines with @ at +" the start of each continued line; very similar to decorators and complex. +syn match pythonMatrixMultiply + \ "^\s*\%(\%(>>>\|\.\.\.\)\s\+\)\=\zs\%(\h\|\%(\h\|[[(]\).\{-}\%(\w\|[])]\)\)\s*\n\%(\s*\.\.\.\s\)\=\s\+@\%(.\{-}\n\%(\s*\.\.\.\s\)\=\s\+@\)*" + \ contains=ALLBUT,pythonDecoratorName,pythonDecorator,pythonFunction,pythonDoctestValue + \ transparent + +syn match pythonFunction "\h\w*" display contained syn match pythonComment "#.*$" contains=pythonTodo,@Spell syn keyword pythonTodo FIXME NOTE NOTES TODO XXX contained @@ -118,25 +155,6 @@ syn match pythonEscape "\%(\\u\x\{4}\|\\U\x\{8}\)" contained syn match pythonEscape "\\N{\a\+\%(\s\a\+\)*}" contained syn match pythonEscape "\\$" -if exists("python_highlight_all") - if exists("python_no_builtin_highlight") - unlet python_no_builtin_highlight - endif - if exists("python_no_doctest_code_highlight") - unlet python_no_doctest_code_highlight - endif - if exists("python_no_doctest_highlight") - unlet python_no_doctest_highlight - endif - if exists("python_no_exception_highlight") - unlet python_no_exception_highlight - endif - if exists("python_no_number_highlight") - unlet python_no_number_highlight - endif - let python_space_error_highlight = 1 -endif - " It is very important to understand all details before changing the " regular expressions below or their order. " The word boundaries are *not* the floating-point number boundaries @@ -200,7 +218,9 @@ if !exists("python_no_builtin_highlight") " non-essential built-in functions; Python 2 only syn keyword pythonBuiltin apply buffer coerce intern " avoid highlighting attributes as builtins - syn match pythonAttribute /\.\h\w*/hs=s+1 contains=ALLBUT,pythonBuiltin transparent + syn match pythonAttribute /\.\h\w*/hs=s+1 + \ contains=ALLBUT,pythonBuiltin,pythonFunction,pythonAsync + \ transparent endif " From the 'Python Library Reference' class hierarchy at the bottom. @@ -262,7 +282,7 @@ if !exists("python_no_doctest_highlight") if !exists("python_no_doctest_code_highlight") syn region pythonDoctest \ start="^\s*>>>\s" end="^\s*$" - \ contained contains=ALLBUT,pythonDoctest,@Spell + \ contained contains=ALLBUT,pythonDoctest,pythonFunction,@Spell syn region pythonDoctestValue \ start=+^\s*\%(>>>\s\|\.\.\.\s\|"""\|'''\)\@!\S\++ end="$" \ contained @@ -274,51 +294,41 @@ if !exists("python_no_doctest_highlight") endif " Sync at the beginning of class, function, or method definition. -syn sync match pythonSync grouphere NONE "^\s*\%(def\|class\)\s\+\h\w*\s*(" +syn sync match pythonSync grouphere NONE "^\%(def\|class\)\s\+\h\w*\s*[(:]" -if version >= 508 || !exists("did_python_syn_inits") - if version <= 508 - let did_python_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - - " The default highlight links. Can be overridden later. - HiLink pythonStatement Statement - HiLink pythonConditional Conditional - HiLink pythonRepeat Repeat - HiLink pythonOperator Operator - HiLink pythonException Exception - HiLink pythonInclude Include - HiLink pythonAsync Statement - HiLink pythonDecorator Define - HiLink pythonFunction Function - HiLink pythonComment Comment - HiLink pythonTodo Todo - HiLink pythonString String - HiLink pythonRawString String - HiLink pythonQuotes String - HiLink pythonTripleQuotes pythonQuotes - HiLink pythonEscape Special - if !exists("python_no_number_highlight") - HiLink pythonNumber Number - endif - if !exists("python_no_builtin_highlight") - HiLink pythonBuiltin Function - endif - if !exists("python_no_exception_highlight") - HiLink pythonExceptions Structure - endif - if exists("python_space_error_highlight") - HiLink pythonSpaceError Error - endif - if !exists("python_no_doctest_highlight") - HiLink pythonDoctest Special - HiLink pythonDoctestValue Define - endif - - delcommand HiLink +" The default highlight links. Can be overridden later. +hi def link pythonStatement Statement +hi def link pythonConditional Conditional +hi def link pythonRepeat Repeat +hi def link pythonOperator Operator +hi def link pythonException Exception +hi def link pythonInclude Include +hi def link pythonAsync Statement +hi def link pythonDecorator Define +hi def link pythonDecoratorName Function +hi def link pythonFunction Function +hi def link pythonComment Comment +hi def link pythonTodo Todo +hi def link pythonString String +hi def link pythonRawString String +hi def link pythonQuotes String +hi def link pythonTripleQuotes pythonQuotes +hi def link pythonEscape Special +if !exists("python_no_number_highlight") + hi def link pythonNumber Number +endif +if !exists("python_no_builtin_highlight") + hi def link pythonBuiltin Function +endif +if !exists("python_no_exception_highlight") + hi def link pythonExceptions Structure +endif +if exists("python_space_error_highlight") + hi def link pythonSpaceError Error +endif +if !exists("python_no_doctest_highlight") + hi def link pythonDoctest Special + hi def link pythonDoctestValue Define endif let b:current_syntax = "python" diff --git a/runtime/syntax/quake.vim b/runtime/syntax/quake.vim index 3a9b68d6f3..7db53106ad 100644 --- a/runtime/syntax/quake.vim +++ b/runtime/syntax/quake.vim @@ -1,11 +1,11 @@ " Vim syntax file -" Language: Quake[1-3] configuration file -" Maintainer: Nikolai Weibull -" Latest Revision: 2007-06-17 +" Language: Quake[1-3] configuration file +" Previous Maintainer: Nikolai Weibull +" Latest Revision: 2007-06-17 " quake_is_quake1 - the syntax is to be used for quake1 configs " quake_is_quake2 - the syntax is to be used for quake2 configs " quake_is_quake3 - the syntax is to be used for quake3 configs -" Credits: Tomasz Kalkosinski wrote the original quake3Colors stuff +" Credits: Tomasz Kalkosinski wrote the original quake3Colors stuff if exists("b:current_syntax") finish diff --git a/runtime/syntax/r.vim b/runtime/syntax/r.vim index d96bf96acb..45ff498b3b 100644 --- a/runtime/syntax/r.vim +++ b/runtime/syntax/r.vim @@ -5,10 +5,10 @@ " Tom Payne " Contributor: Johannes Ranke " Homepage: https://github.com/jalvesaq/R-Vim-runtime -" Last Change: Thu Mar 10, 2016 12:26PM +" Last Change: Sat Apr 08, 2017 07:01PM " Filenames: *.R *.r *.Rhistory *.Rt " -" NOTE: The highlighting of R functions is defined in +" NOTE: The highlighting of R functions might be defined in " runtime files created by a filetype plugin, if installed. " " CONFIGURATION: @@ -18,7 +18,7 @@ " " ROxygen highlighting can be turned off by " -" let r_hl_roxygen = 0 +" let r_syntax_hl_roxygen = 0 " " Some lines of code were borrowed from Zhuojun Chen. @@ -26,13 +26,25 @@ if exists("b:current_syntax") finish endif -setlocal iskeyword=@,48-57,_,. +if has("patch-7.4.1142") + syn iskeyword @,48-57,_,. +else + setlocal iskeyword=@,48-57,_,. +endif + +" The variables g:r_hl_roxygen and g:r_syn_minlines were renamed on April 8, 2017. +if exists("g:r_hl_roxygen") + let g:r_syntax_hl_roxygen = g:r_hl_roxygen +endif +if exists("g:r_syn_minlines") + let g:r_syntax_minlines = g:r_syn_minlines +endif if exists("g:r_syntax_folding") && g:r_syntax_folding setlocal foldmethod=syntax endif -if !exists("g:r_hl_roxygen") - let g:r_hl_roxygen = 1 +if !exists("g:r_syntax_hl_roxygen") + let g:r_syntax_hl_roxygen = 1 endif syn case match @@ -42,19 +54,106 @@ syn match rCommentTodo contained "\(BUG\|FIXME\|NOTE\|TODO\):" syn match rComment contains=@Spell,rCommentTodo,rOBlock "#.*" " Roxygen -if g:r_hl_roxygen - syn region rOBlock start="^\s*\n#\{1,2}' " start="\%^#\{1,2}' " end="^\(#\{1,2}'\)\@!" contains=rOTitle,rOKeyword,rOExamples,@Spell keepend - syn region rOTitle start="^\s*\n#\{1,2}' " start="\%^#\{1,2}' " end="^\(#\{1,2}'\s*$\)\@=" contained contains=rOCommentKey - syn match rOCommentKey "#\{1,2}'" containedin=rOTitle contained +if g:r_syntax_hl_roxygen + " A roxygen block can start at the beginning of a file (first version) and + " after a blank line (second version). It ends when a line that does not + " contain a roxygen comment. In the following comments, any line containing + " a roxygen comment marker (one or two hash signs # followed by a single + " quote ' and preceded only by whitespace) is called a roxygen line. A + " roxygen line containing only a roxygen comment marker, optionally followed + " by whitespace is called an empty roxygen line. - syn region rOExamples start="^#\{1,2}' @examples.*"rs=e+1,hs=e+1 end="^\(#\{1,2}' @.*\)\@=" end="^\(#\{1,2}'\)\@!" contained contains=rOKeyword + " First we match all roxygen blocks as containing only a title. In case an + " empty roxygen line ending the title or a tag is found, this will be + " overriden later by the definitions of rOBlock. + syn match rOTitleBlock "\%^\(\s*#\{1,2}' .*\n\)\{1,}" contains=rOCommentKey,rOTitleTag + syn match rOTitleBlock "^\s*\n\(\s*#\{1,2}' .*\n\)\{1,}" contains=rOCommentKey,rOTitleTag - syn match rOKeyword contained "@\(param\|return\|name\|rdname\|examples\|example\|include\|docType\)" - syn match rOKeyword contained "@\(S3method\|TODO\|aliases\|alias\|assignee\|author\|callGraphDepth\|callGraph\)" - syn match rOKeyword contained "@\(callGraphPrimitives\|concept\|exportClass\|exportMethod\|exportPattern\|export\|formals\)" - syn match rOKeyword contained "@\(format\|importClassesFrom\|importFrom\|importMethodsFrom\|import\|keywords\|useDynLib\)" - syn match rOKeyword contained "@\(method\|noRd\|note\|references\|seealso\|setClass\|slot\|source\|title\|usage\)" - syn match rOKeyword contained "@\(family\|template\|templateVar\|description\|details\|inheritParams\|field\)" + " When a roxygen block has a title and additional content, the title + " consists of one or more roxygen lines (as little as possible are matched), + " followed either by an empty roxygen line + syn region rOBlock start="\%^\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*$" end="^\s*\(#\{1,2}'\)\@!" contains=rOTitle,rOTag,rOExamples,@Spell keepend fold + syn region rOBlock start="^\s*\n\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*$" end="^\s*\(#\{1,2}'\)\@!" contains=rOTitle,rOTag,rOExamples,@Spell keepend fold + + " or by a roxygen tag (we match everything starting with @ but not @@ which is used as escape sequence for a literal @). + syn region rOBlock start="\%^\(\s*#\{1,2}' .*\n\)\{-}\s*#\{1,2}' @\(@\)\@!" end="^\s*\(#\{1,2}'\)\@!" contains=rOTitle,rOTag,rOExamples,@Spell keepend fold + syn region rOBlock start="^\s*\n\(\s*#\{1,2}' .*\n\)\{-}\s*#\{1,2}' @\(@\)\@!" end="^\s*\(#\{1,2}'\)\@!" contains=rOTitle,rOTag,rOExamples,@Spell keepend fold + + " If a block contains an @rdname, @describeIn tag, it may have paragraph breaks, but does not have a title + syn region rOBlockNoTitle start="\%^\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*\n\(\s*#\{1,2}'.*\n\)\{-}\s*#\{1,2}' @rdname" end="^\s*\(#\{1,2}'\)\@!" contains=rOTag,rOExamples,@Spell keepend fold + syn region rOBlockNoTitle start="^\s*\n\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*\n\(\s*#\{1,2}'.*\n\)\{-}\s*#\{1,2}' @rdname" end="^\s*\(#\{1,2}'\)\@!" contains=rOTag,rOExamples,@Spell keepend fold + syn region rOBlockNoTitle start="\%^\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*\n\(\s*#\{1,2}'.*\n\)\{-}\s*#\{1,2}' @describeIn" end="^\s*\(#\{1,2}'\)\@!" contains=rOTag,rOExamples,@Spell keepend fold + syn region rOBlockNoTitle start="^\s*\n\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*\n\(\s*#\{1,2}'.*\n\)\{-}\s*#\{1,2}' @describeIn" end="^\s*\(#\{1,2}'\)\@!" contains=rOTag,rOExamples,@Spell keepend fold + + " A title as part of a block is always at the beginning of the block, i.e. + " either at the start of a file or after a completely empty line. + syn match rOTitle "\%^\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*$" contained contains=rOCommentKey,rOTitleTag + syn match rOTitle "^\s*\n\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*$" contained contains=rOCommentKey,rOTitleTag + syn match rOTitleTag contained "@title" + + syn match rOCommentKey "#\{1,2}'" contained + syn region rOExamples start="^#\{1,2}' @examples.*"rs=e+1,hs=e+1 end="^\(#\{1,2}' @.*\)\@=" end="^\(#\{1,2}'\)\@!" contained contains=rOTag fold + + " rOTag list generated from the lists in + " https://github.com/klutometis/roxygen/R/rd.R and + " https://github.com/klutometis/roxygen/R/namespace.R + " using s/^ \([A-Za-z0-9]*\) = .*/ syn match rOTag contained "@\1"/ + " Plus we need the @include tag + + " rd.R + syn match rOTag contained "@aliases" + syn match rOTag contained "@author" + syn match rOTag contained "@backref" + syn match rOTag contained "@concept" + syn match rOTag contained "@describeIn" + syn match rOTag contained "@description" + syn match rOTag contained "@details" + syn match rOTag contained "@docType" + syn match rOTag contained "@encoding" + syn match rOTag contained "@evalRd" + syn match rOTag contained "@example" + syn match rOTag contained "@examples" + syn match rOTag contained "@family" + syn match rOTag contained "@field" + syn match rOTag contained "@format" + syn match rOTag contained "@inherit" + syn match rOTag contained "@inheritParams" + syn match rOTag contained "@inheritDotParams" + syn match rOTag contained "@inheritSection" + syn match rOTag contained "@keywords" + syn match rOTag contained "@method" + syn match rOTag contained "@name" + syn match rOTag contained "@md" + syn match rOTag contained "@noMd" + syn match rOTag contained "@noRd" + syn match rOTag contained "@note" + syn match rOTag contained "@param" + syn match rOTag contained "@rdname" + syn match rOTag contained "@rawRd" + syn match rOTag contained "@references" + syn match rOTag contained "@return" + syn match rOTag contained "@section" + syn match rOTag contained "@seealso" + syn match rOTag contained "@slot" + syn match rOTag contained "@source" + syn match rOTag contained "@template" + syn match rOTag contained "@templateVar" + syn match rOTag contained "@title" + syn match rOTag contained "@usage" + " namespace.R + syn match rOTag contained "@export" + syn match rOTag contained "@exportClass" + syn match rOTag contained "@exportMethod" + syn match rOTag contained "@exportPattern" + syn match rOTag contained "@import" + syn match rOTag contained "@importClassesFrom" + syn match rOTag contained "@importFrom" + syn match rOTag contained "@importMethodsFrom" + syn match rOTag contained "@rawNamespace" + syn match rOTag contained "@S3method" + syn match rOTag contained "@useDynLib" + " other + syn match rOTag contained "@include" endif @@ -168,14 +267,28 @@ syn match rBraceError "[)}]" contained syn match rCurlyError "[)\]]" contained syn match rParenError "[\]}]" contained -if !exists("g:R_hi_fun") - let g:R_hi_fun = 1 +" Use Nvim-R to highlight functions dynamically if it is installed +if !exists("g:r_syntax_fun_pattern") + let s:ff = split(substitute(globpath(&rtp, "R/functions.vim"), "functions.vim", "", "g"), "\n") + if len(s:ff) > 0 + let g:r_syntax_fun_pattern = 0 + else + let g:r_syntax_fun_pattern = 1 + endif endif -if g:R_hi_fun - " Nvim-R: - runtime R/functions.vim - " Vim-R-plugin: - runtime r-plugin/functions.vim + +" Only use Nvim-R to highlight functions if they should not be highlighted +" according to a generic pattern +if g:r_syntax_fun_pattern == 1 + syn match rFunction '[0-9a-zA-Z_\.]\+\s*\ze(' +else + if !exists("g:R_hi_fun") + let g:R_hi_fun = 1 + endif + if g:R_hi_fun + " Nvim-R: + runtime R/functions.vim + endif endif syn match rDollar display contained "\$" @@ -207,8 +320,8 @@ if &filetype == "rhelp" syn match rhSection "\\dontrun\>" endif -if exists("r_syn_minlines") - exe "syn sync minlines=" . r_syn_minlines +if exists("r_syntax_minlines") + exe "syn sync minlines=" . r_syntax_minlines else syn sync minlines=40 endif @@ -245,15 +358,17 @@ hi def link rStatement Statement hi def link rString String hi def link rStrError Error hi def link rType Type -if g:r_hl_roxygen - hi def link rOKeyword Title - hi def link rOBlock Comment +if g:r_syntax_hl_roxygen + hi def link rOTitleTag Operator + hi def link rOTag Operator + hi def link rOTitleBlock Title + hi def link rOBlock Comment + hi def link rOBlockNoTitle Comment hi def link rOTitle Title hi def link rOCommentKey Comment hi def link rOExamples SpecialComment endif - let b:current_syntax="r" " vim: ts=8 sw=2 diff --git a/runtime/syntax/racc.vim b/runtime/syntax/racc.vim index d412227cbd..2d4c176eb7 100644 --- a/runtime/syntax/racc.vim +++ b/runtime/syntax/racc.vim @@ -1,7 +1,7 @@ " Vim default file -" Language: Racc input file -" Maintainer: Nikolai Weibull -" Latest Revision: 2008-06-22 +" Language: Racc input file +" Previous Maintainer: Nikolai Weibull +" Latest Revision: 2008-06-22 if exists("b:current_syntax") finish diff --git a/runtime/syntax/radiance.vim b/runtime/syntax/radiance.vim index 461b708f0e..c49e339a28 100644 --- a/runtime/syntax/radiance.vim +++ b/runtime/syntax/radiance.vim @@ -18,20 +18,13 @@ " comments, external command names and the null-modifier "void". -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif " all printing characters except '#' and '!' are valid in names. -if version >= 600 - setlocal iskeyword=\",$-~ -else - set iskeyword=\",$-~ -endif +setlocal iskeyword=\",$-~ " The null-modifier syn keyword radianceKeyword void @@ -130,29 +123,19 @@ syn keyword radianceTodo contained TODO XXX syn match radianceComment "#.*$" contains=radianceTodo " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_radiance_syn_inits") - if version < 508 - let did_radiance_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - HiLink radianceKeyword Keyword - HiLink radianceExtraType Type - HiLink radianceSurfType Type - HiLink radianceLightType Type - HiLink radianceMatType Type - HiLink radiancePatType Type - HiLink radianceTexType Type - HiLink radianceMixType Type - HiLink radianceComment Comment - HiLink radianceCommand Function - HiLink radianceID String - HiLink radianceTodo Todo - delcommand HiLink -endif +" Only when an item doesn't have highlighting yet +hi def link radianceKeyword Keyword +hi def link radianceExtraType Type +hi def link radianceSurfType Type +hi def link radianceLightType Type +hi def link radianceMatType Type +hi def link radiancePatType Type +hi def link radianceTexType Type +hi def link radianceMixType Type +hi def link radianceComment Comment +hi def link radianceCommand Function +hi def link radianceID String +hi def link radianceTodo Todo let b:current_syntax = "radiance" diff --git a/runtime/syntax/ratpoison.vim b/runtime/syntax/ratpoison.vim index 9fc59bec0d..af8676c43d 100644 --- a/runtime/syntax/ratpoison.vim +++ b/runtime/syntax/ratpoison.vim @@ -5,11 +5,8 @@ " Last Change: 2011 Apr 11 " Previous Maintainer: Doug Kearns -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -247,33 +244,23 @@ syn match ratpoisonVoidCommand "^\s*\zsvsplit\ze\s*$" syn match ratpoisonVoidCommand "^\s*\zswindows\ze\s*$" " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_ratpoison_syn_inits") - if version < 508 - let did_ratpoison_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink ratpoisonBooleanArg Boolean - HiLink ratpoisonCommandArg Keyword - HiLink ratpoisonComment Comment - HiLink ratpoisonDefCommand Identifier - HiLink ratpoisonGravityArg Constant - HiLink ratpoisonKeySeqArg Special - HiLink ratpoisonNumberArg Number - HiLink ratpoisonSetArg Keyword - HiLink ratpoisonStringCommand Identifier - HiLink ratpoisonTodo Todo - HiLink ratpoisonVoidCommand Identifier - HiLink ratpoisonWinFmtArg Special - HiLink ratpoisonWinNameArg Constant - HiLink ratpoisonWinListArg Constant +hi def link ratpoisonBooleanArg Boolean +hi def link ratpoisonCommandArg Keyword +hi def link ratpoisonComment Comment +hi def link ratpoisonDefCommand Identifier +hi def link ratpoisonGravityArg Constant +hi def link ratpoisonKeySeqArg Special +hi def link ratpoisonNumberArg Number +hi def link ratpoisonSetArg Keyword +hi def link ratpoisonStringCommand Identifier +hi def link ratpoisonTodo Todo +hi def link ratpoisonVoidCommand Identifier +hi def link ratpoisonWinFmtArg Special +hi def link ratpoisonWinNameArg Constant +hi def link ratpoisonWinListArg Constant - delcommand HiLink -endif let b:current_syntax = "ratpoison" diff --git a/runtime/syntax/rc.vim b/runtime/syntax/rc.vim index a2d5824d3e..4c6856bc83 100644 --- a/runtime/syntax/rc.vim +++ b/runtime/syntax/rc.vim @@ -8,11 +8,8 @@ " This file is based on the c.vim -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -148,55 +145,45 @@ syn region rcPreProc start="^\s*#\s*\(pragma\>\|line\>\|warning\>\|warn\>\|erro syn sync ccomment rcComment minlines=10 " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_rc_syntax_inits") - if version < 508 - let did_rc_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink rcCharacter Character - HiLink rcSpecialCharacter rcSpecial - HiLink rcNumber Number - HiLink rcFloat Float - HiLink rcOctalError rcError - HiLink rcParenError rcError - HiLink rcInParen rcError - HiLink rcCommentError rcError - HiLink rcInclude Include - HiLink rcPreProc PreProc - HiLink rcDefine Macro - HiLink rcIncluded rcString - HiLink rcError Error - HiLink rcPreCondit PreCondit - HiLink rcCommentString rcString - HiLink rcComment2String rcString - HiLink rcCommentSkip rcComment - HiLink rcString String - HiLink rcComment Comment - HiLink rcSpecial SpecialChar - HiLink rcTodo Todo +hi def link rcCharacter Character +hi def link rcSpecialCharacter rcSpecial +hi def link rcNumber Number +hi def link rcFloat Float +hi def link rcOctalError rcError +hi def link rcParenError rcError +hi def link rcInParen rcError +hi def link rcCommentError rcError +hi def link rcInclude Include +hi def link rcPreProc PreProc +hi def link rcDefine Macro +hi def link rcIncluded rcString +hi def link rcError Error +hi def link rcPreCondit PreCondit +hi def link rcCommentString rcString +hi def link rcComment2String rcString +hi def link rcCommentSkip rcComment +hi def link rcString String +hi def link rcComment Comment +hi def link rcSpecial SpecialChar +hi def link rcTodo Todo - HiLink rcAttribute rcCommonAttribute - HiLink rcStdId rcStatement - HiLink rcStatement Statement +hi def link rcAttribute rcCommonAttribute +hi def link rcStdId rcStatement +hi def link rcStatement Statement - " Default color overrides - hi def rcLanguage term=reverse ctermbg=Red ctermfg=Yellow guibg=Red guifg=Yellow - hi def rcMainObject term=underline ctermfg=Blue guifg=Blue - hi def rcSubObject ctermfg=Green guifg=Green - hi def rcCaptionParam term=underline ctermfg=DarkGreen guifg=Green - hi def rcParam ctermfg=DarkGreen guifg=DarkGreen - hi def rcStatement ctermfg=DarkGreen guifg=DarkGreen - hi def rcCommonAttribute ctermfg=Brown guifg=Brown +" Default color overrides +hi def rcLanguage term=reverse ctermbg=Red ctermfg=Yellow guibg=Red guifg=Yellow +hi def rcMainObject term=underline ctermfg=Blue guifg=Blue +hi def rcSubObject ctermfg=Green guifg=Green +hi def rcCaptionParam term=underline ctermfg=DarkGreen guifg=Green +hi def rcParam ctermfg=DarkGreen guifg=DarkGreen +hi def rcStatement ctermfg=DarkGreen guifg=DarkGreen +hi def rcCommonAttribute ctermfg=Brown guifg=Brown - "HiLink rcIdentifier Identifier +"hi def link rcIdentifier Identifier - delcommand HiLink -endif let b:current_syntax = "rc" diff --git a/runtime/syntax/rcs.vim b/runtime/syntax/rcs.vim index e45d5fdbb6..5a34802ada 100644 --- a/runtime/syntax/rcs.vim +++ b/runtime/syntax/rcs.vim @@ -9,11 +9,8 @@ " Options: " rcs_folding = 1 For folding strings -" For version 5.x: Clear all syntax items. -" For version 6.x: Quit when a syntax file was already loaded. -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded. +if exists("b:current_syntax") finish endif @@ -52,25 +49,15 @@ else endif " Define the default highlighting. -" For version 5.7 and earlier: only when not done already. -" For version 5.8 and later: only when an item doesn't have highlighting yet. -if version >= 508 || !exists("did_rcs_syn_inits") - if version <= 508 - let did_rcs_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet. - HiLink rcsKeyword Keyword - HiLink rcsNumber Identifier - HiLink rcsString String - HiLink rcsTextStr String - HiLink rcsSpecial Special - HiLink rcsDiffLines Special - HiLink rcsEOFError Error +hi def link rcsKeyword Keyword +hi def link rcsNumber Identifier +hi def link rcsString String +hi def link rcsTextStr String +hi def link rcsSpecial Special +hi def link rcsDiffLines Special +hi def link rcsEOFError Error - delcommand HiLink -endif let b:current_syntax = "rcs" diff --git a/runtime/syntax/rcslog.vim b/runtime/syntax/rcslog.vim index acacfa124b..18f4593c77 100644 --- a/runtime/syntax/rcslog.vim +++ b/runtime/syntax/rcslog.vim @@ -3,11 +3,8 @@ " Maintainer: Joe Karthauser " Last Change: 2001 May 09 -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -16,22 +13,12 @@ syn match rcslogFile "^RCS file:.*" syn match rcslogDate "^date: .*$" " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_rcslog_syntax_inits") - if version < 508 - let did_rcslog_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink rcslogFile Type - HiLink rcslogRevision Constant - HiLink rcslogDate Identifier +hi def link rcslogFile Type +hi def link rcslogRevision Constant +hi def link rcslogDate Identifier - delcommand HiLink -endif let b:current_syntax = "rcslog" diff --git a/runtime/syntax/readline.vim b/runtime/syntax/readline.vim index 091722e5e5..b50b9c60e5 100644 --- a/runtime/syntax/readline.vim +++ b/runtime/syntax/readline.vim @@ -1,7 +1,7 @@ " Vim syntax file -" Language: readline(3) configuration file -" Maintainer: Nikolai Weibull -" Latest Revision: 2012-04-25 +" Language: readline(3) configuration file +" Previous Maintainer: Nikolai Weibull +" Latest Revision: 2017-06-25 " readline_has_bash - if defined add support for bash specific " settings/functions @@ -119,6 +119,7 @@ syn keyword readlineVariable contained \ nextgroup=readlineBoolean \ skipwhite \ bind-tty-special-chars + \ colored-stats \ completion-ignore-case \ completion-map-case \ convert-meta @@ -142,6 +143,7 @@ syn keyword readlineVariable contained \ revert-all-at-newline \ show-all-if-ambiguous \ show-all-if-unmodified + \ show-mode-in-prompt \ skip-completed-text \ visible-stats @@ -158,6 +160,7 @@ syn keyword readlineVariable contained \ completion-prefix-display-length \ completion-query-items \ history-size + \ keyseq-timeout syn keyword readlineVariable contained \ nextgroup=readlineEditingMode diff --git a/runtime/syntax/rebol.vim b/runtime/syntax/rebol.vim index e6395758f3..a5d50c4ab1 100644 --- a/runtime/syntax/rebol.vim +++ b/runtime/syntax/rebol.vim @@ -6,11 +6,8 @@ " URL: http://www.eandem.co.uk/mrw/vim " -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -18,11 +15,7 @@ endif syn case ignore " As per current users documentation -if version < 600 - set isk=@,48-57,?,!,.,',+,-,*,&,\|,=,_,~ -else - setlocal isk=@,48-57,?,!,.,',+,-,*,&,\|,=,_,~ -endif +setlocal isk=@,48-57,?,!,.,',+,-,*,&,\|,=,_,~ " Yer TODO highlighter syn keyword rebolTodo contained TODO @@ -145,65 +138,55 @@ syn keyword rebolConstant none " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_rebol_syntax_inits") - if version < 508 - let did_rebol_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink rebolTodo Todo +hi def link rebolTodo Todo - HiLink rebolStatement Statement - HiLink rebolLabel Label - HiLink rebolConditional Conditional - HiLink rebolRepeat Repeat +hi def link rebolStatement Statement +hi def link rebolLabel Label +hi def link rebolConditional Conditional +hi def link rebolRepeat Repeat - HiLink rebolOperator Operator - HiLink rebolLogicOperator rebolOperator - HiLink rebolLogicFunction rebolLogicOperator - HiLink rebolMathOperator rebolOperator - HiLink rebolMathFunction rebolMathOperator - HiLink rebolBinaryOperator rebolOperator - HiLink rebolBinaryFunction rebolBinaryOperator +hi def link rebolOperator Operator +hi def link rebolLogicOperator rebolOperator +hi def link rebolLogicFunction rebolLogicOperator +hi def link rebolMathOperator rebolOperator +hi def link rebolMathFunction rebolMathOperator +hi def link rebolBinaryOperator rebolOperator +hi def link rebolBinaryFunction rebolBinaryOperator - HiLink rebolType Type - HiLink rebolTypeFunction rebolOperator +hi def link rebolType Type +hi def link rebolTypeFunction rebolOperator - HiLink rebolWord Identifier - HiLink rebolWordPath rebolWord - HiLink rebolFunction Function +hi def link rebolWord Identifier +hi def link rebolWordPath rebolWord +hi def link rebolFunction Function - HiLink rebolCharacter Character - HiLink rebolSpecialCharacter SpecialChar - HiLink rebolString String +hi def link rebolCharacter Character +hi def link rebolSpecialCharacter SpecialChar +hi def link rebolString String - HiLink rebolNumber Number - HiLink rebolInteger rebolNumber - HiLink rebolDecimal rebolNumber - HiLink rebolTime rebolNumber - HiLink rebolDate rebolNumber - HiLink rebolMoney rebolNumber - HiLink rebolBinary rebolNumber - HiLink rebolEmail rebolString - HiLink rebolFile rebolString - HiLink rebolURL rebolString - HiLink rebolIssue rebolNumber - HiLink rebolTuple rebolNumber - HiLink rebolFloat Float - HiLink rebolBoolean Boolean +hi def link rebolNumber Number +hi def link rebolInteger rebolNumber +hi def link rebolDecimal rebolNumber +hi def link rebolTime rebolNumber +hi def link rebolDate rebolNumber +hi def link rebolMoney rebolNumber +hi def link rebolBinary rebolNumber +hi def link rebolEmail rebolString +hi def link rebolFile rebolString +hi def link rebolURL rebolString +hi def link rebolIssue rebolNumber +hi def link rebolTuple rebolNumber +hi def link rebolFloat Float +hi def link rebolBoolean Boolean - HiLink rebolConstant Constant +hi def link rebolConstant Constant - HiLink rebolComment Comment +hi def link rebolComment Comment - HiLink rebolError Error +hi def link rebolError Error - delcommand HiLink -endif if exists("my_rebol_file") if file_readable(expand(my_rebol_file)) diff --git a/runtime/syntax/redif.vim b/runtime/syntax/redif.vim index 1a44a9f479..725067fd32 100644 --- a/runtime/syntax/redif.vim +++ b/runtime/syntax/redif.vim @@ -7,10 +7,8 @@ " File Extension: rdf " Note: The ReDIF format is used by RePEc. -" To be compatible with Vim 5.8 use: -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif diff --git a/runtime/syntax/registry.vim b/runtime/syntax/registry.vim index 4524247a08..67b5e49bcb 100644 --- a/runtime/syntax/registry.vim +++ b/runtime/syntax/registry.vim @@ -6,11 +6,8 @@ " Included patch from Alexander A. Ulitin " clear any unwanted syntax defs -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -85,29 +82,20 @@ syn match registryHex "^\s*\([0-9a-fA-F]\{2},\)\{0,999}\([0-9a-fA-F]\{2}\|\\\)$ " Dword (32 bits) syn match registryDword "dword:[0-9a-fA-F]\{8}$" contains=registrySpecial -if version >= 508 || !exists("did_registry_syntax_inits") - if version < 508 - let did_registry_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif " The default methods for highlighting. Can be overridden later - HiLink registryComment Comment - HiLink registryHead Constant - HiLink registryHKEY Constant - HiLink registryPath Special - HiLink registryRemove PreProc - HiLink registryGUID Identifier - HiLink registrySpecial Special - HiLink registrySubKey Type - HiLink registryString String - HiLink registryHex Number - HiLink registryDword Number +hi def link registryComment Comment +hi def link registryHead Constant +hi def link registryHKEY Constant +hi def link registryPath Special +hi def link registryRemove PreProc +hi def link registryGUID Identifier +hi def link registrySpecial Special +hi def link registrySubKey Type +hi def link registryString String +hi def link registryHex Number +hi def link registryDword Number - delcommand HiLink -endif let b:current_syntax = "registry" diff --git a/runtime/syntax/remind.vim b/runtime/syntax/remind.vim index 98064e043a..9e7ff22e14 100644 --- a/runtime/syntax/remind.vim +++ b/runtime/syntax/remind.vim @@ -13,9 +13,8 @@ " version 0.7: updated email and link " version 0.6: added THROUGH keyword (courtesy of Ben Orchard) -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -48,35 +47,26 @@ syn match remindDates "'[0-9]\{4}[/-][0-9]\{1,2}[/-][0-9]\{1,2}\(@[0-9]\{1,2}[: syn match remindWarning display excludenl "\S\s\+$"ms=s+1 -if version >= 508 || !exists("did_remind_syn_inits") - if version < 508 - let did_remind_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - HiLink remindCommands Function - HiLink remindExpiry Repeat - HiLink remindTag Label - HiLink remindTimed Statement - HiLink remindMove Statement - HiLink remindSpecial Include - HiLink remindRun Function - HiLink remindConditional Conditional - HiLink remindComment Comment - HiLink remindTimes String - HiLink remindString String - HiLink remindDebug Debug - HiLink remindVar Identifier - HiLink remindSubst Constant - HiLink remindAdvanceNumber Number - HiLink remindDateSeparators Comment - HiLink remindDates String - HiLink remindWarning Error +hi def link remindCommands Function +hi def link remindExpiry Repeat +hi def link remindTag Label +hi def link remindTimed Statement +hi def link remindMove Statement +hi def link remindSpecial Include +hi def link remindRun Function +hi def link remindConditional Conditional +hi def link remindComment Comment +hi def link remindTimes String +hi def link remindString String +hi def link remindDebug Debug +hi def link remindVar Identifier +hi def link remindSubst Constant +hi def link remindAdvanceNumber Number +hi def link remindDateSeparators Comment +hi def link remindDates String +hi def link remindWarning Error - delcommand HiLink -endif let b:current_syntax = "remind" diff --git a/runtime/syntax/resolv.vim b/runtime/syntax/resolv.vim index 06d6885c1c..a879116a5f 100644 --- a/runtime/syntax/resolv.vim +++ b/runtime/syntax/resolv.vim @@ -9,9 +9,8 @@ " David Necas (Yeti) " Stefano Zacchiroli -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -50,38 +49,29 @@ syn match resolvOption /\<\%(ndots\|timeout\|attempts\):\d\+\>/ contained contai " Additional errors syn match resolvError /^search .\{257,}/ -if version >= 508 || !exists("did_config_syntax_inits") - if version < 508 - let did_config_syntax_inits = 1 - command! -nargs=+ HiLink hi link - else - command! -nargs=+ HiLink hi def link - endif - HiLink resolvIP Number - HiLink resolvIPNetmask Number - HiLink resolvHostname String - HiLink resolvOption String +hi def link resolvIP Number +hi def link resolvIPNetmask Number +hi def link resolvHostname String +hi def link resolvOption String - HiLink resolvIPNameserver Number - HiLink resolvHostnameSearch String - HiLink resolvIPNetmaskSortList Number +hi def link resolvIPNameserver Number +hi def link resolvHostnameSearch String +hi def link resolvIPNetmaskSortList Number - HiLink resolvNameServer Identifier - HiLink resolvLwserver Identifier - HiLink resolvDomain Identifier - HiLink resolvSearch Identifier - HiLink resolvSortList Identifier - HiLink resolvOptions Identifier +hi def link resolvNameServer Identifier +hi def link resolvLwserver Identifier +hi def link resolvDomain Identifier +hi def link resolvSearch Identifier +hi def link resolvSortList Identifier +hi def link resolvOptions Identifier - HiLink resolvComment Comment - HiLink resolvOperator Operator - HiLink resolvError Error - HiLink resolvIPError Error - HiLink resolvIPSpecial Special +hi def link resolvComment Comment +hi def link resolvOperator Operator +hi def link resolvError Error +hi def link resolvIPError Error +hi def link resolvIPSpecial Special - delcommand HiLink -endif let b:current_syntax = "resolv" diff --git a/runtime/syntax/reva.vim b/runtime/syntax/reva.vim index 03dfc9d4c3..f605992190 100644 --- a/runtime/syntax/reva.vim +++ b/runtime/syntax/reva.vim @@ -7,13 +7,8 @@ " Filetypes: *.rf *.frt " NOTE: You should also have the ftplugin/reva.vim file to set 'isk' -" For version 5.x: Clear all syntax items and don't load -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear - echo "Reva syntax file requires version 6.0 or later of vim!" - finish -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif diff --git a/runtime/syntax/rexx.vim b/runtime/syntax/rexx.vim index ef698a5351..360fc8ff9f 100644 --- a/runtime/syntax/rexx.vim +++ b/runtime/syntax/rexx.vim @@ -6,11 +6,8 @@ " Special Thanks to Dan Sharp and Rony G. Flatscher " for comments and additions -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -244,87 +241,77 @@ syn sync linecont "\(,\|-\ze-\@!\)\ze\s*\(--.*\|\/\*.*\)*$" exec "syn sync fromstart" " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_rexx_syn_inits") - if version < 508 - let did_rexx_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - " make binary and hex strings stand out - hi rexxStringConstant term=bold,underline ctermfg=5 cterm=bold guifg=darkMagenta gui=bold +" make binary and hex strings stand out +hi rexxStringConstant term=bold,underline ctermfg=5 cterm=bold guifg=darkMagenta gui=bold - HiLink rexxLabel2 Function - HiLink doLoopSelectLabelRegion rexxKeyword - HiLink endIterateLeaveLabelRegion rexxKeyword - HiLink rexxLoopKeywords rexxKeyword " Todo +hi def link rexxLabel2 Function +hi def link doLoopSelectLabelRegion rexxKeyword +hi def link endIterateLeaveLabelRegion rexxKeyword +hi def link rexxLoopKeywords rexxKeyword " Todo - HiLink rexxNumber Normal "DiffChange -" HiLink rexxIdentifier DiffChange +hi def link rexxNumber Normal "DiffChange +" hi def link rexxIdentifier DiffChange - HiLink rexxRegularCallSignal Statement - HiLink rexxExceptionHandling Statement +hi def link rexxRegularCallSignal Statement +hi def link rexxExceptionHandling Statement - HiLink rexxLabel Function - HiLink rexxCharacter Character - HiLink rexxParenError rexxError - HiLink rexxInParen rexxError - HiLink rexxCommentError rexxError - HiLink rexxError Error - HiLink rexxKeyword Statement - HiLink rexxKeywordStatements Statement +hi def link rexxLabel Function +hi def link rexxCharacter Character +hi def link rexxParenError rexxError +hi def link rexxInParen rexxError +hi def link rexxCommentError rexxError +hi def link rexxError Error +hi def link rexxKeyword Statement +hi def link rexxKeywordStatements Statement - HiLink rexxFunction Function - HiLink rexxString String - HiLink rexxComment Comment - HiLink rexxTodo Todo - HiLink rexxSpecialVariable Special - HiLink rexxConditional rexxKeyword +hi def link rexxFunction Function +hi def link rexxString String +hi def link rexxComment Comment +hi def link rexxTodo Todo +hi def link rexxSpecialVariable Special +hi def link rexxConditional rexxKeyword - HiLink rexxOperator Operator - HiLink rexxMessageOperator rexxOperator - HiLink rexxLineComment Comment +hi def link rexxOperator Operator +hi def link rexxMessageOperator rexxOperator +hi def link rexxLineComment Comment - HiLink rexxLineContinue WildMenu +hi def link rexxLineContinue WildMenu - HiLink rexxDirective rexxKeyword - HiLink rexxClassDirective Type - HiLink rexxMethodDirective rexxFunction - HiLink rexxAttributeDirective rexxFunction - HiLink rexxRequiresDirective Include - HiLink rexxRoutineDirective rexxFunction +hi def link rexxDirective rexxKeyword +hi def link rexxClassDirective Type +hi def link rexxMethodDirective rexxFunction +hi def link rexxAttributeDirective rexxFunction +hi def link rexxRequiresDirective Include +hi def link rexxRoutineDirective rexxFunction " rgf, 2012-09-09 - HiLink rexxOptionsDirective rexxFunction - HiLink rexxOptionsDirective2 rexxOptionsDirective - HiLink rexxOptionsDirective3 Normal " rexxOptionsDirective +hi def link rexxOptionsDirective rexxFunction +hi def link rexxOptionsDirective2 rexxOptionsDirective +hi def link rexxOptionsDirective3 Normal " rexxOptionsDirective - HiLink rexxConstantDirective rexxFunction +hi def link rexxConstantDirective rexxFunction - HiLink rexxConst Constant - HiLink rexxTypeSpecifier Type - HiLink rexxBuiltinClass rexxTypeSpecifier +hi def link rexxConst Constant +hi def link rexxTypeSpecifier Type +hi def link rexxBuiltinClass rexxTypeSpecifier - HiLink rexxEnvironmentSymbol rexxConst - HiLink rexxMessage rexxFunction +hi def link rexxEnvironmentSymbol rexxConst +hi def link rexxMessage rexxFunction - HiLink rexxParse rexxKeyword - HiLink rexxParse2 rexxParse +hi def link rexxParse rexxKeyword +hi def link rexxParse2 rexxParse - HiLink rexxGuard rexxKeyword - HiLink rexxTrace rexxKeyword +hi def link rexxGuard rexxKeyword +hi def link rexxTrace rexxKeyword - HiLink rexxRaise rexxKeyword - HiLink rexxRaise2 rexxRaise +hi def link rexxRaise rexxKeyword +hi def link rexxRaise2 rexxRaise - HiLink rexxForward rexxKeyword - HiLink rexxForward2 rexxForward +hi def link rexxForward rexxKeyword +hi def link rexxForward2 rexxForward - delcommand HiLink -endif let b:current_syntax = "rexx" diff --git a/runtime/syntax/rhelp.vim b/runtime/syntax/rhelp.vim index 47c764e296..8cac585bb0 100644 --- a/runtime/syntax/rhelp.vim +++ b/runtime/syntax/rhelp.vim @@ -3,7 +3,7 @@ " Maintainer: Jakson Aquino " Former Maintainer: Johannes Ranke " Homepage: https://github.com/jalvesaq/R-Vim-runtime -" Last Change: Sat Feb 06, 2016 11:34AM +" Last Change: Tue Jun 28, 2016 08:53AM " Remarks: - Includes R syntax highlighting in the appropriate " sections if an r.vim file is in the same directory or in the " default debian location. @@ -17,7 +17,6 @@ if exists("b:current_syntax") endif scriptencoding utf-8 -setlocal iskeyword=@,48-57,_,. syn case match diff --git a/runtime/syntax/rib.vim b/runtime/syntax/rib.vim index 6b9f2b0bd4..0ee607122f 100644 --- a/runtime/syntax/rib.vim +++ b/runtime/syntax/rib.vim @@ -4,10 +4,8 @@ " Last Change: 2003 May 11 " -" Remove any old syntax stuff hanging around -if version < 600 - syn clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -46,26 +44,17 @@ syn match ribFloat display contained "[-]\=\.\d\+\(e[-+]\=\d\+\)\=\>" syn match ribFloat display contained "[-]\=\d\+e[-+]\d\+\>" syn case match -if version >= 508 || !exists("did_rib_syntax_inits") - if version < 508 - let did_rib_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - HiLink ribStructure Structure - HiLink ribCommand Statement +hi def link ribStructure Structure +hi def link ribCommand Statement - HiLink ribStructureComment SpecialComment - HiLink ribLineComment Comment +hi def link ribStructureComment SpecialComment +hi def link ribLineComment Comment - HiLink ribString String - HiLink ribNumber Number - HiLink ribFloat Float +hi def link ribString String +hi def link ribNumber Number +hi def link ribFloat Float - delcommand HiLink -end let b:current_syntax = "rib" diff --git a/runtime/syntax/rmd.vim b/runtime/syntax/rmd.vim index 4cde7441d3..05435354ad 100644 --- a/runtime/syntax/rmd.vim +++ b/runtime/syntax/rmd.vim @@ -1,17 +1,26 @@ " markdown Text with R statements " Language: markdown with R code chunks " Homepage: https://github.com/jalvesaq/R-Vim-runtime -" Last Change: Sat Feb 06, 2016 06:45AM +" Last Change: Sat Jan 28, 2017 10:06PM " " CONFIGURATION: -" To highlight chunk headers as R code, put in your vimrc: +" To highlight chunk headers as R code, put in your vimrc (e.g. .config/nvim/init.vim): " let rmd_syn_hl_chunk = 1 +" +" For highlighting pandoc extensions to markdown like citations and TeX and +" many other advanced features like folding of markdown sections, it is +" recommended to install the vim-pandoc filetype plugin as well as the +" vim-pandoc-syntax filetype plugin from https://github.com/vim-pandoc. +" +" TODO: +" - Provide highlighting for rmarkdown parameters in yaml header if exists("b:current_syntax") finish endif -" load all of pandoc info +" load all of pandoc info, e.g. from +" https://github.com/vim-pandoc/vim-pandoc-syntax runtime syntax/pandoc.vim if exists("b:current_syntax") let rmdIsPandoc = 1 @@ -22,28 +31,54 @@ else if exists("b:current_syntax") unlet b:current_syntax endif + + " load all of the yaml syntax highlighting rules into @yaml + syntax include @yaml syntax/yaml.vim + if exists("b:current_syntax") + unlet b:current_syntax + endif + + " highlight yaml block commonly used for front matter + syntax region rmdYamlBlock matchgroup=rmdYamlBlockDelim start="^---" matchgroup=rmdYamlBlockDelim end="^---" contains=@yaml keepend fold endif -" load all of the r syntax highlighting rules into @R -syntax include @R syntax/r.vim -if exists("b:current_syntax") - unlet b:current_syntax -endif - -if exists("g:rmd_syn_hl_chunk") - " highlight R code inside chunk header - syntax match rmdChunkDelim "^[ \t]*```{r" contained - syntax match rmdChunkDelim "}$" contained +if !exists("g:rmd_syn_langs") + let g:rmd_syn_langs = ["r"] else - syntax match rmdChunkDelim "^[ \t]*```{r.*}$" contained + let s:hasr = 0 + for s:lng in g:rmd_syn_langs + if s:lng == "r" + let s:hasr = 1 + endif + endfor + if s:hasr == 0 + let g:rmd_syn_langs += ["r"] + endif endif -syntax match rmdChunkDelim "^[ \t]*```$" contained -syntax region rmdChunk start="^[ \t]*``` *{r.*}$" end="^[ \t]*```$" contains=@R,rmdChunkDelim keepend fold + +for s:lng in g:rmd_syn_langs + exe 'syntax include @' . toupper(s:lng) . ' syntax/'. s:lng . '.vim' + if exists("b:current_syntax") + unlet b:current_syntax + endif + exe 'syntax region rmd' . toupper(s:lng) . 'Chunk start="^[ \t]*``` *{\(' . s:lng . '\|r.*engine\s*=\s*["' . "']" . s:lng . "['" . '"]\).*}$" end="^[ \t]*```$" contains=@' . toupper(s:lng) . ',rmd' . toupper(s:lng) . 'ChunkDelim keepend fold' + + if exists("g:rmd_syn_hl_chunk") && s:lng == "r" + " highlight R code inside chunk header + syntax match rmdRChunkDelim "^[ \t]*```{r" contained + syntax match rmdRChunkDelim "}$" contained + else + exe 'syntax match rmd' . toupper(s:lng) . 'ChunkDelim "^[ \t]*```{\(' . s:lng . '\|r.*engine\s*=\s*["' . "']" . s:lng . "['" . '"]\).*}$" contained' + endif + exe 'syntax match rmd' . toupper(s:lng) . 'ChunkDelim "^[ \t]*```$" contained' +endfor + " also match and syntax highlight in-line R code -syntax match rmdEndInline "`" contained -syntax match rmdBeginInline "`r " contained -syntax region rmdrInline start="`r " end="`" contains=@R,rmdBeginInline,rmdEndInline keepend +syntax region rmdrInline matchgroup=rmdInlineDelim start="`r " end="`" contains=@R containedin=pandocLaTeXRegion,yamlFlowString keepend +" I was not able to highlight rmdrInline inside a pandocLaTeXCommand, although +" highlighting works within pandocLaTeXRegion and yamlFlowString. +syntax cluster texMathZoneGroup add=rmdrInline " match slidify special marker syntax match rmdSlidifySpecial "\*\*\*" @@ -56,8 +91,6 @@ if rmdIsPandoc == 0 if exists("b:current_syntax") unlet b:current_syntax endif - " Extend cluster - syn cluster texMathZoneGroup add=rmdrInline " Inline syntax match rmdLaTeXInlDelim "\$" syntax match rmdLaTeXInlDelim "\\\$" @@ -65,21 +98,24 @@ if rmdIsPandoc == 0 " Region syntax match rmdLaTeXRegDelim "\$\$" contained syntax match rmdLaTeXRegDelim "\$\$latex$" contained - syntax region rmdLaTeXRegion start="^\$\$" skip="\\\$" end="\$\$$" contains=@LaTeX,rmdLaTeXSt,rmdLaTeXRegDelim keepend - syntax region rmdLaTeXRegion2 start="^\\\[" end="\\\]" contains=@LaTeX,rmdLaTeXSt,rmdLaTeXRegDelim keepend + syntax match rmdLaTeXSt "\\[a-zA-Z]\+" + syntax region rmdLaTeXRegion start="^\$\$" skip="\\\$" end="\$\$$" contains=@LaTeX,rmdLaTeXRegDelim keepend + syntax region rmdLaTeXRegion2 start="^\\\[" end="\\\]" contains=@LaTeX,rmdLaTeXRegDelim keepend + hi def link rmdBlockQuote Comment hi def link rmdLaTeXSt Statement hi def link rmdLaTeXInlDelim Special hi def link rmdLaTeXRegDelim Special endif -setlocal iskeyword=@,48-57,_,. +for s:lng in g:rmd_syn_langs + exe 'syn sync match rmd' . toupper(s:lng) . 'SyncChunk grouphere rmd' . toupper(s:lng) . 'Chunk /^[ \t]*``` *{\(' . s:lng . '\|r.*engine\s*=\s*["' . "']" . s:lng . "['" . '"]\)/' +endfor -syn sync match rmdSyncChunk grouphere rmdChunk "^[ \t]*``` *{r" - -hi def link rmdChunkDelim Special -hi def link rmdBeginInline Special -hi def link rmdEndInline Special -hi def link rmdBlockQuote Comment +hi def link rmdYamlBlockDelim Delim +for s:lng in g:rmd_syn_langs + exe 'hi def link rmd' . toupper(s:lng) . 'ChunkDelim Special' +endfor +hi def link rmdInlineDelim Special hi def link rmdSlidifySpecial Special let b:current_syntax = "rmd" diff --git a/runtime/syntax/rnc.vim b/runtime/syntax/rnc.vim index 8436c88755..7d3907e991 100644 --- a/runtime/syntax/rnc.vim +++ b/runtime/syntax/rnc.vim @@ -1,7 +1,7 @@ " Vim syntax file -" Language: Relax NG compact syntax -" Maintainer: Nikolai Weibull -" Latest Revision: 2007-06-17 +" Language: Relax NG compact syntax +" Previous Maintainer: Nikolai Weibull +" Latest Revision: 2007-06-17 if exists("b:current_syntax") finish diff --git a/runtime/syntax/robots.vim b/runtime/syntax/robots.vim index 066628bb3c..396bf52b25 100644 --- a/runtime/syntax/robots.vim +++ b/runtime/syntax/robots.vim @@ -5,11 +5,8 @@ " URL: http://www.mggen.com/vim/syntax/robots.zip " Last change: 2001 May 09 -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -41,26 +38,17 @@ syn match robotsUrl "http[s]\=://\S*" syn match robotsMail "\S*@\S*" syn region robotsString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ -if version >= 508 || !exists("did_robos_syntax_inits") - if version < 508 - let did_robots_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - HiLink robotsComment Comment - HiLink robotsAgent Type - HiLink robotsDisallow Statement - HiLink robotsLine Special - HiLink robotsStar Operator - HiLink robotsDelimiter Delimiter - HiLink robotsUrl String - HiLink robotsMail String - HiLink robotsString String +hi def link robotsComment Comment +hi def link robotsAgent Type +hi def link robotsDisallow Statement +hi def link robotsLine Special +hi def link robotsStar Operator +hi def link robotsDelimiter Delimiter +hi def link robotsUrl String +hi def link robotsMail String +hi def link robotsString String - delcommand HiLink -endif let b:current_syntax = "robots" diff --git a/runtime/syntax/rpcgen.vim b/runtime/syntax/rpcgen.vim index 85036dc049..08183d43a4 100644 --- a/runtime/syntax/rpcgen.vim +++ b/runtime/syntax/rpcgen.vim @@ -1,8 +1,8 @@ " Vim syntax file " Language: rpcgen " Maintainer: Charles E. Campbell -" Last Change: Jan 13, 2015 -" Version: 10 +" Last Change: Aug 31, 2016 +" Version: 12 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_RPCGEN if exists("b:current_syntax") @@ -10,11 +10,7 @@ if exists("b:current_syntax") endif " Read the C syntax to start with -if version < 600 - source :p:h/c.vim -else - runtime! syntax/c.vim -endif +runtime! syntax/c.vim syn keyword rpcProgram program skipnl skipwhite nextgroup=rpcProgName syn match rpcProgName contained "\<\i\I*\>" skipnl skipwhite nextgroup=rpcProgZone @@ -28,30 +24,21 @@ syn match rpcProgNmbrErr contained "=\s*0x[^23]\x*"ms=s+1 syn match rpcPassThru "^\s*%.*$" " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_rpcgen_syntax_inits") - if version < 508 - let did_rpcgen_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +if !exists("skip_rpcgen_syntax_inits") - HiLink rpcProgName rpcName - HiLink rpcProgram rpcStatement - HiLink rpcVersName rpcName - HiLink rpcVersion rpcStatement + hi def link rpcProgName rpcName + hi def link rpcProgram rpcStatement + hi def link rpcVersName rpcName + hi def link rpcVersion rpcStatement - HiLink rpcDecl cType - HiLink rpcPassThru cComment + hi def link rpcDecl cType + hi def link rpcPassThru cComment - HiLink rpcName Special - HiLink rpcProcNmbr Delimiter - HiLink rpcProgNmbrErr Error - HiLink rpcStatement Statement + hi def link rpcName Special + hi def link rpcProcNmbr Delimiter + hi def link rpcProgNmbrErr Error + hi def link rpcStatement Statement - delcommand HiLink endif let b:current_syntax = "rpcgen" diff --git a/runtime/syntax/rpl.vim b/runtime/syntax/rpl.vim index 6457803a06..f339f7ae6e 100644 --- a/runtime/syntax/rpl.vim +++ b/runtime/syntax/rpl.vim @@ -6,11 +6,8 @@ " URL: http://www.makalis.fr/~bertrand/rpl2/download/vim/indent/rpl.vim " Credits: Nothing -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -417,77 +414,67 @@ syntax region rplString start=+\(^\|\s\+\)"+ end=+"\ze\($\|\s\+\)+ contains=rplS syntax match rplTab "\t" transparent " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_rpl_syntax_inits") - if version < 508 - let did_rpl_syntax_inits = 1 - command -nargs=+ HiLink highlight link - else - command -nargs=+ HiLink highlight default link - endif +" Only when an item doesn't have highlighting yet - " The default highlighting. +" The default highlighting. - HiLink rplControl Statement - HiLink rplStatement Statement - HiLink rplAlgConditional Conditional - HiLink rplConditional Repeat - HiLink rplConditionalError Error - HiLink rplRepeat Repeat - HiLink rplCycle Repeat - HiLink rplUntil Repeat - HiLink rplIntrinsic Special - HiLink rplStorage StorageClass - HiLink rplStorageExpr StorageClass - HiLink rplStorageError Error - HiLink rplReadWrite rplIntrinsic +hi def link rplControl Statement +hi def link rplStatement Statement +hi def link rplAlgConditional Conditional +hi def link rplConditional Repeat +hi def link rplConditionalError Error +hi def link rplRepeat Repeat +hi def link rplCycle Repeat +hi def link rplUntil Repeat +hi def link rplIntrinsic Special +hi def link rplStorage StorageClass +hi def link rplStorageExpr StorageClass +hi def link rplStorageError Error +hi def link rplReadWrite rplIntrinsic - HiLink rplOperator Operator +hi def link rplOperator Operator - HiLink rplList Special - HiLink rplArray Special - HiLink rplConstant Identifier - HiLink rplExpr Type +hi def link rplList Special +hi def link rplArray Special +hi def link rplConstant Identifier +hi def link rplExpr Type - HiLink rplString String - HiLink rplStringGuilles String - HiLink rplStringAntislash String +hi def link rplString String +hi def link rplStringGuilles String +hi def link rplStringAntislash String - HiLink rplBinary Boolean - HiLink rplOctal Boolean - HiLink rplDecimal Boolean - HiLink rplHexadecimal Boolean - HiLink rplInteger Number - HiLink rplFloat Float - HiLink rplComplex Float - HiLink rplBoolean Identifier +hi def link rplBinary Boolean +hi def link rplOctal Boolean +hi def link rplDecimal Boolean +hi def link rplHexadecimal Boolean +hi def link rplInteger Number +hi def link rplFloat Float +hi def link rplComplex Float +hi def link rplBoolean Identifier - HiLink rplObsolete Todo +hi def link rplObsolete Todo - HiLink rplPreCondit PreCondit - HiLink rplInclude Include - HiLink rplIncluded rplString - HiLink rplInclude Include - HiLink rplExecPath Include - HiLink rplPreProc PreProc - HiLink rplComment Comment - HiLink rplCommentLine Comment - HiLink rplCommentString Comment - HiLink rplSubDelimitor rplStorage - HiLink rplCommentError Error - HiLink rplParenError Error - HiLink rplSubError Error - HiLink rplArrayError Error - HiLink rplListError Error - HiLink rplTab Error - HiLink rplBinaryError Error - HiLink rplOctalError Error - HiLink rplDecimalError Error - HiLink rplHexadecimalError Error +hi def link rplPreCondit PreCondit +hi def link rplInclude Include +hi def link rplIncluded rplString +hi def link rplInclude Include +hi def link rplExecPath Include +hi def link rplPreProc PreProc +hi def link rplComment Comment +hi def link rplCommentLine Comment +hi def link rplCommentString Comment +hi def link rplSubDelimitor rplStorage +hi def link rplCommentError Error +hi def link rplParenError Error +hi def link rplSubError Error +hi def link rplArrayError Error +hi def link rplListError Error +hi def link rplTab Error +hi def link rplBinaryError Error +hi def link rplOctalError Error +hi def link rplDecimalError Error +hi def link rplHexadecimalError Error - delcommand HiLink -endif let b:current_syntax = "rpl" diff --git a/runtime/syntax/rrst.vim b/runtime/syntax/rrst.vim index 24d3844df0..b643af3285 100644 --- a/runtime/syntax/rrst.vim +++ b/runtime/syntax/rrst.vim @@ -2,7 +2,7 @@ " Language: reST with R code chunks " Maintainer: Alex Zvoleff, azvoleff@mail.sdsu.edu " Homepage: https://github.com/jalvesaq/R-Vim-runtime -" Last Change: Sat Feb 06, 2016 06:45AM +" Last Change: Tue Jun 28, 2016 08:53AM " " CONFIGURATION: " To highlight chunk headers as R code, put in your vimrc: @@ -19,8 +19,6 @@ unlet b:current_syntax " load all of the r syntax highlighting rules into @R syntax include @R syntax/r.vim -setlocal iskeyword=@,48-57,_,. - " highlight R chunks if exists("g:rrst_syn_hl_chunk") " highlight R code inside chunk header diff --git a/runtime/syntax/rst.vim b/runtime/syntax/rst.vim index ef07b22676..232d2a7de3 100644 --- a/runtime/syntax/rst.vim +++ b/runtime/syntax/rst.vim @@ -2,7 +2,8 @@ " Language: reStructuredText documentation format " Maintainer: Marshall Ward " Previous Maintainer: Nikolai Weibull -" Latest Revision: 2016-06-17 +" Website: https://github.com/marshallward/vim-restructuredtext +" Latest Revision: 2016-08-18 if exists("b:current_syntax") finish @@ -89,7 +90,7 @@ function! s:DefineOneInlineMarkup(name, start, middle, end, char_left, char_righ \ ' start=+' . a:char_left . '\zs' . a:start . \ '\ze[^[:space:]' . a:char_right . a:start[strlen(a:start) - 1] . ']+' . \ a:middle . - \ ' end=+\S' . a:end . '\ze\%($\|\s\|[''")\]}>/:.,;!?\\-]\)+' + \ ' end=+\S' . a:end . '\ze\%($\|\s\|[''"’)\]}>/:.,;!?\\-]\)+' endfunction function! s:DefineInlineMarkup(name, start, middle, end) @@ -103,6 +104,8 @@ function! s:DefineInlineMarkup(name, start, middle, end) call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '\[', '\]') call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '{', '}') call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '<', '>') + call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '’', '’') + " TODO: Additional Unicode Pd, Po, Pi, Pf, Ps characters call s:DefineOneInlineMarkup(a:name, a:start, middle, a:end, '\%(^\|\s\|[/:]\)', '') @@ -186,11 +189,8 @@ hi def link rstHyperlinkTarget String hi def link rstExDirective String hi def link rstSubstitutionDefinition rstDirective hi def link rstDelimiter Delimiter -hi def link rstEmphasis Underlined -hi def link rstStrongEmphasis Special -" TODO Append these atttributes somehow -"hi def rstEmphasis term=italic cterm=italic gui=italic -"hi def rstStrongEmphasis term=bold cterm=bold gui=bold +hi def rstEmphasis ctermfg=13 term=italic cterm=italic gui=italic +hi def rstStrongEmphasis ctermfg=1 term=bold cterm=bold gui=bold hi def link rstInterpretedTextOrHyperlinkReference Identifier hi def link rstInlineLiteral String hi def link rstSubstitutionReference PreProc diff --git a/runtime/syntax/rtf.vim b/runtime/syntax/rtf.vim index 8f5ea71a36..c856f9ffcf 100644 --- a/runtime/syntax/rtf.vim +++ b/runtime/syntax/rtf.vim @@ -13,11 +13,8 @@ " TODO: render underline, italic, bold -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -52,35 +49,25 @@ syn match rtfBlue "\\blue[0-9][0-9]*" syn match rtfFootNote "[#$K+]{\\footnote.*}" contains=rtfControlWord,rtfNewControlWord " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_rtf_syntax_inits") - if version < 508 - let did_rtf_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink rtfControlWord Statement - HiLink rtfNewControlWord Special - HiLink rtfControlSymbol Constant - HiLink rtfCharacter Character - HiLink rtfUnicodeCharacter SpecialChar - HiLink rtfFootNote Comment +hi def link rtfControlWord Statement +hi def link rtfNewControlWord Special +hi def link rtfControlSymbol Constant +hi def link rtfCharacter Character +hi def link rtfUnicodeCharacter SpecialChar +hi def link rtfFootNote Comment - " Define colors for the syntax file - hi rtfRed term=underline cterm=underline ctermfg=DarkRed gui=underline guifg=DarkRed - hi rtfGreen term=underline cterm=underline ctermfg=DarkGreen gui=underline guifg=DarkGreen - hi rtfBlue term=underline cterm=underline ctermfg=DarkBlue gui=underline guifg=DarkBlue +" Define colors for the syntax file +hi rtfRed term=underline cterm=underline ctermfg=DarkRed gui=underline guifg=DarkRed +hi rtfGreen term=underline cterm=underline ctermfg=DarkGreen gui=underline guifg=DarkGreen +hi rtfBlue term=underline cterm=underline ctermfg=DarkBlue gui=underline guifg=DarkBlue - HiLink rtfRed rtfRed - HiLink rtfGreen rtfGreen - HiLink rtfBlue rtfBlue +hi def link rtfRed rtfRed +hi def link rtfGreen rtfGreen +hi def link rtfBlue rtfBlue - delcommand HiLink -endif let b:current_syntax = "rtf" diff --git a/runtime/syntax/ruby.vim b/runtime/syntax/ruby.vim index 28f553decb..ca7f51b1ea 100644 --- a/runtime/syntax/ruby.vim +++ b/runtime/syntax/ruby.vim @@ -9,16 +9,45 @@ " Thanks to perl.vim authors, and to Reimer Behrends. :-) (MN) " ---------------------------------------------------------------------------- +" Prelude {{{1 if exists("b:current_syntax") finish endif +" this file uses line continuations +let s:cpo_sav = &cpo +set cpo&vim + +" Folding Config {{{1 if has("folding") && exists("ruby_fold") setlocal foldmethod=syntax endif +let s:foldable_groups = split( + \ get( + \ b:, + \ 'ruby_foldable_groups', + \ get(g:, 'ruby_foldable_groups', 'ALL') + \ ) + \ ) + +function! s:foldable(...) abort + if index(s:foldable_groups, 'ALL') > -1 + return 1 + endif + + for l:i in a:000 + if index(s:foldable_groups, l:i) > -1 + return 1 + endif + endfor + + return 0 +endfunction " }}} + syn cluster rubyNotTop contains=@rubyExtendedStringSpecial,@rubyRegexpSpecial,@rubyDeclaration,rubyConditional,rubyExceptional,rubyMethodExceptional,rubyTodo +" Whitespace Errors {{{1 if exists("ruby_space_errors") if !exists("ruby_no_trail_space_error") syn match rubySpaceError display excludenl "\s\+$" @@ -28,14 +57,14 @@ if exists("ruby_space_errors") endif endif -" Operators +" Operators {{{1 if exists("ruby_operators") - syn match rubyOperator "[~!^&|*/%+-]\|\%(class\s*\)\@\|<=\|\%(<\|\>\|>=\|=\@\|\*\*\|\.\.\.\|\.\.\|::" + syn match rubyOperator "[~!^|*/%+-]\|&\.\@!\|\%(class\s*\)\@\|<=\|\%(<\|\>\|>=\|=\@1\|\*\*\|\.\.\.\|\.\.\|::" syn match rubyOperator "->\|-=\|/=\|\*\*=\|\*=\|&&=\|&=\|&&\|||=\||=\|||\|%=\|+=\|!\~\|!=" - syn region rubyBracketOperator matchgroup=rubyOperator start="\%(\w[?!]\=\|[]})]\)\@<=\[\s*" end="\s*]" contains=ALLBUT,@rubyNotTop + syn region rubyBracketOperator matchgroup=rubyOperator start="\%(\w[?!]\=\|[]})]\)\@2<=\[\s*" end="\s*]" contains=ALLBUT,@rubyNotTop endif -" Expression Substitution and Backslash Notation +" Expression Substitution and Backslash Notation {{{1 syn match rubyStringEscape "\\\\\|\\[abefnrstv]\|\\\o\{1,3}\|\\x\x\{1,2}" contained display syn match rubyStringEscape "\%(\\M-\\C-\|\\C-\\M-\|\\M-\\c\|\\c\\M-\|\\c\|\\C-\|\\M-\)\%(\\\o\{1,3}\|\\x\x\{1,2}\|\\\=\S\)" contained display syn match rubyQuoteEscape "\\[\\']" contained display @@ -45,18 +74,19 @@ syn match rubyInterpolation "#\%(\$\|@@\=\)\w\+" display contained con syn match rubyInterpolationDelimiter "#\ze\%(\$\|@@\=\)\w\+" display contained syn match rubyInterpolation "#\$\%(-\w\|\W\)" display contained contains=rubyInterpolationDelimiter,rubyPredefinedVariable,rubyInvalidVariable syn match rubyInterpolationDelimiter "#\ze\$\%(-\w\|\W\)" display contained -syn region rubyNoInterpolation start="\\#{" end="}" contained +syn region rubyNoInterpolation start="\\#{" end="}" contained syn match rubyNoInterpolation "\\#{" display contained syn match rubyNoInterpolation "\\#\%(\$\|@@\=\)\w\+" display contained syn match rubyNoInterpolation "\\#\$\W" display contained -syn match rubyDelimEscape "\\[(<{\[)>}\]]" transparent display contained contains=NONE +syn match rubyDelimiterEscape "\\[(<{\[)>}\]]" transparent display contained contains=NONE syn region rubyNestedParentheses start="(" skip="\\\\\|\\)" matchgroup=rubyString end=")" transparent contained syn region rubyNestedCurlyBraces start="{" skip="\\\\\|\\}" matchgroup=rubyString end="}" transparent contained syn region rubyNestedAngleBrackets start="<" skip="\\\\\|\\>" matchgroup=rubyString end=">" transparent contained syn region rubyNestedSquareBrackets start="\[" skip="\\\\\|\\\]" matchgroup=rubyString end="\]" transparent contained +" Regular Expression Metacharacters {{{1 " These are mostly Oniguruma ready syn region rubyRegexpComment matchgroup=rubyRegexpSpecial start="(?#" skip="\\)" end=")" contained syn region rubyRegexpParens matchgroup=rubyRegexpSpecial start="(\(?:\|?<\=[=!]\|?>\|?<[a-z_]\w*>\|?[imx]*-[imx]*:\=\|\%(?#\)\@!\)" skip="\\)" end=")" contained transparent contains=@rubyRegexpSpecial @@ -79,36 +109,40 @@ syn cluster rubyStringSpecial contains=rubyInterpolation,rubyNoInterpolati syn cluster rubyExtendedStringSpecial contains=@rubyStringSpecial,rubyNestedParentheses,rubyNestedCurlyBraces,rubyNestedAngleBrackets,rubyNestedSquareBrackets syn cluster rubyRegexpSpecial contains=rubyInterpolation,rubyNoInterpolation,rubyStringEscape,rubyRegexpSpecial,rubyRegexpEscape,rubyRegexpBrackets,rubyRegexpCharClass,rubyRegexpDot,rubyRegexpQuantifier,rubyRegexpAnchor,rubyRegexpParens,rubyRegexpComment -" Numbers and ASCII Codes -syn match rubyASCIICode "\%(\w\|[]})\"'/]\)\@" display -syn match rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@" display -syn match rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@" display -syn match rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@" display -syn match rubyFloat "\%(\%(\w\|[]})\"']\s*\)\@" display -syn match rubyFloat "\%(\%(\w\|[]})\"']\s*\)\@" display +" Numbers and ASCII Codes {{{1 +syn match rubyASCIICode "\%(\w\|[]})\"'/]\)\@1" display +syn match rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@" display +syn match rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@" display +syn match rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@" display +syn match rubyFloat "\%(\%(\w\|[]})\"']\s*\)\@" display +syn match rubyFloat "\%(\%(\w\|[]})\"']\s*\)\@" display -" Identifiers +" Identifiers {{{1 syn match rubyLocalVariableOrMethod "\<[_[:lower:]][_[:alnum:]]*[?!=]\=" contains=NONE display transparent syn match rubyBlockArgument "&[_[:lower:]][_[:alnum:]]" contains=NONE display transparent -syn match rubyConstant "\%(\%([.@$]\@\|::\)\@=\%(\s*(\)\@!" +syn match rubyConstant "\%(\%(^\|[^.]\)\.\s*\)\@\%(\s*(\)\@!" syn match rubyClassVariable "@@\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*" display -syn match rubyInstanceVariable "@\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*" display +syn match rubyInstanceVariable "@\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*" display syn match rubyGlobalVariable "$\%(\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*\|-.\)" -syn match rubySymbol "[]})\"':]\@\|<=\|<\|===\|[=!]=\|[=!]\~\|!\|>>\|>=\|>\||\|-@\|-\|/\|\[]=\|\[]\|\*\*\|\*\|&\|%\|+@\|+\|`\)" -syn match rubySymbol "[]})\"':]\@_,;:!?/.'"@$*\&+0]\)" -syn match rubySymbol "[]})\"':]\@\@!\)\=" -syn match rubySymbol "\%([{(,]\_s*\)\@<=\l\w*[!?]\=::\@!"he=e-1 -syn match rubySymbol "[]})\"':]\@\|<=\|<\|===\|[=!]=\|[=!]\~\|!@\|!\|>>\|>=\|>\||\|-@\|-\|/\|\[]=\|\[]\|\*\*\|\*\|&\|%\|+@\|+\|`\)" +syn match rubySymbol "[]})\"':]\@1_,;:!?/.'"@$*\&+0]\)" +syn match rubySymbol "[]})\"':]\@1\@!\)\=" + +if s:foldable(':') + syn region rubySymbol start="[]})\"':]\@1\%(\s*(\)*\s*(\@=" syn match rubyBlockParameter "\%(\h\|[^\x00-\x7F]\)\%(\w\|[^\x00-\x7F]\)*" contained -syn region rubyBlockParameterList start="\%(\%(\\|{\)\s*\)\@<=|" end="|" oneline display contains=rubyBlockParameter +syn region rubyBlockParameterList start="\%(\%(\\|{\)\_s*\)\@32<=|" end="|" oneline display contains=rubyBlockParameter syn match rubyInvalidVariable "$[^ A-Za-z_-]" syn match rubyPredefinedVariable #$[!$&"'*+,./0:;<=>?@\`~]# @@ -117,93 +151,187 @@ syn match rubyPredefinedVariable "$_\>" display syn match rubyPredefinedVariable "$-[0FIKadilpvw]\>" display syn match rubyPredefinedVariable "$\%(deferr\|defout\|stderr\|stdin\|stdout\)\>" display syn match rubyPredefinedVariable "$\%(DEBUG\|FILENAME\|KCODE\|LOADED_FEATURES\|LOAD_PATH\|PROGRAM_NAME\|SAFE\|VERBOSE\)\>" display -syn match rubyPredefinedConstant "\%(\%(\.\@\%(\s*(\)\@!" -syn match rubyPredefinedConstant "\%(\%(\.\@\%(\s*(\)\@!" -syn match rubyPredefinedConstant "\%(\%(\.\@\%(\s*(\)\@!" -syn match rubyPredefinedConstant "\%(\%(\.\@\%(\s*(\)\@!" +syn match rubyPredefinedConstant "\%(\%(^\|[^.]\)\.\s*\)\@\%(\s*(\)\@!" +syn match rubyPredefinedConstant "\%(\%(^\|[^.]\)\.\s*\)\@\%(\s*(\)\@!" -" Normal Regular Expression -syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\%(^\|\<\%(and\|or\|while\|until\|unless\|if\|elsif\|when\|not\|then\|else\)\|[;\~=!|&(,[<>?:*+-]\)\s*\)\@<=/" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial fold -syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\h\k*\s\+\)\@<=/[ \t=]\@!" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial fold +" Normal Regular Expression {{{1 +if s:foldable('/') + syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\%(^\|\<\%(and\|or\|while\|until\|unless\|if\|elsif\|when\|not\|then\|else\)\|[;\~=!|&(,{[<>?:*+-]\)\s*\)\@<=/" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial fold + syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\h\k*\s\+\)\@<=/[ \t=]\@!" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial fold +else + syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\%(^\|\<\%(and\|or\|while\|until\|unless\|if\|elsif\|when\|not\|then\|else\)\|[;\~=!|&(,{[<>?:*+-]\)\s*\)\@<=/" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial + syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\h\k*\s\+\)\@<=/[ \t=]\@!" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial +endif -" Generalized Regular Expression -syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\z([~`!@#$%^&*_\-+=|\:;"',.? /]\)" end="\z1[iomxneus]*" skip="\\\\\|\\\z1" contains=@rubyRegexpSpecial fold -syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r{" end="}[iomxneus]*" skip="\\\\\|\\}" contains=@rubyRegexpSpecial fold -syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r<" end=">[iomxneus]*" skip="\\\\\|\\>" contains=@rubyRegexpSpecial,rubyNestedAngleBrackets,rubyDelimEscape fold -syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\[" end="\][iomxneus]*" skip="\\\\\|\\\]" contains=@rubyRegexpSpecial fold -syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r(" end=")[iomxneus]*" skip="\\\\\|\\)" contains=@rubyRegexpSpecial fold +" Generalized Regular Expression {{{1 +if s:foldable('%') + syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1[iomxneus]*" skip="\\\\\|\\\z1" contains=@rubyRegexpSpecial fold + syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r{" end="}[iomxneus]*" skip="\\\\\|\\}" contains=@rubyRegexpSpecial fold + syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r<" end=">[iomxneus]*" skip="\\\\\|\\>" contains=@rubyRegexpSpecial,rubyNestedAngleBrackets,rubyDelimiterEscape fold + syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\[" end="\][iomxneus]*" skip="\\\\\|\\\]" contains=@rubyRegexpSpecial fold + syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r(" end=")[iomxneus]*" skip="\\\\\|\\)" contains=@rubyRegexpSpecial fold + syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\z(\s\)" end="\z1[iomxneus]*" skip="\\\\\|\\\z1" contains=@rubyRegexpSpecial fold +else + syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1[iomxneus]*" skip="\\\\\|\\\z1" contains=@rubyRegexpSpecial + syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r{" end="}[iomxneus]*" skip="\\\\\|\\}" contains=@rubyRegexpSpecial + syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r<" end=">[iomxneus]*" skip="\\\\\|\\>" contains=@rubyRegexpSpecial,rubyNestedAngleBrackets,rubyDelimiterEscape + syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\[" end="\][iomxneus]*" skip="\\\\\|\\\]" contains=@rubyRegexpSpecial + syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r(" end=")[iomxneus]*" skip="\\\\\|\\)" contains=@rubyRegexpSpecial + syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="%r\z(\s\)" end="\z1[iomxneus]*" skip="\\\\\|\\\z1" contains=@rubyRegexpSpecial +endif -" Normal String and Shell Command Output -syn region rubyString matchgroup=rubyStringDelimiter start="\"" end="\"" skip="\\\\\|\\\"" contains=@rubyStringSpecial,@Spell fold -syn region rubyString matchgroup=rubyStringDelimiter start="'" end="'" skip="\\\\\|\\'" contains=rubyQuoteEscape,@Spell fold -syn region rubyString matchgroup=rubyStringDelimiter start="`" end="`" skip="\\\\\|\\`" contains=@rubyStringSpecial fold +" Normal String {{{1 +let s:spell_cluster = exists('ruby_spellcheck_strings') ? ',@Spell' : '' +exe 'syn region rubyString matchgroup=rubyStringDelimiter start="\"" end="\"" skip="\\\\\|\\\"" ' . + \ (s:foldable('%') ? 'fold' : '') . ' contains=@rubyStringSpecial' . s:spell_cluster +exe 'syn region rubyString matchgroup=rubyStringDelimiter start="''" end="''" skip="\\\\\|\\''" ' . + \ (s:foldable('%') ? 'fold' : '') . ' contains=rubyQuoteEscape' . s:spell_cluster -" Generalized Single Quoted String, Symbol and Array of Strings -syn region rubyString matchgroup=rubyStringDelimiter start="%[qwi]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" fold -syn region rubyString matchgroup=rubyStringDelimiter start="%[qwi]{" end="}" skip="\\\\\|\\}" fold contains=rubyNestedCurlyBraces,rubyDelimEscape -syn region rubyString matchgroup=rubyStringDelimiter start="%[qwi]<" end=">" skip="\\\\\|\\>" fold contains=rubyNestedAngleBrackets,rubyDelimEscape -syn region rubyString matchgroup=rubyStringDelimiter start="%[qwi]\[" end="\]" skip="\\\\\|\\\]" fold contains=rubyNestedSquareBrackets,rubyDelimEscape -syn region rubyString matchgroup=rubyStringDelimiter start="%[qwi](" end=")" skip="\\\\\|\\)" fold contains=rubyNestedParentheses,rubyDelimEscape -syn region rubyString matchgroup=rubyStringDelimiter start="%q " end=" " skip="\\\\\|\\)" fold -syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s\z([~`!@#$%^&*_\-+=|\:;"',.? /]\)" end="\z1" skip="\\\\\|\\\z1" fold -syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s{" end="}" skip="\\\\\|\\}" fold contains=rubyNestedCurlyBraces,rubyDelimEscape -syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s<" end=">" skip="\\\\\|\\>" fold contains=rubyNestedAngleBrackets,rubyDelimEscape -syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s\[" end="\]" skip="\\\\\|\\\]" fold contains=rubyNestedSquareBrackets,rubyDelimEscape -syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s(" end=")" skip="\\\\\|\\)" fold contains=rubyNestedParentheses,rubyDelimEscape +" Shell Command Output {{{1 +if s:foldable('%') + syn region rubyString matchgroup=rubyStringDelimiter start="`" end="`" skip="\\\\\|\\`" contains=@rubyStringSpecial fold +else + syn region rubyString matchgroup=rubyStringDelimiter start="`" end="`" skip="\\\\\|\\`" contains=@rubyStringSpecial +endif -" Generalized Double Quoted String and Array of Strings and Shell Command Output +" Generalized Single Quoted String, Symbol and Array of Strings {{{1 +if s:foldable('%') + syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" fold + syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]{" end="}" skip="\\\\\|\\}" fold contains=rubyNestedCurlyBraces,rubyDelimiterEscape + syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]<" end=">" skip="\\\\\|\\>" fold contains=rubyNestedAngleBrackets,rubyDelimiterEscape + syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]\[" end="\]" skip="\\\\\|\\\]" fold contains=rubyNestedSquareBrackets,rubyDelimiterEscape + syn region rubyString matchgroup=rubyStringDelimiter start="%[qw](" end=")" skip="\\\\\|\\)" fold contains=rubyNestedParentheses,rubyDelimiterEscape + syn region rubyString matchgroup=rubyStringDelimiter start="%q\z(\s\)" end="\z1" skip="\\\\\|\\\z1" fold + syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" fold + syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s{" end="}" skip="\\\\\|\\}" fold contains=rubyNestedCurlyBraces,rubyDelimiterEscape + syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s<" end=">" skip="\\\\\|\\>" fold contains=rubyNestedAngleBrackets,rubyDelimiterEscape + syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s\[" end="\]" skip="\\\\\|\\\]" fold contains=rubyNestedSquareBrackets,rubyDelimiterEscape + syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s(" end=")" skip="\\\\\|\\)" fold contains=rubyNestedParentheses,rubyDelimiterEscape + syn region rubyString matchgroup=rubyStringDelimiter start="%s\z(\s\)" end="\z1" skip="\\\\\|\\\z1" fold +else + syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" + syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]{" end="}" skip="\\\\\|\\}" contains=rubyNestedCurlyBraces,rubyDelimiterEscape + syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]<" end=">" skip="\\\\\|\\>" contains=rubyNestedAngleBrackets,rubyDelimiterEscape + syn region rubyString matchgroup=rubyStringDelimiter start="%[qw]\[" end="\]" skip="\\\\\|\\\]" contains=rubyNestedSquareBrackets,rubyDelimiterEscape + syn region rubyString matchgroup=rubyStringDelimiter start="%[qw](" end=")" skip="\\\\\|\\)" contains=rubyNestedParentheses,rubyDelimiterEscape + syn region rubyString matchgroup=rubyStringDelimiter start="%q\z(\s\)" end="\z1" skip="\\\\\|\\\z1" + syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" + syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s{" end="}" skip="\\\\\|\\}" contains=rubyNestedCurlyBraces,rubyDelimiterEscape + syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s<" end=">" skip="\\\\\|\\>" contains=rubyNestedAngleBrackets,rubyDelimiterEscape + syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s\[" end="\]" skip="\\\\\|\\\]" contains=rubyNestedSquareBrackets,rubyDelimiterEscape + syn region rubySymbol matchgroup=rubySymbolDelimiter start="%s(" end=")" skip="\\\\\|\\)" contains=rubyNestedParentheses,rubyDelimiterEscape + syn region rubyString matchgroup=rubyStringDelimiter start="%s\z(\s\)" end="\z1" skip="\\\\\|\\\z1" +endif + +" Generalized Double Quoted String and Array of Strings and Shell Command Output {{{1 " Note: %= is not matched here as the beginning of a double quoted string -syn region rubyString matchgroup=rubyStringDelimiter start="%\z([~`!@#$%^&*_\-+|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial fold -syn region rubyString matchgroup=rubyStringDelimiter start="%[QWIx]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial fold -syn region rubyString matchgroup=rubyStringDelimiter start="%[QWIx]\={" end="}" skip="\\\\\|\\}" contains=@rubyStringSpecial,rubyNestedCurlyBraces,rubyDelimEscape fold -syn region rubyString matchgroup=rubyStringDelimiter start="%[QWIx]\=<" end=">" skip="\\\\\|\\>" contains=@rubyStringSpecial,rubyNestedAngleBrackets,rubyDelimEscape fold -syn region rubyString matchgroup=rubyStringDelimiter start="%[QWIx]\=\[" end="\]" skip="\\\\\|\\\]" contains=@rubyStringSpecial,rubyNestedSquareBrackets,rubyDelimEscape fold -syn region rubyString matchgroup=rubyStringDelimiter start="%[QWIx]\=(" end=")" skip="\\\\\|\\)" contains=@rubyStringSpecial,rubyNestedParentheses,rubyDelimEscape fold -syn region rubyString matchgroup=rubyStringDelimiter start="%[Qx] " end=" " skip="\\\\\|\\)" contains=@rubyStringSpecial fold +if s:foldable('%') + syn region rubyString matchgroup=rubyStringDelimiter start="%\z([~`!@#$%^&*_\-+|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial fold + syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial fold + syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\={" end="}" skip="\\\\\|\\}" contains=@rubyStringSpecial,rubyNestedCurlyBraces,rubyDelimiterEscape fold + syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=<" end=">" skip="\\\\\|\\>" contains=@rubyStringSpecial,rubyNestedAngleBrackets,rubyDelimiterEscape fold + syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=\[" end="\]" skip="\\\\\|\\\]" contains=@rubyStringSpecial,rubyNestedSquareBrackets,rubyDelimiterEscape fold + syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=(" end=")" skip="\\\\\|\\)" contains=@rubyStringSpecial,rubyNestedParentheses,rubyDelimiterEscape fold + syn region rubyString matchgroup=rubyStringDelimiter start="%[Qx]\z(\s\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial fold +else + syn region rubyString matchgroup=rubyStringDelimiter start="%\z([~`!@#$%^&*_\-+|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial + syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial + syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\={" end="}" skip="\\\\\|\\}" contains=@rubyStringSpecial,rubyNestedCurlyBraces,rubyDelimiterEscape + syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=<" end=">" skip="\\\\\|\\>" contains=@rubyStringSpecial,rubyNestedAngleBrackets,rubyDelimiterEscape + syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=\[" end="\]" skip="\\\\\|\\\]" contains=@rubyStringSpecial,rubyNestedSquareBrackets,rubyDelimiterEscape + syn region rubyString matchgroup=rubyStringDelimiter start="%[QWx]\=(" end=")" skip="\\\\\|\\)" contains=@rubyStringSpecial,rubyNestedParentheses,rubyDelimiterEscape + syn region rubyString matchgroup=rubyStringDelimiter start="%[Qx]\z(\s\)" end="\z1" skip="\\\\\|\\\z1" contains=@rubyStringSpecial +endif -" Here Document -syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@" skip="\\\\\|\\>" fold contains=rubyNestedAngleBrackets,rubyDelimiterEscape + syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i\[" end="\]" skip="\\\\\|\\\]" fold contains=rubyNestedSquareBrackets,rubyDelimiterEscape + syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i(" end=")" skip="\\\\\|\\)" fold contains=rubyNestedParentheses,rubyDelimiterEscape -syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]})"'.]\)\s\|\w\)\@" skip="\\\\\|\\>" contains=@rubyStringSpecial,rubyNestedAngleBrackets,rubyDelimiterEscape fold + syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I\[" end="\]" skip="\\\\\|\\\]" contains=@rubyStringSpecial,rubyNestedSquareBrackets,rubyDelimiterEscape fold + syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I(" end=")" skip="\\\\\|\\)" contains=@rubyStringSpecial,rubyNestedParentheses,rubyDelimiterEscape fold +else + " Array of Symbols + syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i\z([~`!@#$%^&*_\-+=|\:;"',.?/]\)" end="\z1" skip="\\\\\|\\\z1" + syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i{" end="}" skip="\\\\\|\\}" contains=rubyNestedCurlyBraces,rubyDelimiterEscape + syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i<" end=">" skip="\\\\\|\\>" contains=rubyNestedAngleBrackets,rubyDelimiterEscape + syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i\[" end="\]" skip="\\\\\|\\\]" contains=rubyNestedSquareBrackets,rubyDelimiterEscape + syn region rubySymbol matchgroup=rubySymbolDelimiter start="%i(" end=")" skip="\\\\\|\\)" contains=rubyNestedParentheses,rubyDelimiterEscape -syn region rubyString start=+\%(\%(class\|::\)\_s*\|\%([]}).]\)\s\|\w\)\@" skip="\\\\\|\\>" contains=@rubyStringSpecial,rubyNestedAngleBrackets,rubyDelimiterEscape + syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I\[" end="\]" skip="\\\\\|\\\]" contains=@rubyStringSpecial,rubyNestedSquareBrackets,rubyDelimiterEscape + syn region rubySymbol matchgroup=rubySymbolDelimiter start="%I(" end=")" skip="\\\\\|\\)" contains=@rubyStringSpecial,rubyNestedParentheses,rubyDelimiterEscape +endif +" Here Document {{{1 +syn region rubyHeredocStart matchgroup=rubyStringDelimiter start=+\%(\%(class\s*\|\%([]})"'.]\|::\)\)\_s*\|\w\)\@>\|[<>]=\=\|<=>\|===\|[=!]=\|[=!]\~\|!\|`\)\%([[:space:];#(]\|$\)\@=" contained containedin=rubyAliasDeclaration,rubyAliasDeclaration2,rubyMethodDeclaration +syn match rubyFunction "\%(\s\|^\)\@1<=[_[:alpha:]][_[:alnum:]]*[?!=]\=\%(\s\|$\)\@=" contained containedin=rubyAliasDeclaration,rubyAliasDeclaration2 +syn match rubyFunction "\%([[:space:].]\|^\)\@2<=\%(\[\]=\=\|\*\*\|[-+!~]@\=\|[*/%|&^~]\|<<\|>>\|[<>]=\=\|<=>\|===\|[=!]=\|[=!]\~\|!\|`\)\%([[:space:];#(]\|$\)\@=" contained containedin=rubyAliasDeclaration,rubyAliasDeclaration2,rubyMethodDeclaration syn cluster rubyDeclaration contains=rubyAliasDeclaration,rubyAliasDeclaration2,rubyMethodDeclaration,rubyModuleDeclaration,rubyClassDeclaration,rubyFunction,rubyBlockParameter -" Keywords +" Keywords {{{1 " Note: the following keywords have already been defined: " begin case class def do end for if module unless until while syn match rubyControl "\<\%(and\|break\|in\|next\|not\|or\|redo\|rescue\|retry\|return\)\>[?!]\@!" syn match rubyOperator "\[?!]\@!" syn match rubyBoolean "\<\%(true\|false\)\>[?!]\@!" -syn match rubyPseudoVariable "\<\%(nil\|self\|__ENCODING__\|__FILE__\|__LINE__\|__callee__\|__method__\)\>[?!]\@!" " TODO: reorganise +syn match rubyPseudoVariable "\<\%(nil\|self\|__ENCODING__\|__dir__\|__FILE__\|__LINE__\|__callee__\|__method__\)\>[?!]\@!" " TODO: reorganise syn match rubyBeginEnd "\<\%(BEGIN\|END\)\>[?!]\@!" -" Expensive Mode - match 'end' with the appropriate opening keyword for syntax -" based folding and special highlighting of module/class/method definitions +" Expensive Mode {{{1 +" Match 'end' with the appropriate opening keyword for syntax based folding +" and special highlighting of module/class/method definitions if !exists("b:ruby_no_expensive") && !exists("ruby_no_expensive") syn match rubyDefine "\" nextgroup=rubyAliasDeclaration skipwhite skipnl syn match rubyDefine "\" nextgroup=rubyMethodDeclaration skipwhite skipnl @@ -211,23 +339,66 @@ if !exists("b:ruby_no_expensive") && !exists("ruby_no_expensive") syn match rubyClass "\" nextgroup=rubyClassDeclaration skipwhite skipnl syn match rubyModule "\" nextgroup=rubyModuleDeclaration skipwhite skipnl - syn region rubyMethodBlock start="\" matchgroup=rubyDefine end="\%(\" contains=ALLBUT,@rubyNotTop fold - syn region rubyBlock start="\" matchgroup=rubyClass end="\" contains=ALLBUT,@rubyNotTop fold - syn region rubyBlock start="\" matchgroup=rubyModule end="\" contains=ALLBUT,@rubyNotTop fold + if s:foldable('def') + syn region rubyMethodBlock start="\" matchgroup=rubyDefine end="\%(\" contains=ALLBUT,@rubyNotTop fold + else + syn region rubyMethodBlock start="\" matchgroup=rubyDefine end="\%(\" contains=ALLBUT,@rubyNotTop + endif + + if s:foldable('class') + syn region rubyBlock start="\" matchgroup=rubyClass end="\" contains=ALLBUT,@rubyNotTop fold + else + syn region rubyBlock start="\" matchgroup=rubyClass end="\" contains=ALLBUT,@rubyNotTop + endif + + if s:foldable('module') + syn region rubyBlock start="\" matchgroup=rubyModule end="\" contains=ALLBUT,@rubyNotTop fold + else + syn region rubyBlock start="\" matchgroup=rubyModule end="\" contains=ALLBUT,@rubyNotTop + endif " modifiers - syn match rubyConditionalModifier "\<\%(if\|unless\)\>" display - syn match rubyRepeatModifier "\<\%(while\|until\)\>" display + syn match rubyLineContinuation "\\$" nextgroup=rubyConditionalModifier,rubyRepeatModifier skipwhite skipnl + syn match rubyConditionalModifier "\<\%(if\|unless\)\>" + syn match rubyRepeatModifier "\<\%(while\|until\)\>" + + if s:foldable('do') + syn region rubyDoBlock matchgroup=rubyControl start="\" end="\" contains=ALLBUT,@rubyNotTop fold + else + syn region rubyDoBlock matchgroup=rubyControl start="\" end="\" contains=ALLBUT,@rubyNotTop + endif - syn region rubyDoBlock matchgroup=rubyControl start="\" end="\" contains=ALLBUT,@rubyNotTop fold " curly bracket block or hash literal - syn region rubyCurlyBlock matchgroup=rubyCurlyBlockDelimiter start="{" end="}" contains=ALLBUT,@rubyNotTop fold - syn region rubyArrayLiteral matchgroup=rubyArrayDelimiter start="\%(\w\|[\]})]\)\@" end="\" contains=ALLBUT,@rubyNotTop fold - syn region rubyCaseExpression matchgroup=rubyConditional start="\" end="\" contains=ALLBUT,@rubyNotTop fold - syn region rubyConditionalExpression matchgroup=rubyConditional start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+=-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@" end="\%(\%(\%(\.\@" contains=ALLBUT,@rubyNotTop fold + if s:foldable('begin') + syn region rubyBlockExpression matchgroup=rubyControl start="\" end="\" contains=ALLBUT,@rubyNotTop fold + else + syn region rubyBlockExpression matchgroup=rubyControl start="\" end="\" contains=ALLBUT,@rubyNotTop + endif + + if s:foldable('case') + syn region rubyCaseExpression matchgroup=rubyConditional start="\" end="\" contains=ALLBUT,@rubyNotTop fold + else + syn region rubyCaseExpression matchgroup=rubyConditional start="\" end="\" contains=ALLBUT,@rubyNotTop + endif + + if s:foldable('if') + syn region rubyConditionalExpression matchgroup=rubyConditional start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*%&^|+=-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@" end="\%(\%(\%(\.\@1" contains=ALLBUT,@rubyNotTop fold + else + syn region rubyConditionalExpression matchgroup=rubyConditional start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*%&^|+=-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@" end="\%(\%(\%(\.\@1" contains=ALLBUT,@rubyNotTop + endif syn match rubyConditional "\<\%(then\|else\|when\)\>[?!]\@!" contained containedin=rubyCaseExpression syn match rubyConditional "\<\%(then\|else\|elsif\)\>[?!]\@!" contained containedin=rubyConditionalExpression @@ -237,7 +408,12 @@ if !exists("b:ruby_no_expensive") && !exists("ruby_no_expensive") " statements with optional 'do' syn region rubyOptionalDoLine matchgroup=rubyRepeat start="\[?!]\@!" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@" matchgroup=rubyOptionalDo end="\%(\\)" end="\ze\%(;\|$\)" oneline contains=ALLBUT,@rubyNotTop - syn region rubyRepeatExpression start="\[?!]\@!" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@" matchgroup=rubyRepeat end="\" contains=ALLBUT,@rubyNotTop nextgroup=rubyOptionalDoLine fold + + if s:foldable('for') + syn region rubyRepeatExpression start="\[?!]\@!" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@" matchgroup=rubyRepeat end="\" contains=ALLBUT,@rubyNotTop nextgroup=rubyOptionalDoLine fold + else + syn region rubyRepeatExpression start="\[?!]\@!" start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@" matchgroup=rubyRepeat end="\" contains=ALLBUT,@rubyNotTop nextgroup=rubyOptionalDoLine + endif if !exists("ruby_minlines") let ruby_minlines = 500 @@ -252,7 +428,7 @@ else syn match rubyKeyword "\<\%(alias\|undef\)\>[?!]\@!" endif -" Special Methods +" Special Methods {{{1 if !exists("ruby_no_special_methods") syn keyword rubyAccess public protected private public_class_method private_class_method public_constant private_constant module_function " attr is a common variable name @@ -263,40 +439,40 @@ if !exists("ruby_no_special_methods") syn keyword rubyException raise fail catch throw " false positive with 'include?' syn match rubyInclude "\[?!]\@!" - syn keyword rubyInclude autoload extend load prepend require require_relative + syn keyword rubyInclude autoload extend load prepend refine require require_relative using syn keyword rubyKeyword callcc caller lambda proc endif -" Comments and Documentation +" Comments and Documentation {{{1 syn match rubySharpBang "\%^#!.*" display -syn keyword rubyTodo FIXME NOTE TODO OPTIMIZE XXX todo contained +syn keyword rubyTodo FIXME NOTE TODO OPTIMIZE HACK REVIEW XXX todo contained syn match rubyComment "#.*" contains=rubySharpBang,rubySpaceError,rubyTodo,@Spell -if !exists("ruby_no_comment_fold") - syn region rubyMultilineComment start="\%(\%(^\s*#.*\n\)\@" transparent contains=NONE -syn match rubyKeywordAsMethod "\%(\%(\.\@" transparent contains=NONE -syn match rubyKeywordAsMethod "\%(\%(\.\@" transparent contains=NONE -syn match rubyKeywordAsMethod "\%(\%(\.\@" transparent contains=NONE +syn match rubyKeywordAsMethod "\%(\%(\.\@1\)" transparent contains=NONE +syn match rubyKeywordAsMethod "\(defined?\|exit!\)\@!\<[_[:lower:]][_[:alnum:]]*[?!]" transparent contains=NONE -syn match rubyKeywordAsMethod "\<\%(alias\|begin\|case\|class\|def\|do\|end\)[?!]" transparent contains=NONE -syn match rubyKeywordAsMethod "\<\%(if\|module\|undef\|unless\|until\|while\)[?!]" transparent contains=NONE +" More Symbols {{{1 +syn match rubySymbol "\%([{(,]\_s*\)\zs\l\w*[!?]\=::\@!"he=e-1 +syn match rubySymbol "[]})\"':]\@1" transparent contains=NONE -syn match rubyKeywordAsMethod "\%(\%(\.\@" transparent contains=NONE -syn match rubyKeywordAsMethod "\%(\%(\.\@" transparent contains=NONE -syn match rubyKeywordAsMethod "\%(\%(\.\@" transparent contains=NONE -syn match rubyKeywordAsMethod "\%(\%(\.\@" transparent contains=NONE -syn match rubyKeywordAsMethod "\%(\%(\.\@" transparent contains=NONE - -" __END__ Directive -syn region rubyData matchgroup=rubyDataDirective start="^__END__$" end="\%$" fold +" __END__ Directive {{{1 +if s:foldable('__END__') + syn region rubyData matchgroup=rubyDataDirective start="^__END__$" end="\%$" fold +else + syn region rubyData matchgroup=rubyDataDirective start="^__END__$" end="\%$" +endif +" Default Highlighting {{{1 hi def link rubyClass rubyDefine hi def link rubyModule rubyDefine hi def link rubyMethodExceptional rubyDefine @@ -336,6 +512,7 @@ hi def link rubyAccess Statement hi def link rubyAttribute Statement hi def link rubyEval Statement hi def link rubyPseudoVariable Constant +hi def link rubyCapitalizedMethod rubyLocalVariableOrMethod hi def link rubyComment Comment hi def link rubyData Comment @@ -349,7 +526,7 @@ hi def link rubyInterpolationDelimiter Delimiter hi def link rubyNoInterpolation rubyString hi def link rubySharpBang PreProc hi def link rubyRegexpDelimiter rubyStringDelimiter -hi def link rubySymbolDelimiter rubyStringDelimiter +hi def link rubySymbolDelimiter rubySymbol hi def link rubyStringDelimiter Delimiter hi def link rubyHeredoc rubyString hi def link rubyString String @@ -366,6 +543,10 @@ hi def link rubyInvalidVariable Error hi def link rubyError Error hi def link rubySpaceError rubyError +" Postscript {{{1 let b:current_syntax = "ruby" -" vim: nowrap sw=2 sts=2 ts=8 noet: +let &cpo = s:cpo_sav +unlet! s:cpo_sav + +" vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker: diff --git a/runtime/syntax/rust.vim b/runtime/syntax/rust.vim new file mode 100644 index 0000000000..57343301e0 --- /dev/null +++ b/runtime/syntax/rust.vim @@ -0,0 +1,295 @@ +" Vim syntax file +" Language: Rust +" Maintainer: Patrick Walton +" Maintainer: Ben Blum +" Maintainer: Chris Morgan +" Last Change: Feb 24, 2016 +" For bugs, patches and license go to https://github.com/rust-lang/rust.vim + +if version < 600 + syntax clear +elseif exists("b:current_syntax") + finish +endif + +" Syntax definitions {{{1 +" Basic keywords {{{2 +syn keyword rustConditional match if else +syn keyword rustRepeat for loop while +syn keyword rustTypedef type nextgroup=rustIdentifier skipwhite skipempty +syn keyword rustStructure struct enum nextgroup=rustIdentifier skipwhite skipempty +syn keyword rustUnion union nextgroup=rustIdentifier skipwhite skipempty contained +syn match rustUnionContextual /\/ + +syn keyword rustInvalidBareKeyword crate + +syn keyword rustPubScopeCrate crate contained +syn match rustPubScopeDelim /[()]/ contained +syn match rustPubScope /([^()]*)/ contained contains=rustPubScopeDelim,rustPubScopeCrate,rustSuper,rustModPath,rustModPathSep,rustSelf transparent + +syn keyword rustExternCrate crate contained nextgroup=rustIdentifier,rustExternCrateString skipwhite skipempty +" This is to get the `bar` part of `extern crate "foo" as bar;` highlighting. +syn match rustExternCrateString /".*"\_s*as/ contained nextgroup=rustIdentifier skipwhite transparent skipempty contains=rustString,rustOperator +syn keyword rustObsoleteExternMod mod contained nextgroup=rustIdentifier skipwhite skipempty + +syn match rustIdentifier contains=rustIdentifierPrime "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained +syn match rustFuncName "\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" display contained + +syn region rustBoxPlacement matchgroup=rustBoxPlacementParens start="(" end=")" contains=TOP contained +" Ideally we'd have syntax rules set up to match arbitrary expressions. Since +" we don't, we'll just define temporary contained rules to handle balancing +" delimiters. +syn region rustBoxPlacementBalance start="(" end=")" containedin=rustBoxPlacement transparent +syn region rustBoxPlacementBalance start="\[" end="\]" containedin=rustBoxPlacement transparent +" {} are handled by rustFoldBraces + +syn region rustMacroRepeat matchgroup=rustMacroRepeatDelimiters start="$(" end=")" contains=TOP nextgroup=rustMacroRepeatCount +syn match rustMacroRepeatCount ".\?[*+]" contained +syn match rustMacroVariable "$\w\+" + +" Reserved (but not yet used) keywords {{{2 +syn keyword rustReservedKeyword alignof become do offsetof priv pure sizeof typeof unsized yield abstract virtual final override macro + +" Built-in types {{{2 +syn keyword rustType isize usize char bool u8 u16 u32 u64 u128 f32 +syn keyword rustType f64 i8 i16 i32 i64 i128 str Self + +" Things from the libstd v1 prelude (src/libstd/prelude/v1.rs) {{{2 +" This section is just straight transformation of the contents of the prelude, +" to make it easy to update. + +" Reexported core operators {{{3 +syn keyword rustTrait Copy Send Sized Sync +syn keyword rustTrait Drop Fn FnMut FnOnce + +" Reexported functions {{{3 +" There’s no point in highlighting these; when one writes drop( or drop::< it +" gets the same highlighting anyway, and if someone writes `let drop = …;` we +" don’t really want *that* drop to be highlighted. +"syn keyword rustFunction drop + +" Reexported types and traits {{{3 +syn keyword rustTrait Box +syn keyword rustTrait ToOwned +syn keyword rustTrait Clone +syn keyword rustTrait PartialEq PartialOrd Eq Ord +syn keyword rustTrait AsRef AsMut Into From +syn keyword rustTrait Default +syn keyword rustTrait Iterator Extend IntoIterator +syn keyword rustTrait DoubleEndedIterator ExactSizeIterator +syn keyword rustEnum Option +syn keyword rustEnumVariant Some None +syn keyword rustEnum Result +syn keyword rustEnumVariant Ok Err +syn keyword rustTrait SliceConcatExt +syn keyword rustTrait String ToString +syn keyword rustTrait Vec + +" Other syntax {{{2 +syn keyword rustSelf self +syn keyword rustBoolean true false + +" If foo::bar changes to foo.bar, change this ("::" to "\."). +" If foo::bar changes to Foo::bar, change this (first "\w" to "\u"). +syn match rustModPath "\w\(\w\)*::[^<]"he=e-3,me=e-3 +syn match rustModPathSep "::" + +syn match rustFuncCall "\w\(\w\)*("he=e-1,me=e-1 +syn match rustFuncCall "\w\(\w\)*::<"he=e-3,me=e-3 " foo::(); + +" This is merely a convention; note also the use of [A-Z], restricting it to +" latin identifiers rather than the full Unicode uppercase. I have not used +" [:upper:] as it depends upon 'noignorecase' +"syn match rustCapsIdent display "[A-Z]\w\(\w\)*" + +syn match rustOperator display "\%(+\|-\|/\|*\|=\|\^\|&\||\|!\|>\|<\|%\)=\?" +" This one isn't *quite* right, as we could have binary-& with a reference +syn match rustSigil display /&\s\+[&~@*][^)= \t\r\n]/he=e-1,me=e-1 +syn match rustSigil display /[&~@*][^)= \t\r\n]/he=e-1,me=e-1 +" This isn't actually correct; a closure with no arguments can be `|| { }`. +" Last, because the & in && isn't a sigil +syn match rustOperator display "&&\|||" +" This is rustArrowCharacter rather than rustArrow for the sake of matchparen, +" so it skips the ->; see http://stackoverflow.com/a/30309949 for details. +syn match rustArrowCharacter display "->" +syn match rustQuestionMark display "?\([a-zA-Z]\+\)\@!" + +syn match rustMacro '\w\(\w\)*!' contains=rustAssert,rustPanic +syn match rustMacro '#\w\(\w\)*' contains=rustAssert,rustPanic + +syn match rustEscapeError display contained /\\./ +syn match rustEscape display contained /\\\([nrt0\\'"]\|x\x\{2}\)/ +syn match rustEscapeUnicode display contained /\\u{\x\{1,6}}/ +syn match rustStringContinuation display contained /\\\n\s*/ +syn region rustString start=+b"+ skip=+\\\\\|\\"+ end=+"+ contains=rustEscape,rustEscapeError,rustStringContinuation +syn region rustString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=rustEscape,rustEscapeUnicode,rustEscapeError,rustStringContinuation,@Spell +syn region rustString start='b\?r\z(#*\)"' end='"\z1' contains=@Spell + +syn region rustAttribute start="#!\?\[" end="\]" contains=rustString,rustDerive,rustCommentLine,rustCommentBlock,rustCommentLineDocError,rustCommentBlockDocError +syn region rustDerive start="derive(" end=")" contained contains=rustDeriveTrait +" This list comes from src/libsyntax/ext/deriving/mod.rs +" Some are deprecated (Encodable, Decodable) or to be removed after a new snapshot (Show). +syn keyword rustDeriveTrait contained Clone Hash RustcEncodable RustcDecodable Encodable Decodable PartialEq Eq PartialOrd Ord Rand Show Debug Default FromPrimitive Send Sync Copy + +" Number literals +syn match rustDecNumber display "\<[0-9][0-9_]*\%([iu]\%(size\|8\|16\|32\|64\|128\)\)\=" +syn match rustHexNumber display "\<0x[a-fA-F0-9_]\+\%([iu]\%(size\|8\|16\|32\|64\|128\)\)\=" +syn match rustOctNumber display "\<0o[0-7_]\+\%([iu]\%(size\|8\|16\|32\|64\|128\)\)\=" +syn match rustBinNumber display "\<0b[01_]\+\%([iu]\%(size\|8\|16\|32\|64\|128\)\)\=" + +" Special case for numbers of the form "1." which are float literals, unless followed by +" an identifier, which makes them integer literals with a method call or field access, +" or by another ".", which makes them integer literals followed by the ".." token. +" (This must go first so the others take precedence.) +syn match rustFloat display "\<[0-9][0-9_]*\.\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\|\.\)\@!" +" To mark a number as a normal float, it must have at least one of the three things integral values don't have: +" a decimal point and more numbers; an exponent; and a type suffix. +syn match rustFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\%([eE][+-]\=[0-9_]\+\)\=\(f32\|f64\)\=" +syn match rustFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\=\%([eE][+-]\=[0-9_]\+\)\(f32\|f64\)\=" +syn match rustFloat display "\<[0-9][0-9_]*\%(\.[0-9][0-9_]*\)\=\%([eE][+-]\=[0-9_]\+\)\=\(f32\|f64\)" + +" For the benefit of delimitMate +syn region rustLifetimeCandidate display start=/&'\%(\([^'\\]\|\\\(['nrt0\\\"]\|x\x\{2}\|u{\x\{1,6}}\)\)'\)\@!/ end=/[[:cntrl:][:space:][:punct:]]\@=\|$/ contains=rustSigil,rustLifetime +syn region rustGenericRegion display start=/<\%('\|[^[cntrl:][:space:][:punct:]]\)\@=')\S\@=/ end=/>/ contains=rustGenericLifetimeCandidate +syn region rustGenericLifetimeCandidate display start=/\%(<\|,\s*\)\@<='/ end=/[[:cntrl:][:space:][:punct:]]\@=\|$/ contains=rustSigil,rustLifetime + +"rustLifetime must appear before rustCharacter, or chars will get the lifetime highlighting +syn match rustLifetime display "\'\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*" +syn match rustLabel display "\'\%([^[:cntrl:][:space:][:punct:][:digit:]]\|_\)\%([^[:cntrl:][:punct:][:space:]]\|_\)*:" +syn match rustCharacterInvalid display contained /b\?'\zs[\n\r\t']\ze'/ +" The groups negated here add up to 0-255 but nothing else (they do not seem to go beyond ASCII). +syn match rustCharacterInvalidUnicode display contained /b'\zs[^[:cntrl:][:graph:][:alnum:][:space:]]\ze'/ +syn match rustCharacter /b'\([^\\]\|\\\(.\|x\x\{2}\)\)'/ contains=rustEscape,rustEscapeError,rustCharacterInvalid,rustCharacterInvalidUnicode +syn match rustCharacter /'\([^\\]\|\\\(.\|x\x\{2}\|u{\x\{1,6}}\)\)'/ contains=rustEscape,rustEscapeUnicode,rustEscapeError,rustCharacterInvalid + +syn match rustShebang /\%^#![^[].*/ +syn region rustCommentLine start="//" end="$" contains=rustTodo,@Spell +syn region rustCommentLineDoc start="//\%(//\@!\|!\)" end="$" contains=rustTodo,@Spell +syn region rustCommentLineDocError start="//\%(//\@!\|!\)" end="$" contains=rustTodo,@Spell contained +syn region rustCommentBlock matchgroup=rustCommentBlock start="/\*\%(!\|\*[*/]\@!\)\@!" end="\*/" contains=rustTodo,rustCommentBlockNest,@Spell +syn region rustCommentBlockDoc matchgroup=rustCommentBlockDoc start="/\*\%(!\|\*[*/]\@!\)" end="\*/" contains=rustTodo,rustCommentBlockDocNest,@Spell +syn region rustCommentBlockDocError matchgroup=rustCommentBlockDocError start="/\*\%(!\|\*[*/]\@!\)" end="\*/" contains=rustTodo,rustCommentBlockDocNestError,@Spell contained +syn region rustCommentBlockNest matchgroup=rustCommentBlock start="/\*" end="\*/" contains=rustTodo,rustCommentBlockNest,@Spell contained transparent +syn region rustCommentBlockDocNest matchgroup=rustCommentBlockDoc start="/\*" end="\*/" contains=rustTodo,rustCommentBlockDocNest,@Spell contained transparent +syn region rustCommentBlockDocNestError matchgroup=rustCommentBlockDocError start="/\*" end="\*/" contains=rustTodo,rustCommentBlockDocNestError,@Spell contained transparent +" FIXME: this is a really ugly and not fully correct implementation. Most +" importantly, a case like ``/* */*`` should have the final ``*`` not being in +" a comment, but in practice at present it leaves comments open two levels +" deep. But as long as you stay away from that particular case, I *believe* +" the highlighting is correct. Due to the way Vim's syntax engine works +" (greedy for start matches, unlike Rust's tokeniser which is searching for +" the earliest-starting match, start or end), I believe this cannot be solved. +" Oh you who would fix it, don't bother with things like duplicating the Block +" rules and putting ``\*\@= 508 || !exists("did_samba_syn_inits") - if version < 508 - let did_samba_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - HiLink sambaParameter Normal - HiLink sambaKeyword Type - HiLink sambaSection Statement - HiLink sambaMacro PreProc - HiLink sambaComment Comment - HiLink sambaContinue Operator - HiLink sambaBoolean Constant - delcommand HiLink -endif +" Only when an item doesn't have highlighting yet +hi def link sambaParameter Normal +hi def link sambaKeyword Type +hi def link sambaSection Statement +hi def link sambaMacro PreProc +hi def link sambaComment Comment +hi def link sambaContinue Operator +hi def link sambaBoolean Constant let b:current_syntax = "samba" diff --git a/runtime/syntax/sas.vim b/runtime/syntax/sas.vim index dc70e1fd90..fad6066737 100644 --- a/runtime/syntax/sas.vim +++ b/runtime/syntax/sas.vim @@ -1,279 +1,259 @@ " Vim syntax file -" Language: SAS -" Maintainer: James Kidd -" Last Change: 2012 Apr 20 -" Corrected bug causing some keywords to appear as strings instead -" 18 Jul 2008 by Paulo Tanimoto -" Fixed comments with * taking multiple lines. -" Fixed highlighting of macro keywords. -" Added words to cases that didn't fit anywhere. -" 02 Jun 2003 -" Added highlighting for additional keywords and such; -" Attempted to match SAS default syntax colors; -" Changed syncing so it doesn't lose colors on large blocks; -" Much thanks to Bob Heckel for knowledgeable tweaking. -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded +" Language: SAS +" Maintainer: Zhen-Huan Hu +" Original Maintainer: James Kidd +" Version: 3.0.0 +" Last Change: Aug 26, 2017 +" +" 2017 Mar 7 +" +" Upgrade version number to 3.0. Improvements include: +" - Improve sync speed +" - Largely enhance precision +" - Update keywords in the latest SAS (as of Mar 2017) +" - Add syntaxes for date/time constants +" - Add syntax for data lines +" - Add (back) syntax for TODO in comments +" +" 2017 Feb 9 +" +" Add syntax folding +" +" 2016 Oct 10 +" +" Add highlighting for functions +" +" 2016 Sep 14 +" +" Change the implementation of syntaxing +" macro function names so that macro parameters same +" as SAS keywords won't be highlighted +" (Thank Joug Raw for the suggestion) +" Add section highlighting: +" - Use /** and **/ to define a section +" - It functions the same as a comment but +" with different highlighting +" +" 2016 Jun 14 +" +" Major changes so upgrade version number to 2.0 +" Overhaul the entire script (again). Improvements include: +" - Higher precision +" - Faster synchronization +" - Separate color for control statements +" - Highlight hash and java objects +" - Highlight macro variables in double quoted strings +" - Update all syntaxes based on SAS 9.4 +" - Add complete SAS/GRAPH and SAS/STAT procedure syntaxes +" - Add Proc TEMPLATE and GTL syntaxes +" - Add complete DS2 syntaxes +" - Add basic IML syntaxes +" - Many other improvements and bug fixes +" Drop support for VIM version < 600 + if version < 600 - syntax clear -elseif exists("b:current_syntax") - finish + syntax clear +elseif exists('b:current_syntax') + finish endif +let s:cpo_save = &cpo +set cpo&vim + syn case ignore -syn region sasString start=+"+ skip=+\\\\\|\\"+ end=+"+ -syn region sasString start=+'+ skip=+\\\\\|\\"+ end=+'+ +" Basic SAS syntaxes +syn keyword sasOperator and eq ge gt in le lt ne not of or +syn keyword sasReserved _all_ _automatic_ _char_ _character_ _data_ _infile_ _last_ _n_ _name_ _null_ _num_ _numeric_ _temporary_ _user_ _webout_ +" Strings +syn region sasString start=+'+ skip=+''+ end=+'+ contains=@Spell +syn region sasString start=+"+ skip=+""+ end=+"+ contains=sasMacroVariable,@Spell +" Constants +syn match sasNumber /\v<\d+%(\.\d+)=%(>|e[\-+]=\d+>)/ display +syn match sasDateTime /\v(['"])\d{2}%(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d{2}%(\d{2})=:\d{2}:\d{2}%(:\d{2})=%(am|pm)\1dt>/ display +syn match sasDateTime /\v(['"])\d{2}%(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d{2}%(\d{2})=\1d>/ display +syn match sasDateTime /\v(['"])\d{2}:\d{2}%(:\d{2})=%(am|pm)\1t>/ display +" Comments +syn keyword sasTodo todo tbd fixme contained +syn region sasComment start='/\*' end='\*/' contains=sasTodo +syn region sasComment start='\v%(^|;)\s*\zs\%=\*' end=';'me=s-1 contains=sasTodo +syn region sasSectLbl matchgroup=sasSectLblEnds start='/\*\*\s*' end='\s*\*\*/' concealends +" Macros +syn match sasMacroVariable '\v\&+\w+%(\.\w+)=' display +syn match sasMacroReserved '\v\%%(abort|by|copy|display|do|else|end|global|goto|if|include|input|let|list|local|macro|mend|put|return|run|symdel|syscall|sysexec|syslput|sysrput|then|to|until|window|while)>' display +syn region sasMacroFunction matchgroup=sasMacroFunctionName start='\v\%\w+\ze\(' end=')'he=s-1 contains=@sasBasicSyntax,sasMacroFunction +syn region sasMacroFunction matchgroup=sasMacroFunctionName start='\v\%q=sysfunc\ze\(' end=')'he=s-1 contains=@sasBasicSyntax,sasMacroFunction,sasDataStepFunction +" Syntax cluster for basic SAS syntaxes +syn cluster sasBasicSyntax contains=sasOperator,sasReserved,sasNumber,sasDateTime,sasString,sasComment,sasMacroReserved,sasMacroFunction,sasMacroVariable,sasSectLbl -" Want region from 'cards;' to ';' to be captured (Bob Heckel) -syn region sasCards start="^\s*CARDS.*" end="^\s*;\s*$" -syn region sasCards start="^\s*DATALINES.*" end="^\s*;\s*$" +" Formats +syn match sasFormat '\v\$\w+\.' display contained +syn match sasFormat '\v<\w+\.%(\d+>)=' display contained +syn region sasFormatContext start='.' end=';'me=s-1 contained contains=@sasBasicSyntax,sasFormat -syn match sasNumber "-\=\<\d*\.\=[0-9_]\>" +" Define global statements that can be accessed out of data step or procedures +syn keyword sasGlobalStatementKeyword catname dm endsas filename footnote footnote1 footnote2 footnote3 footnote4 footnote5 footnote6 footnote7 footnote8 footnote9 footnote10 missing libname lock ods options page quit resetline run sasfile skip sysecho title title1 title2 title3 title4 title5 title6 title7 title8 title9 title10 contained +syn keyword sasGlobalStatementODSKeyword chtml csvall docbook document escapechar epub epub2 epub3 exclude excel graphics html html3 html5 htmlcss imode listing markup output package path pcl pdf preferences phtml powerpoint printer proclabel proctitle ps results rtf select show tagsets trace usegopt verify wml contained +syn match sasGlobalStatement '\v%(^|;)\s*\zs\h\w*>' display transparent contains=sasGlobalStatementKeyword +syn match sasGlobalStatement '\v%(^|;)\s*\zsods>' display transparent contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty -" Block comment -syn region sasComment start="/\*" end="\*/" contains=sasTodo +" Data step statements, 9.4 +syn keyword sasDataStepFunctionName abs addr addrlong airy allcomb allperm anyalnum anyalpha anycntrl anydigit anyfirst anygraph anylower anyname anyprint anypunct anyspace anyupper anyxdigit arcos arcosh arsin arsinh artanh atan atan2 attrc attrn band beta betainv blackclprc blackptprc blkshclprc blkshptprc blshift bnot bor brshift bxor byte cat catq cats catt catx cdf ceil ceilz cexist char choosec choosen cinv close cmiss cnonct coalesce coalescec collate comb compare compbl compfuzz compged complev compound compress constant convx convxp cos cosh cot count countc countw csc css cumipmt cumprinc curobs cv daccdb daccdbsl daccsl daccsyd dacctab dairy datdif date datejul datepart datetime day dclose dcreate depdb depdbsl depsl depsyd deptab dequote deviance dhms dif digamma dim dinfo divide dnum dopen doptname doptnum dosubl dread dropnote dsname dsncatlgd dur durp effrate envlen erf erfc euclid exist exp fact fappend fclose fcol fcopy fdelete fetch fetchobs fexist fget fileexist filename fileref finance find findc findw finfo finv fipname fipnamel fipstate first floor floorz fmtinfo fnonct fnote fopen foptname foptnum fpoint fpos fput fread frewind frlen fsep fuzz fwrite gaminv gamma garkhclprc garkhptprc gcd geodist geomean geomeanz getoption getvarc getvarn graycode harmean harmeanz hbound hms holiday holidayck holidaycount holidayname holidaynx holidayny holidaytest hour htmldecode htmlencode ibessel ifc ifn index indexc indexw input inputc inputn int intcindex intck intcycle intfit intfmt intget intindex intnx intrr intseas intshift inttest intz iorcmsg ipmt iqr irr jbessel juldate juldate7 kurtosis lag largest lbound lcm lcomb left length lengthc lengthm lengthn lexcomb lexcombi lexperk lexperm lfact lgamma libname libref log log1px log10 log2 logbeta logcdf logistic logpdf logsdf lowcase lperm lpnorm mad margrclprc margrptprc max md5 mdy mean median min minute missing mod modexist module modulec modulen modz month mopen mort msplint mvalid contained +syn keyword sasDataStepFunctionName n netpv nliteral nmiss nomrate normal notalnum notalpha notcntrl notdigit note notfirst notgraph notlower notname notprint notpunct notspace notupper notxdigit npv nvalid nwkdom open ordinal pathname pctl pdf peek peekc peekclong peeklong perm pmt point poisson ppmt probbeta probbnml probbnrm probchi probf probgam probhypr probit probmc probnegb probnorm probt propcase prxchange prxmatch prxparen prxparse prxposn ptrlongadd put putc putn pvp qtr quantile quote ranbin rancau rand ranexp rangam range rank rannor ranpoi rantbl rantri ranuni rename repeat resolve reverse rewind right rms round rounde roundz saving savings scan sdf sec second sha256 sha256hex sha256hmachex sign sin sinh skewness sleep smallest soapweb soapwebmeta soapwipservice soapwipsrs soapws soapwsmeta soundex spedis sqrt squantile std stderr stfips stname stnamel strip subpad substr substrn sum sumabs symexist symget symglobl symlocal sysexist sysget sysmsg sysparm sysprocessid sysprocessname sysprod sysrc system tan tanh time timepart timevalue tinv tnonct today translate transtrn tranwrd trigamma trim trimn trunc tso typeof tzoneid tzonename tzoneoff tzones2u tzoneu2s uniform upcase urldecode urlencode uss uuidgen var varfmt varinfmt varlabel varlen varname varnum varray varrayx vartype verify vformat vformatd vformatdx vformatn vformatnx vformatw vformatwx vformatx vinarray vinarrayx vinformat vinformatd vinformatdx vinformatn vinformatnx vinformatw vinformatwx vinformatx vlabel vlabelx vlength vlengthx vname vnamex vtype vtypex vvalue vvaluex week weekday whichc whichn wto year yieldp yrdif yyq zipcity zipcitydistance zipfips zipname zipnamel zipstate contained +syn keyword sasDataStepCallRoutineName allcomb allcombi allperm cats catt catx compcost execute graycode is8601_convert label lexcomb lexcombi lexperk lexperm logistic missing module poke pokelong prxchange prxdebug prxfree prxnext prxposn prxsubstr ranbin rancau rancomb ranexp rangam rannor ranperk ranperm ranpoi rantbl rantri ranuni scan set sleep softmax sortc sortn stdize streaminit symput symputx system tanh tso vname vnext wto contained +syn region sasDataStepFunctionContext start='(' end=')' contained contains=@sasBasicSyntax,sasDataStepFunction +syn region sasDataStepFunctionFormatContext start='(' end=')' contained contains=@sasBasicSyntax,sasDataStepFunction,sasFormat +syn match sasDataStepFunction '\v<\w+\ze\(' contained contains=sasDataStepFunctionName,sasDataStepCallRoutineName nextgroup=sasDataStepFunctionContext +syn match sasDataStepFunction '\v%(input|put)\ze\(' contained contains=sasDataStepFunctionName nextgroup=sasDataStepFunctionFormatContext +syn keyword sasDataStepHashMethodName add check clear definedata definedone definekey delete do_over equals find find_next find_prev first has_next has_prev last next output prev ref remove removedup replace replacedup reset_dup setcur sum sumdup contained +syn region sasDataStepHashMethodContext start='(' end=')' contained contains=@sasBasicSyntax,sasDataStepFunction +syn match sasDataStepHashMethod '\v\.\w+\ze\(' contained contains=sasDataStepHashMethodName nextgroup=sasDataStepHashMethodContext +syn keyword sasDataStepHashAttributeName item_size num_items contained +syn match sasDataStepHashAttribute '\v\.\w+>\ze\_[^(]' display contained contains=sasDataStepHashAttributeName +syn keyword sasDataStepControl continue do end go goto if leave link otherwise over return select to until when while contained +syn keyword sasDataStepControl else then contained nextgroup=sasDataStepStatementKeyword skipwhite skipnl skipempty +syn keyword sasDataStepHashOperator _new_ contained +syn keyword sasDataStepStatementKeyword abort array attrib by call cards cards4 datalines datalines4 dcl declare delete describe display drop error execute file format infile informat input keep label length lines lines4 list lostcard merge modify output put putlog redirect remove rename replace retain set stop update where window contained +syn keyword sasDataStepStatementHashKeyword hash hiter javaobj contained +syn match sasDataStepStatement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasDataStepStatementKeyword,sasGlobalStatementKeyword +syn match sasDataStepStatement '\v%(^|;)\s*\zs%(dcl|declare)>' display contained contains=sasDataStepStatementKeyword nextgroup=sasDataStepStatementHashKeyword skipwhite skipnl skipempty +syn match sasDataStepStatement '\v%(^|;)\s*\zsods>' display contained contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty +syn match sasDataStepStatement '\v%(^|;)\s*\zs%(format|informat|input|put)>' display contained contains=sasDataStepStatementKeyword nextgroup=sasFormatContext skipwhite skipnl skipempty +syn match sasDataStepStatement '\v%(^|;)\s*\zs%(cards|datalines|lines)4=\s*;' display contained contains=sasDataStepStatementKeyword nextgroup=sasDataLine skipwhite skipnl skipempty +syn region sasDataLine start='^' end='^\s*;'me=s-1 contained +syn region sasDataStep matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsdata>' end='\v%(^|;)\s*%(run|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,@sasDataStepSyntax +syn cluster sasDataStepSyntax contains=sasDataStepFunction,sasDataStepHashOperator,sasDataStepHashAttribute,sasDataStepHashMethod,sasDataStepControl,sasDataStepStatement -" Ignore misleading //JCL SYNTAX... (Bob Heckel) -syn region sasComment start="[^/][^/]/\*" end="\*/" contains=sasTodo +" Procedures, base SAS, 9.4 +syn keyword sasProcStatementKeyword abort age append array attrib audit block break by calid cdfplot change checkbox class classlev column compute contents copy create datarow dbencoding define delete deletefunc deletesubr delimiter device dialog dur endcomp exact exchange exclude explore fin fmtlib fontfile fontpath format formats freq function getnames guessingrows hbar hdfs histogram holidur holifin holistart holivar id idlabel informat inset invalue item key keylabel keyword label line link listfunc listsubr mapmiss mapreduce mean menu messages meta modify opentype outargs outdur outfin output outstart pageby partial picture pie pig plot ppplot printer probplot profile prompter qqplot radiobox ranks rbreak rbutton rebuild record remove rename repair report roptions save select selection separator source star start statistics struct submenu subroutine sum sumby table tables test text trantab truetype type1 types value var vbar ways weight where with write contained +syn match sasProcStatement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasProcStatementKeyword,sasGlobalStatementKeyword +syn match sasProcStatement '\v%(^|;)\s*\zsods>' display contained contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty +syn match sasProcStatement '\v%(^|;)\s*\zs%(format|informat)>' display contained contains=sasProcStatementKeyword nextgroup=sasFormatContext skipwhite skipnl skipempty +syn region sasProc matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc%(\s+\h\w*)=>' end='\v%(^|;)\s*%(run|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasDataStepFunction,sasProcStatement +syn region sasProc matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+%(catalog|chart|datasets|document|plot)>' end='\v%(^|;)\s*%(quit|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasDataStepFunction,sasProcStatement -" Previous code for comments was written by Bob Heckel -" Comments with * may take multiple lines (Paulo Tanimoto) -syn region sasComment start=";\s*\*"hs=s+1 end=";" contains=sasTodo +" Procedures, SAS/GRAPH, 9.4 +syn keyword sasGraphProcStatementKeyword add area axis bar block bubble2 byline cc ccopy cdef cdelete chart cmap choro copy delete device dial donut exclude flow format fs goptions gout grid group hbar hbar3d hbullet hslider htrafficlight id igout label legend list modify move nobyline note pattern pie pie3d plot plot2 preview prism quit rename replay select scatter speedometer star surface symbol tc tcopy tdef tdelete template tile toggle treplay vbar vbar3d vtrafficlight vbullet vslider where contained +syn match sasGraphProcStatement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasGraphProcStatementKeyword,sasGlobalStatementKeyword +syn match sasGraphProcStatement '\v%(^|;)\s*\zsformat>' display contained contains=sasGraphProcStatementKeyword nextgroup=sasFormatContext skipwhite skipnl skipempty +syn region sasGraphProc matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+%(g3d|g3grid|ganno|gcontour|gdevice|geocode|gfont|ginside|goptions|gproject|greduce|gremove|mapimport)>' end='\v%(^|;)\s*%(run|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasDataStepFunction,sasGraphProcStatement +syn region sasGraphProc matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+%(gareabar|gbarline|gchart|gkpi|gmap|gplot|gradar|greplay|gslide|gtile)>' end='\v%(^|;)\s*%(quit|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasDataStepFunction,sasGraphProcStatement -" Comments with * starting after a semicolon (Paulo Tanimoto) -syn region sasComment start="^\s*\*" end=";" contains=sasTodo +" Procedures, SAS/STAT, 14.1 +syn keyword sasAnalyticalProcStatementKeyword absorb add array assess baseline bayes beginnodata bivar bootstrap bounds by cdfplot cells class cluster code compute condition contrast control coordinates copy cosan cov covtest coxreg der design determ deviance direct directions domain effect effectplot effpart em endnodata equality estimate exact exactoptions factor factors fcs filter fitindex format freq fwdlink gender grid group grow hazardratio height hyperprior id impjoint inset insetgroup invar invlink ippplot lincon lineqs lismod lmtests location logistic loglin lpredplot lsmeans lsmestimate manova matings matrix mcmc mean means missmodel mnar model modelaverage modeleffects monotone mstruct mtest multreg name nlincon nloptions oddsratio onecorr onesamplefreq onesamplemeans onewayanova outfiles output paired pairedfreq pairedmeans parameters parent parms partial partition path pathdiagram pcov performance plot population poststrata power preddist predict predpplot priors process probmodel profile prune pvar ram random ratio reference refit refmodel renameparm repeated replicate repweights response restore restrict retain reweight ridge rmsstd roc roccontrast rules samplesize samplingunit seed size scale score selection show simtests simulate slice std stderr store strata structeq supplementary table tables test testclass testfreq testfunc testid time transform treatments trend twosamplefreq twosamplemeans towsamplesurvival twosamplewilcoxon uds units univar var variance varnames weight where with zeromodel contained +syn match sasAnalyticalProcStatement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasAnalyticalProcStatementKeyword,sasGlobalStatementKeyword +syn match sasAnalyticalProcStatement '\v%(^|;)\s*\zsods>' display contained contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty +syn match sasAnalyticalProcStatement '\v%(^|;)\s*\zsformat>' display contained contains=sasAnalyticalProcStatementKeyword nextgroup=sasFormatContext skipwhite skipnl skipempty +syn region sasAnalyticalProc matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+%(aceclus|adaptivereg|bchoice|boxplot|calis|cancorr|candisc|cluster|corresp|discrim|distance|factor|fastclus|fmm|freq|gam|gampl|gee|genmod|glimmix|glmmod|glmpower|glmselect|hpcandisc|hpfmm|hpgenselect|hplmixed|hplogistic|hpmixed|hpnlmod|hppls|hpprincomp|hpquantselect|hpreg|hpsplit|iclifetest|icphreg|inbreed|irt|kde|krige2d|lattice|lifereg|lifetest|loess|logistic|mcmc|mds|mi|mianalyze|mixed|modeclus|multtest|nested|nlin|nlmixed|npar1way|orthoreg|phreg|plm|pls|power|princomp|prinqual|probit|quantlife|quantreg|quantselect|robustreg|rsreg|score|seqdesign|seqtest|sim2d|simnormal|spp|stdize|stdrate|stepdisc|surveyfreq|surveyimpute|surveylogistic|surveymeans|surveyphreg|surveyreg|surveyselect|tpspline|transreg|tree|ttest|varclus|varcomp|variogram)>' end='\v%(^|;)\s*%(run|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasDataStepControl,sasDataStepFunction,sasAnalyticalProcStatement +syn region sasAnalyticalProc matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+%(anova|arima|catmod|factex|glm|model|optex|plan|reg)>' end='\v%(^|;)\s*%(quit|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasDataStepControl,sasDataStepFunction,sasAnalyticalProcStatement -" This line defines macro variables in code. HiLink at end of file -" defines the color scheme. Begin region with ampersand and end with -" any non-word character offset by -1; put ampersand in the skip list -" just in case it is used to concatenate macro variable values. +" Procedures, ODS graphics, 9.4 +syn keyword sasODSGraphicsProcStatementKeyword band block bubble by colaxis compare dattrvar density dot dropline dynamic ellipse ellipseparm format fringe gradlegend hbar hbarbasic hbarparm hbox heatmap heatmapparm highlow histogram hline inset keylegend label lineparm loess matrix needle parent panelby pbspline plot polygon refline reg rowaxis scatter series spline step style styleattrs symbolchar symbolimage text vbar vbarbasic vbarparm vbox vector vline waterfall where xaxis x2axis yaxis y2axis yaxistable contained +syn match sasODSGraphicsProcStatement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasODSGraphicsProcStatementKeyword,sasGlobalStatementKeyword +syn match sasODSGraphicsProcStatement '\v%(^|;)\s*\zsods>' display contained contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty +syn match sasODSGraphicsProcStatement '\v%(^|;)\s*\zsformat>' display contained contains=sasODSGraphicsProcStatementKeyword nextgroup=sasFormatContext skipwhite skipnl skipempty +syn region sasODSGraphicsProc matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+%(sgdesign|sgpanel|sgplot|sgrender|sgscatter)>' end='\v%(^|;)\s*%(run|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasDataStepFunction,sasODSGraphicsProcStatement -" Thanks to ronald hllwarth for this fix to an intra-versioning -" problem with this little feature +" Proc TEMPLATE, 9.4 +syn keyword sasProcTemplateClause as into +syn keyword sasProcTemplateStatementKeyword block break cellstyle class close column compute continue define delete delstream do done dynamic edit else end eval flush footer header import iterate link list mvar ndent next nmvar notes open path put putl putlog putq putstream putvars replace set source stop style test text text2 text3 translate trigger unblock unset xdent contained +syn keyword sasProcTemplateStatementComplexKeyword cellvalue column crosstabs event footer header statgraph style table tagset contained +syn keyword sasProcTemplateGTLStatementKeyword axislegend axistable bandplot barchart barchartparm begingraph beginpolygon beginpolyline bihistogram3dparm blockplot boxplot boxplotparm bubbleplot continuouslegend contourplotparm dendrogram discretelegend drawarrow drawimage drawline drawoval drawrectangle drawtext dropline ellipse ellipseparm endgraph endinnermargin endlayout endpolygon endpolyline endsidebar entry entryfootnote entrytitle fringeplot heatmap heatmapparm highlowplot histogram histogramparm innermargin layout legenditem legendtextitems linechart lineparm loessplot mergedlegend modelband needleplot pbsplineplot polygonplot referenceline regressionplot scatterplot seriesplot sidebar stepplot surfaceplotparm symbolchar symbolimage textplot vectorplot waterfallchart contained +syn keyword sasProcTemplateGTLComplexKeyword datalattice datapanel globallegend gridded lattice overlay overlayequated overlay3d region contained +syn match sasProcTemplateStatement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasProcTemplateStatementKeyword,sasProcTemplateGTLStatementKeyword,sasGlobalStatementKeyword +syn match sasProcTemplateStatement '\v%(^|;)\s*\zsdefine>' display contained contains=sasProcTemplateStatementKeyword nextgroup=sasProcTemplateStatementComplexKeyword skipwhite skipnl skipempty +syn match sasProcTemplateStatement '\v%(^|;)\s*\zslayout>' display contained contains=sasProcTemplateGTLStatementKeyword nextgroup=sasProcTemplateGTLComplexKeyword skipwhite skipnl skipempty +syn match sasProcTemplateStatement '\v%(^|;)\s*\zsods>' display contained contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty +syn region sasProcTemplate matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+template>' end='\v%(^|;)\s*%(run|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasProcTemplateClause,sasProcTemplateStatement -if version < 600 - syn region sasMacroVar start="\&" skip="[_&]" end="\W"he=e-1 -else " for the older Vim's just do it their way ... - syn region sasMacroVar start="&" skip="[_&]" end="\W"he=e-1 -endif +" Proc SQL, 9.4 +syn keyword sasProcSQLFunctionName avg count css cv freq max mean median min n nmiss prt range std stderr sum sumwgt t uss var contained +syn region sasProcSQLFunctionContext start='(' end=')' contained contains=@sasBasicSyntax,sasProcSQLFunction +syn match sasProcSQLFunction '\v<\w+\ze\(' contained contains=sasProcSQLFunctionName,sasDataStepFunctionName nextgroup=sasProcSQLFunctionContext +syn keyword sasProcSQLClause add asc between by calculated cascade case check connection constraint cross desc distinct drop else end escape except exists foreign from full group having in inner intersect into is join key left libname like modify natural newline notrim null on order outer primary references restrict right separated set then to trimmed union unique user using values when where contained +syn keyword sasProcSQLClause as contained nextgroup=sasProcSQLStatementKeyword skipwhite skipnl skipempty +syn keyword sasProcSQLStatementKeyword connect delete disconnect execute insert reset select update validate contained +syn keyword sasProcSQLStatementComplexKeyword alter create describe drop contained nextgroup=sasProcSQLStatementNextKeyword skipwhite skipnl skipempty +syn keyword sasProcSQLStatementNextKeyword index table view contained +syn match sasProcSQLStatement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasProcSQLStatementKeyword,sasGlobalStatementKeyword +syn match sasProcSQLStatement '\v%(^|;)\s*\zs%(alter|create|describe|drop)>' display contained contains=sasProcSQLStatementComplexKeyword nextgroup=sasProcSQLStatementNextKeyword skipwhite skipnl skipempty +syn match sasProcSQLStatement '\v%(^|;)\s*\zsvalidate>' display contained contains=sasProcSQLStatementKeyword nextgroup=sasProcSQLStatementKeyword,sasProcSQLStatementComplexKeyword skipwhite skipnl skipempty +syn match sasProcSQLStatement '\v%(^|;)\s*\zsods>' display contained contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty +syn region sasProcSQL matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+sql>' end='\v%(^|;)\s*%(quit|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasProcSQLFunction,sasProcSQLClause,sasProcSQLStatement +" SAS/DS2, 9.4 +syn keyword sasDS2FunctionName abs anyalnum anyalpha anycntrl anydigit anyfirst anygraph anylower anyname anyprint anypunct anyspace anyupper anyxdigit arcos arcosh arsin arsinh artanh atan atan2 band beta betainv blackclprc blackptprc blkshclprc blkshptprc blshift bnot bor brshift bxor byte cat cats catt catx ceil ceilz choosec choosen cmp cmpt coalesce coalescec comb compare compbl compfuzz compound compress constant convx convxp cos cosh count countc countw css cumipmt cumprinc cv datdif date datejul datepart datetime day dequote deviance dhms dif digamma dim divide dur durp effrate erf erfc exp fact find findc findw floor floorz fmtinfo fuzz gaminv gamma garkhclprc garkhptprc gcd geodist geomean geomeanz harmean harmeanz hbound hms holiday hour index indexc indexw inputc inputn int intcindex intck intcycle intdt intfit intget intindex intnest intnx intrr intseas intshift inttest intts intz ipmt iqr irr juldate juldate7 kcount kstrcat kstrip kupdate kupdates kurtosis lag largest lbound lcm left length lengthc lengthm lengthn lgamma log logbeta log10 log1px log2 lowcase mad margrclprc margrptprc max md5 mdy mean median min minute missing mod modz month mort n ndims netpv nmiss nomrate notalnum notalpha notcntrl notdigit notfirst notgraph notlower notname notprint notpunct notspace notupper notxdigit npv null nwkdom ordinal pctl perm pmt poisson power ppmt probbeta probbnml probbnrm probchi probdf probf probgam probhypr probit probmc probmed probnegb probnorm probt prxchange prxmatch prxparse prxposn put pvp qtr quote ranbin rancau rand ranexp rangam range rank rannor ranpoi rantbl rantri ranuni repeat reverse right rms round rounde roundz savings scan sec second sha256hex sha256hmachex sign sin sinh skewness sleep smallest sqlexec sqrt std stderr streaminit strip substr substrn sum sumabs tan tanh time timepart timevalue tinv to_date to_double to_time to_timestamp today translate transtrn tranwrd trigamma trim trimn trunc uniform upcase uss uuidgen var verify vformat vinarray vinformat vlabel vlength vname vtype week weekday whichc whichn year yieldp yrdif yyq contained +syn region sasDS2FunctionContext start='(' end=')' contained contains=@sasBasicSyntax,sasDS2Function +syn match sasDS2Function '\v<\w+\ze\(' contained contains=sasDS2FunctionName nextgroup=sasDS2FunctionContext +syn keyword sasDS2Control continue data dcl declare do drop else end enddata endpackage endthread from go goto if leave method otherwise package point return select then thread to until when while contained +syn keyword sasDS2StatementKeyword array by forward keep merge output put rename retain set stop vararray varlist contained +syn keyword sasDS2StatementComplexKeyword package thread contained +syn match sasDS2Statement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasDS2StatementKeyword,sasGlobalStatementKeyword +syn match sasDS2Statement '\v%(^|;)\s*\zs%(dcl|declare|drop)>' display contained contains=sasDS2StatementKeyword nextgroup=sasDS2StatementComplexKeyword skipwhite skipnl skipempty +syn match sasDS2Statement '\v%(^|;)\s*\zsods>' display contained contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty +syn region sasDS2 matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+ds2>' end='\v%(^|;)\s*%(quit|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasDS2Function,sasDS2Control,sasDS2Statement -" I dont think specific PROCs need to be listed if use this line (Bob Heckel). -syn match sasProc "^\s*PROC \w\+" -syn keyword sasStep RUN QUIT DATA +" SAS/IML, 14.1 +syn keyword sasIMLFunctionName abs all allcomb allperm any apply armasim bin blankstr block branks bspline btran byte char choose col colvec concat contents convexit corr corr2cov countmiss countn countunique cov cov2corr covlag cshape cusum cuprod cv cvexhull datasets design designf det diag dif dimension distance do duration echelon eigval eigvec element exp expmatrix expandgrid fft forward froot full gasetup geomean ginv hadamard half hankel harmean hdir hermite homogen i ifft insert int inv invupdt isempty isskipped j jroot kurtosis lag length loc log logabsdet mad magic mahalanobis max mean median min mod moduleic modulein name ncol ndx2sub nleng norm normal nrow num opscal orpol parentname palette polyroot prod product pv quartile rancomb randdirichlet randfun randmultinomial randmvt randnormal randwishart ranperk ranperm range rank ranktie rates ratio remove repeat root row rowcat rowcatc rowvec rsubstr sample setdif shape shapecol skewness solve sparse splinev spot sqrsym sqrt sqrvech ssq standard std storage sub2ndx substr sum sweep symsqr t toeplitz trace trisolv type uniform union unique uniqueby value var vecdiag vech xmult xsect yield contained +syn keyword sasIMLCallRoutineName appcort armacov armalik bar box change comport delete eigen execute exportdatasettor exportmatrixtor farmacov farmafit farmalik farmasim fdif gaend gagetmem gagetval gainit gareeval garegen gasetcro gasetmut gasetobj gasetsel gblkvp gblkvpd gclose gdelete gdraw gdrawl geneig ggrid ginclude gopen gpie gpiexy gpoint gpoly gport gportpop gportstk gscale gscript gset gshow gsorth gstart gstop gstrlen gtext gvtext gwindow gxaxis gyaxis heatmapcont heatmapdisc histogram importdatasetfromr importmatrixfromr ipf itsolver kalcvf kalcvs kaldff kaldfs lav lcp lms lp lpsolve lts lupdt marg maxqform mcd milpsolve modulei mve nlpcg nlpdd nlpfdd nlpfea nlphqn nlplm nlpnms nlpnra nlpnrr nlpqn nlpqua nlptr ode odsgraph ortvec pgraf push qntl qr quad queue randgen randseed rdodt rupdt rename rupdt rzlind scatter seq seqscale seqshift seqscale seqshift series solvelin sort sortndx sound spline splinec svd tabulate tpspline tpsplnev tsbaysea tsdecomp tsmlocar tsmlomar tsmulmar tspears tspred tsroot tstvcar tsunimar valset varmacov varmalik varmasim vnormal vtsroot wavft wavget wavift wavprint wavthrsh contained +syn region sasIMLFunctionContext start='(' end=')' contained contains=@sasBasicSyntax,sasIMLFunction +syn match sasIMLFunction '\v<\w+\ze\(' contained contains=sasIMLFunctionName,sasDataStepFunction nextgroup=sasIMLFunctionContext +syn keyword sasIMLControl abort by do else end finish goto if link pause quit resume return run start stop then to until while contained +syn keyword sasIMLStatementKeyword append call close closefile create delete display edit file find force free index infile input list load mattrib print purge read remove replace reset save setin setout show sort store summary use window contained +syn match sasIMLStatement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasIMLStatementKeyword,sasGlobalStatementKeyword +syn match sasIMLStatement '\v%(^|;)\s*\zsods>' display contained contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty +syn region sasIML matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+iml>' end='\v%(^|;)\s*%(quit|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasIMLFunction,sasIMLControl,sasIMLStatement +" Macro definition +syn region sasMacro start='\v\%macro>' end='\v\%mend>' fold keepend contains=@sasBasicSyntax,@sasDataStepSyntax,sasDataStep,sasProc,sasODSGraphicsProc,sasGraphProc,sasAnalyticalProc,sasProcTemplate,sasProcSQL,sasDS2,sasIML -" Base SAS Procs - version 8.1 - -syn keyword sasConditional DO ELSE END IF THEN UNTIL WHILE - -syn keyword sasStatement ABORT ARRAY ATTRIB BY CALL CARDS CARDS4 CATNAME -syn keyword sasStatement CONTINUE DATALINES DATALINES4 DELETE DISPLAY -syn keyword sasStatement DM DROP ENDSAS ERROR FILE FILENAME FOOTNOTE -syn keyword sasStatement FORMAT GOTO INFILE INFORMAT INPUT KEEP -syn keyword sasStatement LABEL LEAVE LENGTH LIBNAME LINK LIST LOSTCARD -syn keyword sasStatement MERGE MISSING MODIFY OPTIONS OUTPUT PAGE -syn keyword sasStatement PUT REDIRECT REMOVE RENAME REPLACE RETAIN -syn keyword sasStatement RETURN SELECT SET SKIP STARTSAS STOP TITLE -syn keyword sasStatement UPDATE WAITSAS WHERE WINDOW X SYSTASK - -" Keywords that are used in Proc SQL -" I left them as statements because SAS's enhanced editor highlights -" them the same as normal statements used in data steps (Jim Kidd) - -syn keyword sasStatement ADD AND ALTER AS CASCADE CHECK CREATE -syn keyword sasStatement DELETE DESCRIBE DISTINCT DROP FOREIGN -syn keyword sasStatement FROM GROUP HAVING INDEX INSERT INTO IN -syn keyword sasStatement KEY LIKE MESSAGE MODIFY MSGTYPE NOT -syn keyword sasStatement NULL ON OR ORDER PRIMARY REFERENCES -syn keyword sasStatement RESET RESTRICT SELECT SET TABLE -syn keyword sasStatement UNIQUE UPDATE VALIDATE VIEW WHERE - -" Match declarations have to appear one per line (Paulo Tanimoto) -syn match sasStatement "FOOTNOTE\d" -syn match sasStatement "TITLE\d" - -" Match declarations have to appear one per line (Paulo Tanimoto) -syn match sasMacro "%BQUOTE" -syn match sasMacro "%NRBQUOTE" -syn match sasMacro "%CMPRES" -syn match sasMacro "%QCMPRES" -syn match sasMacro "%COMPSTOR" -syn match sasMacro "%DATATYP" -syn match sasMacro "%DISPLAY" -syn match sasMacro "%DO" -syn match sasMacro "%ELSE" -syn match sasMacro "%END" -syn match sasMacro "%EVAL" -syn match sasMacro "%GLOBAL" -syn match sasMacro "%GOTO" -syn match sasMacro "%IF" -syn match sasMacro "%INDEX" -syn match sasMacro "%INPUT" -syn match sasMacro "%KEYDEF" -syn match sasMacro "%LABEL" -syn match sasMacro "%LEFT" -syn match sasMacro "%LENGTH" -syn match sasMacro "%LET" -syn match sasMacro "%LOCAL" -syn match sasMacro "%LOWCASE" -syn match sasMacro "%MACRO" -syn match sasMacro "%MEND" -syn match sasMacro "%NRBQUOTE" -syn match sasMacro "%NRQUOTE" -syn match sasMacro "%NRSTR" -syn match sasMacro "%PUT" -syn match sasMacro "%QCMPRES" -syn match sasMacro "%QLEFT" -syn match sasMacro "%QLOWCASE" -syn match sasMacro "%QSCAN" -syn match sasMacro "%QSUBSTR" -syn match sasMacro "%QSYSFUNC" -syn match sasMacro "%QTRIM" -syn match sasMacro "%QUOTE" -syn match sasMacro "%QUPCASE" -syn match sasMacro "%SCAN" -syn match sasMacro "%STR" -syn match sasMacro "%SUBSTR" -syn match sasMacro "%SUPERQ" -syn match sasMacro "%SYSCALL" -syn match sasMacro "%SYSEVALF" -syn match sasMacro "%SYSEXEC" -syn match sasMacro "%SYSFUNC" -syn match sasMacro "%SYSGET" -syn match sasMacro "%SYSLPUT" -syn match sasMacro "%SYSPROD" -syn match sasMacro "%SYSRC" -syn match sasMacro "%SYSRPUT" -syn match sasMacro "%THEN" -syn match sasMacro "%TO" -syn match sasMacro "%TRIM" -syn match sasMacro "%UNQUOTE" -syn match sasMacro "%UNTIL" -syn match sasMacro "%UPCASE" -syn match sasMacro "%VERIFY" -syn match sasMacro "%WHILE" -syn match sasMacro "%WINDOW" - -" SAS Functions - -syn keyword sasFunction ABS ADDR AIRY ARCOS ARSIN ATAN ATTRC ATTRN -syn keyword sasFunction BAND BETAINV BLSHIFT BNOT BOR BRSHIFT BXOR -syn keyword sasFunction BYTE CDF CEIL CEXIST CINV CLOSE CNONCT COLLATE -syn keyword sasFunction COMPBL COMPOUND COMPRESS COS COSH CSS CUROBS -syn keyword sasFunction CV DACCDB DACCDBSL DACCSL DACCSYD DACCTAB -syn keyword sasFunction DAIRY DATE DATEJUL DATEPART DATETIME DAY -syn keyword sasFunction DCLOSE DEPDB DEPDBSL DEPDBSL DEPSL DEPSL -syn keyword sasFunction DEPSYD DEPSYD DEPTAB DEPTAB DEQUOTE DHMS -syn keyword sasFunction DIF DIGAMMA DIM DINFO DNUM DOPEN DOPTNAME -syn keyword sasFunction DOPTNUM DREAD DROPNOTE DSNAME ERF ERFC EXIST -syn keyword sasFunction EXP FAPPEND FCLOSE FCOL FDELETE FETCH FETCHOBS -syn keyword sasFunction FEXIST FGET FILEEXIST FILENAME FILEREF FINFO -syn keyword sasFunction FINV FIPNAME FIPNAMEL FIPSTATE FLOOR FNONCT -syn keyword sasFunction FNOTE FOPEN FOPTNAME FOPTNUM FPOINT FPOS -syn keyword sasFunction FPUT FREAD FREWIND FRLEN FSEP FUZZ FWRITE -syn keyword sasFunction GAMINV GAMMA GETOPTION GETVARC GETVARN HBOUND -syn keyword sasFunction HMS HOSTHELP HOUR IBESSEL INDEX INDEXC -syn keyword sasFunction INDEXW INPUT INPUTC INPUTN INT INTCK INTNX -syn keyword sasFunction INTRR IRR JBESSEL JULDATE KURTOSIS LAG LBOUND -syn keyword sasFunction LEFT LENGTH LGAMMA LIBNAME LIBREF LOG LOG10 -syn keyword sasFunction LOG2 LOGPDF LOGPMF LOGSDF LOWCASE MAX MDY -syn keyword sasFunction MEAN MIN MINUTE MOD MONTH MOPEN MORT N -syn keyword sasFunction NETPV NMISS NORMAL NOTE NPV OPEN ORDINAL -syn keyword sasFunction PATHNAME PDF PEEK PEEKC PMF POINT POISSON POKE -syn keyword sasFunction PROBBETA PROBBNML PROBCHI PROBF PROBGAM -syn keyword sasFunction PROBHYPR PROBIT PROBNEGB PROBNORM PROBT PUT -syn keyword sasFunction PUTC PUTN QTR QUOTE RANBIN RANCAU RANEXP -syn keyword sasFunction RANGAM RANGE RANK RANNOR RANPOI RANTBL RANTRI -syn keyword sasFunction RANUNI REPEAT RESOLVE REVERSE REWIND RIGHT -syn keyword sasFunction ROUND SAVING SCAN SDF SECOND SIGN SIN SINH -syn keyword sasFunction SKEWNESS SOUNDEX SPEDIS SQRT STD STDERR STFIPS -syn keyword sasFunction STNAME STNAMEL SUBSTR SUM SYMGET SYSGET SYSMSG -syn keyword sasFunction SYSPROD SYSRC SYSTEM TAN TANH TIME TIMEPART -syn keyword sasFunction TINV TNONCT TODAY TRANSLATE TRANWRD TRIGAMMA -syn keyword sasFunction TRIM TRIMN TRUNC UNIFORM UPCASE USS VAR -syn keyword sasFunction VARFMT VARINFMT VARLABEL VARLEN VARNAME -syn keyword sasFunction VARNUM VARRAY VARRAYX VARTYPE VERIFY VFORMAT -syn keyword sasFunction VFORMATD VFORMATDX VFORMATN VFORMATNX VFORMATW -syn keyword sasFunction VFORMATWX VFORMATX VINARRAY VINARRAYX VINFORMAT -syn keyword sasFunction VINFORMATD VINFORMATDX VINFORMATN VINFORMATNX -syn keyword sasFunction VINFORMATW VINFORMATWX VINFORMATX VLABEL -syn keyword sasFunction VLABELX VLENGTH VLENGTHX VNAME VNAMEX VTYPE -syn keyword sasFunction VTYPEX WEEKDAY YEAR YYQ ZIPFIPS ZIPNAME ZIPNAMEL -syn keyword sasFunction ZIPSTATE - -" Handy settings for using vim with log files -syn keyword sasLogMsg NOTE -syn keyword sasWarnMsg WARNING -syn keyword sasErrMsg ERROR - -" Always contained in a comment (Bob Heckel) -syn keyword sasTodo TODO TBD FIXME contained - -" These don't fit anywhere else (Bob Heckel). -" Added others that were missing. -syn keyword sasUnderscore _ALL_ _AUTOMATIC_ _CHARACTER_ _INFILE_ _N_ _NAME_ _NULL_ _NUMERIC_ _USER_ _WEBOUT_ - -" End of SAS Functions - -" Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet - -if version >= 508 || !exists("did_sas_syntax_inits") - if version < 508 - let did_sas_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - - " Default sas enhanced editor color syntax - hi sComment term=bold cterm=NONE ctermfg=Green ctermbg=Black gui=NONE guifg=DarkGreen guibg=White - hi sCard term=bold cterm=NONE ctermfg=Black ctermbg=Yellow gui=NONE guifg=Black guibg=LightYellow - hi sDate_Time term=NONE cterm=bold ctermfg=Green ctermbg=Black gui=bold guifg=SeaGreen guibg=White - hi sKeyword term=NONE cterm=NONE ctermfg=Blue ctermbg=Black gui=NONE guifg=Blue guibg=White - hi sFmtInfmt term=NONE cterm=NONE ctermfg=LightGreen ctermbg=Black gui=NONE guifg=SeaGreen guibg=White - hi sString term=NONE cterm=NONE ctermfg=Magenta ctermbg=Black gui=NONE guifg=Purple guibg=White - hi sText term=NONE cterm=NONE ctermfg=White ctermbg=Black gui=bold guifg=Black guibg=White - hi sNumber term=NONE cterm=bold ctermfg=Green ctermbg=Black gui=bold guifg=SeaGreen guibg=White - hi sProc term=NONE cterm=bold ctermfg=Blue ctermbg=Black gui=bold guifg=Navy guibg=White - hi sSection term=NONE cterm=bold ctermfg=Blue ctermbg=Black gui=bold guifg=Navy guibg=White - hi mDefine term=NONE cterm=bold ctermfg=White ctermbg=Black gui=bold guifg=Black guibg=White - hi mKeyword term=NONE cterm=NONE ctermfg=Blue ctermbg=Black gui=NONE guifg=Blue guibg=White - hi mReference term=NONE cterm=bold ctermfg=White ctermbg=Black gui=bold guifg=Blue guibg=White - hi mSection term=NONE cterm=NONE ctermfg=Blue ctermbg=Black gui=bold guifg=Navy guibg=White - hi mText term=NONE cterm=NONE ctermfg=White ctermbg=Black gui=bold guifg=Black guibg=White - -" Colors that closely match SAS log colors for default color scheme - hi lError term=NONE cterm=NONE ctermfg=Red ctermbg=Black gui=none guifg=Red guibg=White - hi lWarning term=NONE cterm=NONE ctermfg=Green ctermbg=Black gui=none guifg=Green guibg=White - hi lNote term=NONE cterm=NONE ctermfg=Cyan ctermbg=Black gui=none guifg=Blue guibg=White - - - " Special hilighting for the SAS proc section - - HiLink sasComment sComment - HiLink sasConditional sKeyword - HiLink sasStep sSection - HiLink sasFunction sKeyword - HiLink sasMacro mKeyword - HiLink sasMacroVar NonText - HiLink sasNumber sNumber - HiLink sasStatement sKeyword - HiLink sasString sString - HiLink sasProc sProc - " (Bob Heckel) - HiLink sasTodo Todo - HiLink sasErrMsg lError - HiLink sasWarnMsg lWarning - HiLink sasLogMsg lNote - HiLink sasCards sCard - " (Bob Heckel) - HiLink sasUnderscore PreProc - delcommand HiLink -endif +" Define default highlighting +hi def link sasComment Comment +hi def link sasTodo Delimiter +hi def link sasSectLbl Title +hi def link sasSectLblEnds Comment +hi def link sasNumber Number +hi def link sasDateTime Constant +hi def link sasString String +hi def link sasDataStepControl Keyword +hi def link sasProcTemplateClause Keyword +hi def link sasProcSQLClause Keyword +hi def link sasDS2Control Keyword +hi def link sasIMLControl Keyword +hi def link sasOperator Operator +hi def link sasGlobalStatementKeyword Statement +hi def link sasGlobalStatementODSKeyword Statement +hi def link sasSectionKeyword Statement +hi def link sasDataStepFunctionName Function +hi def link sasDataStepCallRoutineName Function +hi def link sasDataStepStatementKeyword Statement +hi def link sasDataStepStatementHashKeyword Statement +hi def link sasDataStepHashOperator Operator +hi def link sasDataStepHashMethodName Function +hi def link sasDataStepHashAttributeName Identifier +hi def link sasProcStatementKeyword Statement +hi def link sasODSGraphicsProcStatementKeyword Statement +hi def link sasGraphProcStatementKeyword Statement +hi def link sasAnalyticalProcStatementKeyword Statement +hi def link sasProcTemplateStatementKeyword Statement +hi def link sasProcTemplateStatementComplexKeyword Statement +hi def link sasProcTemplateGTLStatementKeyword Statement +hi def link sasProcTemplateGTLComplexKeyword Statement +hi def link sasProcSQLFunctionName Function +hi def link sasProcSQLStatementKeyword Statement +hi def link sasProcSQLStatementComplexKeyword Statement +hi def link sasProcSQLStatementNextKeyword Statement +hi def link sasDS2FunctionName Function +hi def link sasDS2StatementKeyword Statement +hi def link sasIMLFunctionName Function +hi def link sasIMLCallRoutineName Function +hi def link sasIMLStatementKeyword Statement +hi def link sasMacroReserved PreProc +hi def link sasMacroVariable Define +hi def link sasMacroFunctionName Define +hi def link sasDataLine SpecialChar +hi def link sasFormat SpecialChar +hi def link sasReserved Special " Syncronize from beginning to keep large blocks from losing " syntax coloring while moving through code. @@ -281,4 +261,5 @@ syn sync fromstart let b:current_syntax = "sas" -" vim: ts=8 +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/syntax/sass.vim b/runtime/syntax/sass.vim index 2ea0722696..d075c8736e 100644 --- a/runtime/syntax/sass.vim +++ b/runtime/syntax/sass.vim @@ -2,7 +2,7 @@ " Language: Sass " Maintainer: Tim Pope " Filenames: *.sass -" Last Change: 2013 May 30 +" Last Change: 2016 Aug 29 if exists("b:current_syntax") finish @@ -13,7 +13,7 @@ runtime! syntax/css.vim syn case ignore syn cluster sassCssProperties contains=cssFontProp,cssFontDescriptorProp,cssColorProp,cssTextProp,cssBoxProp,cssGeneratedContentProp,cssPagingProp,cssUIProp,cssRenderProp,cssAuralProp,cssTableProp -syn cluster sassCssAttributes contains=css.*Attr,scssComment,cssValue.*,cssColor,cssURL,sassDefault,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssRenderProp +syn cluster sassCssAttributes contains=css.*Attr,sassEndOfLineComment,scssComment,cssValue.*,cssColor,cssURL,sassDefault,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssRenderProp syn region sassDefinition matchgroup=cssBraces start="{" end="}" contains=TOP @@ -58,6 +58,9 @@ syn match sassAmpersand "&" " TODO: Attribute namespaces " TODO: Arithmetic (including strings and concatenation) +syn region sassMediaQuery matchgroup=sassMedia start="@media" end="[{};]\@=\|$" contains=sassMediaOperators +syn keyword sassMediaOperators and not only contained +syn region sassCharset start="@charset" end=";\|$" contains=scssComment,cssStringQ,cssStringQQ,cssURL,cssUnicodeEscape,cssMediaType syn region sassInclude start="@import" end=";\|$" contains=scssComment,cssStringQ,cssStringQQ,cssURL,cssUnicodeEscape,cssMediaType syn region sassDebugLine end=";\|$" matchgroup=sassDebug start="@debug\>" contains=@sassCssAttributes,sassVariable,sassFunction syn region sassWarnLine end=";\|$" matchgroup=sassWarn start="@warn\>" contains=@sassCssAttributes,sassVariable,sassFunction @@ -67,7 +70,9 @@ syn keyword sassFor from to through in contained syn keyword sassTodo FIXME NOTE TODO OPTIMIZE XXX contained syn region sassComment start="^\z(\s*\)//" end="^\%(\z1 \)\@!" contains=sassTodo,@Spell syn region sassCssComment start="^\z(\s*\)/\*" end="^\%(\z1 \)\@!" contains=sassTodo,@Spell +syn match sassEndOfLineComment "//.*" contains=sassComment,sassTodo,@Spell +hi def link sassEndOfLineComment sassComment hi def link sassCssComment sassComment hi def link sassComment Comment hi def link sassDefault cssImportant @@ -80,6 +85,9 @@ hi def link sassExtend PreProc hi def link sassFunctionDecl PreProc hi def link sassReturn PreProc hi def link sassTodo Todo +hi def link sassCharset PreProc +hi def link sassMedia PreProc +hi def link sassMediaOperators PreProc hi def link sassInclude Include hi def link sassDebug sassControl hi def link sassWarn sassControl diff --git a/runtime/syntax/sather.vim b/runtime/syntax/sather.vim index 103cf0b8cd..baa3a825d8 100644 --- a/runtime/syntax/sather.vim +++ b/runtime/syntax/sather.vim @@ -9,11 +9,8 @@ " Homepage: http://www.icsi.berkeley.edu/~sather " Sather files use .sa as suffix -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -61,44 +58,34 @@ syn match satherComment "--.*" contains=satherComment2String,satherCharacter syn sync ccomment satherComment " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_sather_syn_inits") - if version < 508 - let did_sather_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink satherBranch satherStatement - HiLink satherLabel satherStatement - HiLink satherConditional satherStatement - HiLink satherSynchronize satherStatement - HiLink satherRepeat satherStatement - HiLink satherExceptions satherStatement - HiLink satherStorageClass satherDeclarative - HiLink satherMethodDecl satherDeclarative - HiLink satherClassDecl satherDeclarative - HiLink satherScopeDecl satherDeclarative - HiLink satherBoolValue satherValue - HiLink satherSpecial satherValue - HiLink satherString satherValue - HiLink satherCharacter satherValue - HiLink satherSpecialCharacter satherValue - HiLink satherNumber satherValue - HiLink satherStatement Statement - HiLink satherOperator Statement - HiLink satherComment Comment - HiLink satherType Type - HiLink satherValue String - HiLink satherString String - HiLink satherSpecial String - HiLink satherCharacter String - HiLink satherDeclarative Type - HiLink satherExternal PreCondit - delcommand HiLink -endif +hi def link satherBranch satherStatement +hi def link satherLabel satherStatement +hi def link satherConditional satherStatement +hi def link satherSynchronize satherStatement +hi def link satherRepeat satherStatement +hi def link satherExceptions satherStatement +hi def link satherStorageClass satherDeclarative +hi def link satherMethodDecl satherDeclarative +hi def link satherClassDecl satherDeclarative +hi def link satherScopeDecl satherDeclarative +hi def link satherBoolValue satherValue +hi def link satherSpecial satherValue +hi def link satherString satherValue +hi def link satherCharacter satherValue +hi def link satherSpecialCharacter satherValue +hi def link satherNumber satherValue +hi def link satherStatement Statement +hi def link satherOperator Statement +hi def link satherComment Comment +hi def link satherType Type +hi def link satherValue String +hi def link satherString String +hi def link satherSpecial String +hi def link satherCharacter String +hi def link satherDeclarative Type +hi def link satherExternal PreCondit let b:current_syntax = "sather" diff --git a/runtime/syntax/sbt.vim b/runtime/syntax/sbt.vim new file mode 100644 index 0000000000..cbf73beafe --- /dev/null +++ b/runtime/syntax/sbt.vim @@ -0,0 +1,32 @@ +" Vim syntax file +" Language: sbt +" Maintainer: Steven Dobay +" Last Change: 2017.04.30 + +if exists("b:current_syntax") + finish +endif + +runtime! syntax/scala.vim + +syn region sbtString start="\"[^"]" skip="\\\"" end="\"" contains=sbtStringEscape +syn match sbtStringEscape "\\u[0-9a-fA-F]\{4}" contained +syn match sbtStringEscape "\\[nrfvb\\\"]" contained + +syn match sbtIdentitifer "^\S\+\ze\s*\(:=\|++=\|+=\|<<=\|<+=\)" +syn match sbtBeginningSeq "^[Ss]eq\>" + +syn match sbtSpecial "\(:=\|++=\|+=\|<<=\|<+=\)" + +syn match sbtLineComment "//.*" +syn region sbtComment start="/\*" end="\*/" +syn region sbtDocComment start="/\*\*" end="\*/" keepend + +hi link sbtString String +hi link sbtIdentitifer Keyword +hi link sbtBeginningSeq Keyword +hi link sbtSpecial Special +hi link sbtComment Comment +hi link sbtLineComment Comment +hi link sbtDocComment Comment + diff --git a/runtime/syntax/scala.vim b/runtime/syntax/scala.vim new file mode 100644 index 0000000000..c5a175fd77 --- /dev/null +++ b/runtime/syntax/scala.vim @@ -0,0 +1,232 @@ +" Vim syntax file +" Language: Scala +" Maintainer: Derek Wyatt +" URL: https://github.com/derekwyatt/vim-scala +" License: Same as Vim +" Last Change: 20 May 2016 +" ---------------------------------------------------------------------------- + +if !exists('main_syntax') + " quit when a syntax file was already loaded + if exists("b:current_syntax") + finish + endif + let main_syntax = 'scala' +endif + +scriptencoding utf-8 + +let b:current_syntax = "scala" + +" Allows for embedding, see #59; main_syntax convention instead? Refactor TOP +" +" The @Spell here is a weird hack, it means *exclude* if the first group is +" TOP. Otherwise we get spelling errors highlighted on code elements that +" match scalaBlock, even with `syn spell notoplevel`. +function! s:ContainedGroup() + try + silent syn list @scala + return '@scala,@NoSpell' + catch /E392/ + return 'TOP,@Spell' + endtry +endfunction + +unlet! b:current_syntax + +syn case match +syn sync minlines=200 maxlines=1000 + +syn keyword scalaKeyword catch do else final finally for forSome if +syn keyword scalaKeyword match return throw try while yield macro +syn keyword scalaKeyword class trait object extends with nextgroup=scalaInstanceDeclaration skipwhite +syn keyword scalaKeyword case nextgroup=scalaKeyword,scalaCaseFollowing skipwhite +syn keyword scalaKeyword val nextgroup=scalaNameDefinition,scalaQuasiQuotes skipwhite +syn keyword scalaKeyword def var nextgroup=scalaNameDefinition skipwhite +hi link scalaKeyword Keyword + +exe 'syn region scalaBlock start=/{/ end=/}/ contains=' . s:ContainedGroup() . ' fold' + +syn keyword scalaAkkaSpecialWord when goto using startWith initialize onTransition stay become unbecome +hi link scalaAkkaSpecialWord PreProc + +syn keyword scalatestSpecialWord shouldBe +syn match scalatestShouldDSLA /^\s\+\zsit should/ +syn match scalatestShouldDSLB /\/ +hi link scalatestSpecialWord PreProc +hi link scalatestShouldDSLA PreProc +hi link scalatestShouldDSLB PreProc + +syn match scalaSymbol /'[_A-Za-z0-9$]\+/ +hi link scalaSymbol Number + +syn match scalaChar /'.'/ +syn match scalaChar /'\\[\\"'ntbrf]'/ contains=scalaEscapedChar +syn match scalaChar /'\\u[A-Fa-f0-9]\{4}'/ contains=scalaUnicodeChar +syn match scalaEscapedChar /\\[\\"'ntbrf]/ +syn match scalaUnicodeChar /\\u[A-Fa-f0-9]\{4}/ +hi link scalaChar Character +hi link scalaEscapedChar Function +hi link scalaUnicodeChar Special + +syn match scalaOperator "||" +syn match scalaOperator "&&" +syn match scalaOperator "|" +syn match scalaOperator "&" +hi link scalaOperator Special + +syn match scalaNameDefinition /\<[_A-Za-z0-9$]\+\>/ contained nextgroup=scalaPostNameDefinition,scalaVariableDeclarationList +syn match scalaNameDefinition /`[^`]\+`/ contained nextgroup=scalaPostNameDefinition +syn match scalaVariableDeclarationList /\s*,\s*/ contained nextgroup=scalaNameDefinition +syn match scalaPostNameDefinition /\_s*:\_s*/ contained nextgroup=scalaTypeDeclaration +hi link scalaNameDefinition Function + +syn match scalaInstanceDeclaration /\<[_\.A-Za-z0-9$]\+\>/ contained nextgroup=scalaInstanceHash +syn match scalaInstanceDeclaration /`[^`]\+`/ contained +syn match scalaInstanceHash /#/ contained nextgroup=scalaInstanceDeclaration +hi link scalaInstanceDeclaration Special +hi link scalaInstanceHash Type + +syn match scalaUnimplemented /???/ +hi link scalaUnimplemented ERROR + +syn match scalaCapitalWord /\<[A-Z][A-Za-z0-9$]*\>/ +hi link scalaCapitalWord Special + +" Handle type declarations specially +syn region scalaTypeStatement matchgroup=Keyword start=/\\)\ze/ contained nextgroup=scalaTypeTypeDeclaration contains=scalaTypeTypeExtension skipwhite +syn match scalaTypeTypeDeclaration /\<[_\.A-Za-z0-9$]\+\>/ contained nextgroup=scalaTypeTypeExtension,scalaTypeTypeEquals skipwhite +syn match scalaTypeTypeEquals /=\ze[^>]/ contained nextgroup=scalaTypeTypePostDeclaration skipwhite +syn match scalaTypeTypeExtension /)\?\_s*\zs\%(⇒\|=>\|<:\|:>\|=:=\|::\|#\)/ contained nextgroup=scalaTypeTypeDeclaration skipwhite +syn match scalaTypeTypePostDeclaration /\<[_\.A-Za-z0-9$]\+\>/ contained nextgroup=scalaTypeTypePostExtension skipwhite +syn match scalaTypeTypePostExtension /\%(⇒\|=>\|<:\|:>\|=:=\|::\)/ contained nextgroup=scalaTypeTypePostDeclaration skipwhite +hi link scalaTypeTypeDeclaration Type +hi link scalaTypeTypeExtension Keyword +hi link scalaTypeTypePostDeclaration Special +hi link scalaTypeTypePostExtension Keyword + +syn match scalaTypeDeclaration /(/ contained nextgroup=scalaTypeExtension contains=scalaRoundBrackets skipwhite +syn match scalaTypeDeclaration /\%(⇒\|=>\)\ze/ contained nextgroup=scalaTypeDeclaration contains=scalaTypeExtension skipwhite +syn match scalaTypeDeclaration /\<[_\.A-Za-z0-9$]\+\>/ contained nextgroup=scalaTypeExtension skipwhite +syn match scalaTypeExtension /)\?\_s*\zs\%(⇒\|=>\|<:\|:>\|=:=\|::\|#\)/ contained nextgroup=scalaTypeDeclaration skipwhite +hi link scalaTypeDeclaration Type +hi link scalaTypeExtension Keyword +hi link scalaTypePostExtension Keyword + +syn match scalaTypeAnnotation /\%([_a-zA-Z0-9$\s]:\_s*\)\ze[_=(\.A-Za-z0-9$]\+/ skipwhite nextgroup=scalaTypeDeclaration contains=scalaRoundBrackets +syn match scalaTypeAnnotation /)\_s*:\_s*\ze[_=(\.A-Za-z0-9$]\+/ skipwhite nextgroup=scalaTypeDeclaration +hi link scalaTypeAnnotation Normal + +syn match scalaCaseFollowing /\<[_\.A-Za-z0-9$]\+\>/ contained +syn match scalaCaseFollowing /`[^`]\+`/ contained +hi link scalaCaseFollowing Special + +syn keyword scalaKeywordModifier abstract override final lazy implicit implicitly private protected sealed null require super +hi link scalaKeywordModifier Function + +syn keyword scalaSpecial this true false ne eq +syn keyword scalaSpecial new nextgroup=scalaInstanceDeclaration skipwhite +syn match scalaSpecial "\%(=>\|⇒\|<-\|←\|->\|→\)" +syn match scalaSpecial /`[^`]\+`/ " Backtick literals +hi link scalaSpecial PreProc + +syn keyword scalaExternal package import +hi link scalaExternal Include + +syn match scalaStringEmbeddedQuote /\\"/ contained +syn region scalaString start=/"/ end=/"/ contains=scalaStringEmbeddedQuote,scalaEscapedChar,scalaUnicodeChar +hi link scalaString String +hi link scalaStringEmbeddedQuote String + +syn region scalaIString matchgroup=scalaInterpolationBrackets start=/\<[a-zA-Z][a-zA-Z0-9_]*"/ skip=/\\"/ end=/"/ contains=scalaInterpolation,scalaInterpolationB,scalaEscapedChar,scalaUnicodeChar +syn region scalaTripleIString matchgroup=scalaInterpolationBrackets start=/\<[a-zA-Z][a-zA-Z0-9_]*"""/ end=/"""\ze\%([^"]\|$\)/ contains=scalaInterpolation,scalaInterpolationB,scalaEscapedChar,scalaUnicodeChar +hi link scalaIString String +hi link scalaTripleIString String + +syn match scalaInterpolation /\$[a-zA-Z0-9_$]\+/ contained +exe 'syn region scalaInterpolationB matchgroup=scalaInterpolationBoundary start=/\${/ end=/}/ contained contains=' . s:ContainedGroup() +hi link scalaInterpolation Function +hi link scalaInterpolationB Normal + +syn region scalaFString matchgroup=scalaInterpolationBrackets start=/f"/ skip=/\\"/ end=/"/ contains=scalaFInterpolation,scalaFInterpolationB,scalaEscapedChar,scalaUnicodeChar +syn match scalaFInterpolation /\$[a-zA-Z0-9_$]\+\(%[-A-Za-z0-9\.]\+\)\?/ contained +exe 'syn region scalaFInterpolationB matchgroup=scalaInterpolationBoundary start=/${/ end=/}\(%[-A-Za-z0-9\.]\+\)\?/ contained contains=' . s:ContainedGroup() +hi link scalaFString String +hi link scalaFInterpolation Function +hi link scalaFInterpolationB Normal + +syn region scalaTripleString start=/"""/ end=/"""\%([^"]\|$\)/ contains=scalaEscapedChar,scalaUnicodeChar +syn region scalaTripleFString matchgroup=scalaInterpolationBrackets start=/f"""/ end=/"""\%([^"]\|$\)/ contains=scalaFInterpolation,scalaFInterpolationB,scalaEscapedChar,scalaUnicodeChar +hi link scalaTripleString String +hi link scalaTripleFString String + +hi link scalaInterpolationBrackets Special +hi link scalaInterpolationBoundary Function + +syn match scalaNumber /\<0[dDfFlL]\?\>/ " Just a bare 0 +syn match scalaNumber /\<[1-9]\d*[dDfFlL]\?\>/ " A multi-digit number - octal numbers with leading 0's are deprecated in Scala +syn match scalaNumber /\<0[xX][0-9a-fA-F]\+[dDfFlL]\?\>/ " Hex number +syn match scalaNumber /\%(\<\d\+\.\d*\|\.\d\+\)\%([eE][-+]\=\d\+\)\=[fFdD]\=/ " exponential notation 1 +syn match scalaNumber /\<\d\+[eE][-+]\=\d\+[fFdD]\=\>/ " exponential notation 2 +syn match scalaNumber /\<\d\+\%([eE][-+]\=\d\+\)\=[fFdD]\>/ " exponential notation 3 +hi link scalaNumber Number + +syn region scalaRoundBrackets start="(" end=")" skipwhite contained contains=scalaTypeDeclaration,scalaSquareBrackets,scalaRoundBrackets + +syn region scalaSquareBrackets matchgroup=scalaSquareBracketsBrackets start="\[" end="\]" skipwhite nextgroup=scalaTypeExtension contains=scalaTypeDeclaration,scalaSquareBrackets,scalaTypeOperator,scalaTypeAnnotationParameter +syn match scalaTypeOperator /[-+=:<>]\+/ contained +syn match scalaTypeAnnotationParameter /@\<[`_A-Za-z0-9$]\+\>/ contained +hi link scalaSquareBracketsBrackets Type +hi link scalaTypeOperator Keyword +hi link scalaTypeAnnotationParameter Function + +syn match scalaShebang "\%^#!.*" display +syn region scalaMultilineComment start="/\*" end="\*/" contains=scalaMultilineComment,scalaDocLinks,scalaParameterAnnotation,scalaCommentAnnotation,scalaTodo,scalaCommentCodeBlock,@Spell keepend fold +syn match scalaCommentAnnotation "@[_A-Za-z0-9$]\+" contained +syn match scalaParameterAnnotation "\%(@tparam\|@param\|@see\)" nextgroup=scalaParamAnnotationValue skipwhite contained +syn match scalaParamAnnotationValue /[.`_A-Za-z0-9$]\+/ contained +syn region scalaDocLinks start="\[\[" end="\]\]" contained +syn region scalaCommentCodeBlock matchgroup=Keyword start="{{{" end="}}}" contained +syn match scalaTodo "\vTODO|FIXME|XXX" contained +hi link scalaShebang Comment +hi link scalaMultilineComment Comment +hi link scalaDocLinks Function +hi link scalaParameterAnnotation Function +hi link scalaParamAnnotationValue Keyword +hi link scalaCommentAnnotation Function +hi link scalaCommentCodeBlockBrackets String +hi link scalaCommentCodeBlock String +hi link scalaTodo Todo + +syn match scalaAnnotation /@\<[`_A-Za-z0-9$]\+\>/ +hi link scalaAnnotation PreProc + +syn match scalaTrailingComment "//.*$" contains=scalaTodo,@Spell +hi link scalaTrailingComment Comment + +syn match scalaAkkaFSM /goto([^)]*)\_s\+\/ contains=scalaAkkaFSMGotoUsing +syn match scalaAkkaFSM /stay\_s\+using/ +syn match scalaAkkaFSM /^\s*stay\s*$/ +syn match scalaAkkaFSM /when\ze([^)]*)/ +syn match scalaAkkaFSM /startWith\ze([^)]*)/ +syn match scalaAkkaFSM /initialize\ze()/ +syn match scalaAkkaFSM /onTransition/ +syn match scalaAkkaFSM /onTermination/ +syn match scalaAkkaFSM /whenUnhandled/ +syn match scalaAkkaFSMGotoUsing /\/ +syn match scalaAkkaFSMGotoUsing /\/ +hi link scalaAkkaFSM PreProc +hi link scalaAkkaFSMGotoUsing PreProc + +let b:current_syntax = 'scala' + +if main_syntax ==# 'scala' + unlet main_syntax +endif + +" vim:set sw=2 sts=2 ts=8 et: diff --git a/runtime/syntax/scheme.vim b/runtime/syntax/scheme.vim index c59e09cd17..af9a659e07 100644 --- a/runtime/syntax/scheme.vim +++ b/runtime/syntax/scheme.vim @@ -14,11 +14,8 @@ " Initializing: -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -64,11 +61,7 @@ syn region schemeUnquote matchgroup=Delimiter start=",@#\[" end="\]" contains=AL " R5RS Scheme Functions and Syntax: -if version < 600 - set iskeyword=33,35-39,42-58,60-90,94,95,97-122,126,_ -else - setlocal iskeyword=33,35-39,42-58,60-90,94,95,97-122,126,_ -endif +setlocal iskeyword=33,35-39,42-58,60-90,94,95,97-122,126,_ syn keyword schemeSyntax lambda and or if cond case define let let* letrec syn keyword schemeSyntax begin do delay set! else => @@ -306,38 +299,28 @@ syn sync match matchPlace grouphere NONE "^[^ \t]" " ... i.e. synchronize on a line that starts at the left margin " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_scheme_syntax_inits") - if version < 508 - let did_scheme_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink schemeSyntax Statement - HiLink schemeFunc Function +hi def link schemeSyntax Statement +hi def link schemeFunc Function - HiLink schemeString String - HiLink schemeCharacter Character - HiLink schemeNumber Number - HiLink schemeBoolean Boolean +hi def link schemeString String +hi def link schemeCharacter Character +hi def link schemeNumber Number +hi def link schemeBoolean Boolean - HiLink schemeDelimiter Delimiter - HiLink schemeConstant Constant +hi def link schemeDelimiter Delimiter +hi def link schemeConstant Constant - HiLink schemeComment Comment - HiLink schemeMultilineComment Comment - HiLink schemeError Error +hi def link schemeComment Comment +hi def link schemeMultilineComment Comment +hi def link schemeError Error - HiLink schemeExtSyntax Type - HiLink schemeExtFunc PreProc +hi def link schemeExtSyntax Type +hi def link schemeExtFunc PreProc - HiLink schemeLang PreProc +hi def link schemeLang PreProc - delcommand HiLink -endif let b:current_syntax = "scheme" diff --git a/runtime/syntax/scilab.vim b/runtime/syntax/scilab.vim index 1bfc003678..03e123b058 100644 --- a/runtime/syntax/scilab.vim +++ b/runtime/syntax/scilab.vim @@ -9,11 +9,8 @@ " -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -66,49 +63,39 @@ syn match scilabOverload "%[A-Za-z0-9?!_#$]\+_[A-Za-z0-9?!_#$]\+" " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_scilab_syntax_inits") - if version < 508 - let did_scilab_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink scilabStatement Statement - HiLink scilabFunction Keyword - HiLink scilabPredicate Keyword - HiLink scilabKeyword Keyword - HiLink scilabDebug Debug - HiLink scilabRepeat Repeat - HiLink scilabConditional Conditional - HiLink scilabMultiplex Conditional +hi def link scilabStatement Statement +hi def link scilabFunction Keyword +hi def link scilabPredicate Keyword +hi def link scilabKeyword Keyword +hi def link scilabDebug Debug +hi def link scilabRepeat Repeat +hi def link scilabConditional Conditional +hi def link scilabMultiplex Conditional - HiLink scilabConstant Constant - HiLink scilabBoolean Boolean +hi def link scilabConstant Constant +hi def link scilabBoolean Boolean - HiLink scilabDelimiter Delimiter - HiLink scilabMlistAccess Delimiter - HiLink scilabComparison Operator - HiLink scilabLogical Operator - HiLink scilabAssignment Operator - HiLink scilabArithmetic Operator - HiLink scilabRange Operator - HiLink scilabLineContinuation Underlined - HiLink scilabTransposition Operator +hi def link scilabDelimiter Delimiter +hi def link scilabMlistAccess Delimiter +hi def link scilabComparison Operator +hi def link scilabLogical Operator +hi def link scilabAssignment Operator +hi def link scilabArithmetic Operator +hi def link scilabRange Operator +hi def link scilabLineContinuation Underlined +hi def link scilabTransposition Operator - HiLink scilabTodo Todo - HiLink scilabComment Comment +hi def link scilabTodo Todo +hi def link scilabComment Comment - HiLink scilabNumber Number - HiLink scilabString String +hi def link scilabNumber Number +hi def link scilabString String - HiLink scilabIdentifier Identifier - HiLink scilabOverload Special +hi def link scilabIdentifier Identifier +hi def link scilabOverload Special - delcommand HiLink -endif let b:current_syntax = "scilab" diff --git a/runtime/syntax/sd.vim b/runtime/syntax/sd.vim index 7fa0e04492..b497ba5eaa 100644 --- a/runtime/syntax/sd.vim +++ b/runtime/syntax/sd.vim @@ -5,9 +5,8 @@ " URL: http://netstudent.polito.it/vim_syntax/ " Last Change: 2012 Feb 03 by Thilo Six -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -51,29 +50,20 @@ syn keyword sdSpecial TRUE FALSE NULL syn keyword sdDelimiter STREAM STREAM_END syn match sdError /^search .\{257,}/ -if version >= 508 || !exists("did_config_syntax_inits") - if version < 508 - let did_config_syntax_inits = 1 - command! -nargs=+ HiLink hi link - else - command! -nargs=+ HiLink hi def link - endif - HiLink sdIP Number - HiLink sdHostname Type - HiLink sdEncoding Identifier - HiLink sdCoding Identifier - HiLink sdSource Identifier - HiLink sdComment Comment - HiLink sdIPError Error - HiLink sdError Error - HiLink sdStatement Statement - HiLink sdIPSpecial Special - HiLink sdSpecial Special - HiLink sdDelimiter Delimiter +hi def link sdIP Number +hi def link sdHostname Type +hi def link sdEncoding Identifier +hi def link sdCoding Identifier +hi def link sdSource Identifier +hi def link sdComment Comment +hi def link sdIPError Error +hi def link sdError Error +hi def link sdStatement Statement +hi def link sdIPSpecial Special +hi def link sdSpecial Special +hi def link sdDelimiter Delimiter - delcommand HiLink -endif let b:current_syntax = "sd" diff --git a/runtime/syntax/sdl.vim b/runtime/syntax/sdl.vim index b524b72266..7df38d1955 100644 --- a/runtime/syntax/sdl.vim +++ b/runtime/syntax/sdl.vim @@ -3,11 +3,8 @@ " Maintainer: Michael Piefel " Last Change: 2 May 2001 -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -129,38 +126,27 @@ syn keyword sdlType STRING OBJECT IDENTIFIER NULL syn sync ccomment sdlComment " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_sdl_syn_inits") - if version < 508 - let did_sdl_syn_inits = 1 - command -nargs=+ HiLink hi link - command -nargs=+ Hi hi - else - command -nargs=+ HiLink hi def link - command -nargs=+ Hi hi def - endif +" Only when an item doesn't have highlighting yet +command -nargs=+ Hi hi def - HiLink sdlException Label - HiLink sdlConditional sdlStatement - HiLink sdlVirtual sdlStatement - HiLink sdlExported sdlFlag - HiLink sdlCommentError sdlError - HiLink sdlOperator Operator - HiLink sdlStructure sdlType - Hi sdlStatement term=bold ctermfg=4 guifg=Blue - Hi sdlFlag term=bold ctermfg=4 guifg=Blue gui=italic - Hi sdlNewState term=italic ctermfg=2 guifg=Magenta gui=underline - Hi sdlInput term=bold guifg=Red - HiLink sdlType Type - HiLink sdlString String - HiLink sdlComment Comment - HiLink sdlSpecial Special - HiLink sdlError Error +hi def link sdlException Label +hi def link sdlConditional sdlStatement +hi def link sdlVirtual sdlStatement +hi def link sdlExported sdlFlag +hi def link sdlCommentError sdlError +hi def link sdlOperator Operator +hi def link sdlStructure sdlType +Hi sdlStatement term=bold ctermfg=4 guifg=Blue +Hi sdlFlag term=bold ctermfg=4 guifg=Blue gui=italic +Hi sdlNewState term=italic ctermfg=2 guifg=Magenta gui=underline +Hi sdlInput term=bold guifg=Red +hi def link sdlType Type +hi def link sdlString String +hi def link sdlComment Comment +hi def link sdlSpecial Special +hi def link sdlError Error - delcommand HiLink - delcommand Hi -endif +delcommand Hi let b:current_syntax = "sdl" diff --git a/runtime/syntax/sed.vim b/runtime/syntax/sed.vim index f0f80300d6..63b39db81f 100644 --- a/runtime/syntax/sed.vim +++ b/runtime/syntax/sed.vim @@ -4,11 +4,8 @@ " URL: http://folk.uio.no/hakonrk/vim/syntax/sed.vim " Last Change: 2010 May 29 -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syn clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -49,8 +46,12 @@ syn match sedReplaceMeta "&\|\\\($\|.\)" contains=sedTab contained " Metacharacters: $ * . \ ^ [ ~ " @ is used as delimiter and treated on its own below let __at = char2nr("@") -let __sed_i = char2nr(" ") " ASCII: 32 -let __sed_last = 126 +let __sed_i = char2nr(" ") " ASCII: 32, EBCDIC: 64 +if has("ebcdic") + let __sed_last = 255 +else + let __sed_last = 126 +endif let __sed_metacharacters = '$*.\^[~' while __sed_i <= __sed_last let __sed_delimiter = escape(nr2char(__sed_i), __sed_metacharacters) @@ -71,45 +72,36 @@ syn region sedReplacement64 matchgroup=Special start=+@\(\\\\\|\\@\)*+ skip=+[^\ " (y) does not allow any flags. To save memory, I ignore this problem. syn match sedST "[sy]" nextgroup=sedRegexp\d\+ -if version >= 508 || !exists("did_sed_syntax_inits") - if version < 508 - let did_sed_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - HiLink sedAddress Macro - HiLink sedACI NONE - HiLink sedBranch Label - HiLink sedComment Comment - HiLink sedDelete Function - HiLink sedError Error - HiLink sedFlag Type - HiLink sedFlagwrite Constant - HiLink sedFunction Function - HiLink sedLabel Label - HiLink sedLineCont Special - HiLink sedPutHoldspc Function - HiLink sedReplaceMeta Special - HiLink sedRegexpMeta Special - HiLink sedRW Constant - HiLink sedSemicolon Special - HiLink sedST Function - HiLink sedSpecial Special - HiLink sedWhitespace NONE - if exists("highlight_sedtabs") - HiLink sedTab Todo - endif - let __sed_i = char2nr(" ") " ASCII: 32 - while __sed_i <= __sed_last - exe "HiLink sedRegexp".__sed_i "Macro" - exe "HiLink sedReplacement".__sed_i "NONE" - let __sed_i = __sed_i + 1 - endwhile - - delcommand HiLink +hi def link sedAddress Macro +hi def link sedACI NONE +hi def link sedBranch Label +hi def link sedComment Comment +hi def link sedDelete Function +hi def link sedError Error +hi def link sedFlag Type +hi def link sedFlagwrite Constant +hi def link sedFunction Function +hi def link sedLabel Label +hi def link sedLineCont Special +hi def link sedPutHoldspc Function +hi def link sedReplaceMeta Special +hi def link sedRegexpMeta Special +hi def link sedRW Constant +hi def link sedSemicolon Special +hi def link sedST Function +hi def link sedSpecial Special +hi def link sedWhitespace NONE +if exists("highlight_sedtabs") +hi def link sedTab Todo endif +let __sed_i = char2nr(" ") " ASCII: 32, EBCDIC: 64 +while __sed_i <= __sed_last +exe "hi def link sedRegexp".__sed_i "Macro" +exe "hi def link sedReplacement".__sed_i "NONE" +let __sed_i = __sed_i + 1 +endwhile + unlet __sed_i __sed_last __sed_delimiter __sed_metacharacters diff --git a/runtime/syntax/sendpr.vim b/runtime/syntax/sendpr.vim index 6cf9395fe9..2e07802047 100644 --- a/runtime/syntax/sendpr.vim +++ b/runtime/syntax/sendpr.vim @@ -5,11 +5,8 @@ " " http://raisdorf.net/files/misc/send-pr.vim -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif diff --git a/runtime/syntax/sensors.vim b/runtime/syntax/sensors.vim index 63cececc68..f8bc4c696b 100644 --- a/runtime/syntax/sensors.vim +++ b/runtime/syntax/sensors.vim @@ -1,7 +1,7 @@ " Vim syntax file -" Language: sensors.conf(5) - libsensors configuration file -" Maintainer: Nikolai Weibull -" Latest Revision: 2006-04-19 +" Language: sensors.conf(5) - libsensors configuration file +" Previous Maintainer: Nikolai Weibull +" Latest Revision: 2006-04-19 if exists("b:current_syntax") finish diff --git a/runtime/syntax/services.vim b/runtime/syntax/services.vim index 661f57a7e8..94e39ae219 100644 --- a/runtime/syntax/services.vim +++ b/runtime/syntax/services.vim @@ -1,7 +1,7 @@ " Vim syntax file -" Language: services(5) - Internet network services list -" Maintainer: Nikolai Weibull -" Latest Revision: 2006-04-19 +" Language: services(5) - Internet network services list +" Previous Maintainer: Nikolai Weibull +" Latest Revision: 2006-04-19 if exists("b:current_syntax") finish diff --git a/runtime/syntax/setserial.vim b/runtime/syntax/setserial.vim index cdd309d7f2..967fa5f6d2 100644 --- a/runtime/syntax/setserial.vim +++ b/runtime/syntax/setserial.vim @@ -1,7 +1,7 @@ " Vim syntax file -" Language: setserial(8) configuration file -" Maintainer: Nikolai Weibull -" Latest Revision: 2006-04-19 +" Language: setserial(8) configuration file +" Previous Maintainer: Nikolai Weibull +" Latest Revision: 2006-04-19 if exists("b:current_syntax") finish diff --git a/runtime/syntax/sgml.vim b/runtime/syntax/sgml.vim index c0c3643dd2..d60040c5d9 100644 --- a/runtime/syntax/sgml.vim +++ b/runtime/syntax/sgml.vim @@ -5,11 +5,8 @@ " Filenames: *.sgml,*.sgm " $Id: sgml.vim,v 1.1 2004/06/13 17:52:57 vimboss Exp $ -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif diff --git a/runtime/syntax/sgmldecl.vim b/runtime/syntax/sgmldecl.vim index 13551b21c1..6c1cde15ae 100644 --- a/runtime/syntax/sgmldecl.vim +++ b/runtime/syntax/sgmldecl.vim @@ -5,11 +5,8 @@ " You can modify and maintain this file, in other case send comments " the maintainer email address. -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif let s:keepcpo= &cpo @@ -52,30 +49,20 @@ syn sync lines=250 " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_sgmldecl_syntax_init") - if version < 508 - let did_sgmldecl_syntax_init = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink sgmldeclDeclKeys Keyword - HiLink sgmldeclTypes Type - HiLink sgmldeclConst Constant - HiLink sgmldeclNConst Constant - HiLink sgmldeclString String - HiLink sgmldeclDeclBlock Normal - HiLink sgmldeclBool Boolean - HiLink sgmldeclSpecial Special - HiLink sgmldeclComment Comment - HiLink sgmldeclStatem Statement - HiLink sgmldeclVariables Type +hi def link sgmldeclDeclKeys Keyword +hi def link sgmldeclTypes Type +hi def link sgmldeclConst Constant +hi def link sgmldeclNConst Constant +hi def link sgmldeclString String +hi def link sgmldeclDeclBlock Normal +hi def link sgmldeclBool Boolean +hi def link sgmldeclSpecial Special +hi def link sgmldeclComment Comment +hi def link sgmldeclStatem Statement +hi def link sgmldeclVariables Type - delcommand HiLink -endif let b:current_syntax = "sgmldecl" diff --git a/runtime/syntax/sgmllnx.vim b/runtime/syntax/sgmllnx.vim index 28224f601e..ccd78f494a 100644 --- a/runtime/syntax/sgmllnx.vim +++ b/runtime/syntax/sgmllnx.vim @@ -3,11 +3,8 @@ " Maintainer: SungHyun Nam " Last Change: 2013 May 13 -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -36,31 +33,21 @@ syn region sgmllnxComment start=++ syn region sgmllnxDocType start=++ " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_sgmllnx_syn_inits") - if version < 508 - let did_sgmllnx_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink sgmllnxTag2 Function - HiLink sgmllnxTagN2 Function - HiLink sgmllnxTag Special - HiLink sgmllnxEndTag Special - HiLink sgmllnxParen Special - HiLink sgmllnxEntity Type - HiLink sgmllnxDocEnt Type - HiLink sgmllnxTagName Statement - HiLink sgmllnxComment Comment - HiLink sgmllnxSpecial Special - HiLink sgmllnxDocType PreProc - HiLink sgmllnxTagError Error +hi def link sgmllnxTag2 Function +hi def link sgmllnxTagN2 Function +hi def link sgmllnxTag Special +hi def link sgmllnxEndTag Special +hi def link sgmllnxParen Special +hi def link sgmllnxEntity Type +hi def link sgmllnxDocEnt Type +hi def link sgmllnxTagName Statement +hi def link sgmllnxComment Comment +hi def link sgmllnxSpecial Special +hi def link sgmllnxDocType PreProc +hi def link sgmllnxTagError Error - delcommand HiLink -endif let b:current_syntax = "sgmllnx" diff --git a/runtime/syntax/sh.vim b/runtime/syntax/sh.vim index 711971ea4a..838c5eb4a7 100644 --- a/runtime/syntax/sh.vim +++ b/runtime/syntax/sh.vim @@ -2,17 +2,14 @@ " Language: shell (sh) Korn shell (ksh) bash (sh) " Maintainer: Charles E. Campbell " Previous Maintainer: Lennart Schultz -" Last Change: Jun 10, 2016 -" Version: 152 +" Last Change: Oct 02, 2017 +" Version: 172 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH " For options and settings, please use: :help ft-sh-syntax " This file includes many ideas from Eric Brunet (eric.brunet@ens.fr) -" For version 5.x: Clear all syntax items {{{1 -" For version 6.x: Quit when a syntax file was already loaded -if v:version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded {{{1 +if exists("b:current_syntax") finish endif @@ -127,19 +124,19 @@ syn cluster shErrorList contains=shDoError,shIfError,shInError,shCaseError,shEsa if exists("b:is_kornshell") syn cluster ErrorList add=shDTestError endif -syn cluster shArithParenList contains=shArithmetic,shCaseEsac,shComment,shDeref,shDo,shDerefSimple,shEcho,shEscape,shNumber,shOperator,shPosnParm,shExSingleQuote,shExDoubleQuote,shRedir,shSingleQuote,shDoubleQuote,shStatement,shVariable,shAlias,shTest,shCtrlSeq,shSpecial,shParen,bashSpecialVariables,bashStatement,shIf,shFor +syn cluster shArithParenList contains=shArithmetic,shCaseEsac,shComment,shDeref,shDo,shDerefSimple,shEcho,shEscape,shNumber,shOperator,shPosnParm,shExSingleQuote,shExDoubleQuote,shHereString,shRedir,shSingleQuote,shDoubleQuote,shStatement,shVariable,shAlias,shTest,shCtrlSeq,shSpecial,shParen,bashSpecialVariables,bashStatement,shIf,shFor syn cluster shArithList contains=@shArithParenList,shParenError syn cluster shCaseEsacList contains=shCaseStart,shCase,shCaseBar,shCaseIn,shComment,shDeref,shDerefSimple,shCaseCommandSub,shCaseExSingleQuote,shCaseSingleQuote,shCaseDoubleQuote,shCtrlSeq,@shErrorList,shStringSpecial,shCaseRange -syn cluster shCaseList contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shComment,shDo,shEcho,shExpr,shFor,shHereDoc,shIf,shRedir,shSetList,shSource,shStatement,shVariable,shCtrlSeq -syn cluster shCommandSubList contains=shAlias,shArithmetic,shComment,shCmdParenRegion,shCtrlSeq,shDeref,shDerefSimple,shDoubleQuote,shEcho,shEscape,shExDoubleQuote,shExpr,shExSingleQuote,shNumber,shOperator,shOption,shPosnParm,shSingleQuote,shSpecial,shStatement,shSubSh,shTest,shVariable +syn cluster shCaseList contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shComment,shDo,shEcho,shExpr,shFor,shHereDoc,shIf,shHereString,shRedir,shSetList,shSource,shStatement,shVariable,shCtrlSeq +syn cluster shCommandSubList contains=shAlias,shArithmetic,shCmdParenRegion,shCtrlSeq,shDeref,shDerefSimple,shDoubleQuote,shEcho,shEscape,shExDoubleQuote,shExpr,shExSingleQuote,shHereDoc,shNumber,shOperator,shOption,shPosnParm,shHereString,shRedir,shSingleQuote,shSpecial,shStatement,shSubSh,shTest,shVariable syn cluster shCurlyList contains=shNumber,shComma,shDeref,shDerefSimple,shDerefSpecial syn cluster shDblQuoteList contains=shCommandSub,shDeref,shDerefSimple,shEscape,shPosnParm,shCtrlSeq,shSpecial syn cluster shDerefList contains=shDeref,shDerefSimple,shDerefVar,shDerefSpecial,shDerefWordError,shDerefPSR,shDerefPPS -syn cluster shDerefVarList contains=shDerefOp,shDerefVarArray,shDerefOpError +syn cluster shDerefVarList contains=shDerefOff,shDerefOp,shDerefVarArray,shDerefOpError syn cluster shEchoList contains=shArithmetic,shCommandSub,shDeref,shDerefSimple,shEscape,shExpr,shExSingleQuote,shExDoubleQuote,shSingleQuote,shDoubleQuote,shCtrlSeq,shEchoQuote syn cluster shExprList1 contains=shCharClass,shNumber,shOperator,shExSingleQuote,shExDoubleQuote,shSingleQuote,shDoubleQuote,shExpr,shDblBrace,shDeref,shDerefSimple,shCtrlSeq syn cluster shExprList2 contains=@shExprList1,@shCaseList,shTest -syn cluster shFunctionList contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shComment,shDo,shEcho,shExpr,shFor,shHereDoc,shIf,shOption,shRedir,shSetList,shSource,shStatement,shVariable,shOperator,shCtrlSeq +syn cluster shFunctionList contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shComment,shDo,shEcho,shExpr,shFor,shHereDoc,shIf,shOption,shHereString,shRedir,shSetList,shSource,shStatement,shVariable,shOperator,shCtrlSeq if exists("b:is_kornshell") || exists("b:is_bash") syn cluster shFunctionList add=shRepeat syn cluster shFunctionList add=shDblBrace,shDblParen @@ -147,12 +144,13 @@ endif syn cluster shHereBeginList contains=@shCommandSubList syn cluster shHereList contains=shBeginHere,shHerePayload syn cluster shHereListDQ contains=shBeginHere,@shDblQuoteList,shHerePayload -syn cluster shIdList contains=shCommandSub,shWrapLineOperator,shSetOption,shDeref,shDerefSimple,shRedir,shExSingleQuote,shExDoubleQuote,shSingleQuote,shDoubleQuote,shExpr,shCtrlSeq,shStringSpecial,shAtExpr +syn cluster shIdList contains=shCommandSub,shWrapLineOperator,shSetOption,shDeref,shDerefSimple,shHereString,shRedir,shExSingleQuote,shExDoubleQuote,shSingleQuote,shDoubleQuote,shExpr,shCtrlSeq,shStringSpecial,shAtExpr syn cluster shIfList contains=@shLoopList,shDblBrace,shDblParen,shFunctionKey,shFunctionOne,shFunctionTwo syn cluster shLoopList contains=@shCaseList,@shErrorList,shCaseEsac,shConditional,shDblBrace,shExpr,shFor,shForPP,shIf,shOption,shSet,shTest,shTestOpr,shTouch syn cluster shPPSRightList contains=shComment,shDeref,shDerefSimple,shEscape,shPosnParm -syn cluster shSubShList contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shComment,shDo,shEcho,shExpr,shFor,shIf,shRedir,shSetList,shSource,shStatement,shVariable,shCtrlSeq,shOperator +syn cluster shSubShList contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shComment,shDo,shEcho,shExpr,shFor,shIf,shHereString,shRedir,shSetList,shSource,shStatement,shVariable,shCtrlSeq,shOperator syn cluster shTestList contains=shCharClass,shCommandSub,shCtrlSeq,shDeref,shDerefSimple,shDoubleQuote,shExDoubleQuote,shExpr,shExSingleQuote,shNumber,shOperator,shSingleQuote,shTest,shTestOpr +syn cluster shNoZSList contains=shSpecialNoZS " Echo: {{{1 " ==== @@ -173,7 +171,7 @@ if exists("b:is_kornshell") || exists("b:is_bash") " Touch: {{{1 " ===== - syn match shTouch '\[^;#]*' skipwhite nextgroup=shComment contains=shTouchCmd + syn match shTouch '\[^;#]*' skipwhite nextgroup=shComment contains=shTouchCmd,shDoubleQuote,shSingleQuote,shDeref,shDerefSimple syn match shTouchCmd '\' contained endif @@ -216,20 +214,20 @@ syn match shPattern "\<\S\+\())\)\@=" contained contains=shExSingleQuote,shSin " Subshells: {{{1 " ========== -syn region shExpr transparent matchgroup=shExprRegion start="{" end="}" contains=@shExprList2 nextgroup=shMoreSpecial -syn region shSubSh transparent matchgroup=shSubShRegion start="[^(]\zs(" end=")" contains=@shSubShList nextgroup=shMoreSpecial +syn region shExpr transparent matchgroup=shExprRegion start="{" end="}" contains=@shExprList2 nextgroup=shSpecialNxt +syn region shSubSh transparent matchgroup=shSubShRegion start="[^(]\zs(" end=")" contains=@shSubShList nextgroup=shSpecialNxt " Tests: {{{1 "======= syn region shExpr matchgroup=shRange start="\[" skip=+\\\\\|\\$\|\[+ end="\]" contains=@shTestList,shSpecial syn region shTest transparent matchgroup=shStatement start="\#\=" -syn match shNumber "-\=\.\=\d\+\>#\=" +syn match shNumber "\<-\=\.\=\d\+\>#\=" syn match shCtrlSeq "\\\d\d\d\|\\[abcfnrtv0]" contained if exists("b:is_bash") syn match shSpecial "[^\\]\(\\\\\)*\zs\\\o\o\o\|\\x\x\x\|\\c[^"]\|\\[abefnrtv]" contained syn match shSpecial "^\(\\\\\)*\zs\\\o\o\o\|\\x\x\x\|\\c[^"]\|\\[abefnrtv]" contained endif if exists("b:is_bash") - syn region shExSingleQuote matchgroup=shQuote start=+\$'+ skip=+\\\\\|\\.+ end=+'+ contains=shStringSpecial,shSpecial - syn region shExDoubleQuote matchgroup=shQuote start=+\$"+ skip=+\\\\\|\\.\|\\"+ end=+"+ contains=@shDblQuoteList,shStringSpecial,shSpecial + syn region shExSingleQuote matchgroup=shQuote start=+\$'+ skip=+\\\\\|\\.+ end=+'+ contains=shStringSpecial,shSpecial nextgroup=shSpecialNxt + syn region shExDoubleQuote matchgroup=shQuote start=+\$"+ skip=+\\\\\|\\.\|\\"+ end=+"+ contains=@shDblQuoteList,shStringSpecial,shSpecial nextgroup=shSpecialNxt elseif !exists("g:sh_no_error") syn region shExSingleQuote matchGroup=Error start=+\$'+ skip=+\\\\\|\\.+ end=+'+ contains=shStringSpecial syn region shExDoubleQuote matchGroup=Error start=+\$"+ skip=+\\\\\|\\.+ end=+"+ contains=shStringSpecial @@ -349,16 +351,21 @@ syn region shSingleQuote matchgroup=shQuote start=+'+ end=+'+ contains=@Spell syn region shDoubleQuote matchgroup=shQuote start=+\%(\%(\\\\\)*\\\)\@" +else + syn keyword shTodo contained COMBAK FIXME TODO XXX +endif syn match shComment "^\s*\zs#.*$" contains=@shCommentGroup syn match shComment "\s\zs#.*$" contains=@shCommentGroup syn match shComment contained "#.*$" contains=@shCommentGroup @@ -366,27 +373,27 @@ syn match shQuickComment contained "#.*$" " Here Documents: {{{1 " ========================================= -ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc01 start="<<\s*\\\=\z([^ \t|]\+\)" matchgroup=shHereDoc01 end="^\z1\s*$" contains=@shDblQuoteList -ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc02 start="<<\s*\"\z([^ \t|]\+\)\"" matchgroup=shHereDoc02 end="^\z1\s*$" -ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc03 start="<<-\s*\z([^ \t|]\+\)" matchgroup=shHereDoc03 end="^\s*\z1\s*$" contains=@shDblQuoteList -ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc04 start="<<-\s*'\z([^ \t|]\+\)'" matchgroup=shHereDoc04 end="^\s*\z1\s*$" -ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc05 start="<<\s*'\z([^ \t|]\+\)'" matchgroup=shHereDoc05 end="^\z1\s*$" -ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc06 start="<<-\s*\"\z([^ \t|]\+\)\"" matchgroup=shHereDoc06 end="^\s*\z1\s*$" -ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc07 start="<<\s*\\\_$\_s*\z([^ \t|]\+\)" matchgroup=shHereDoc07 end="^\z1\s*$" contains=@shDblQuoteList -ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc08 start="<<\s*\\\_$\_s*'\z([^ \t|]\+\)'" matchgroup=shHereDoc08 end="^\z1\s*$" -ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc09 start="<<\s*\\\_$\_s*\"\z([^ \t|]\+\)\"" matchgroup=shHereDoc09 end="^\z1\s*$" -ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc10 start="<<-\s*\\\_$\_s*\z([^ \t|]\+\)" matchgroup=shHereDoc10 end="^\s*\z1\s*$" -ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc11 start="<<-\s*\\\_$\_s*\\\z([^ \t|]\+\)" matchgroup=shHereDoc11 end="^\s*\z1\s*$" -ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc12 start="<<-\s*\\\_$\_s*'\z([^ \t|]\+\)'" matchgroup=shHereDoc12 end="^\s*\z1\s*$" -ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc13 start="<<-\s*\\\_$\_s*\"\z([^ \t|]\+\)\"" matchgroup=shHereDoc13 end="^\s*\z1\s*$" -ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc14 start="<<\\\z([^ \t|]\+\)" matchgroup=shHereDoc14 end="^\z1\s*$" -ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc15 start="<<-\s*\\\z([^ \t|]\+\)" matchgroup=shHereDoc15 end="^\s*\z1\s*$" +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc01 start="<<\s*\\\=\z([^ \t|>]\+\)" matchgroup=shHereDoc01 end="^\z1\s*$" contains=@shDblQuoteList +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc02 start="<<\s*\"\z([^ \t|>]\+\)\"" matchgroup=shHereDoc02 end="^\z1\s*$" +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc03 start="<<-\s*\z([^ \t|>]\+\)" matchgroup=shHereDoc03 end="^\s*\z1\s*$" contains=@shDblQuoteList +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc04 start="<<-\s*'\z([^']\+\)'" matchgroup=shHereDoc04 end="^\s*\z1\s*$" +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc05 start="<<\s*'\z([^']\+\)'" matchgroup=shHereDoc05 end="^\z1\s*$" +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc06 start="<<-\s*\"\z([^ \t|>]\+\)\"" matchgroup=shHereDoc06 end="^\s*\z1\s*$" +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc07 start="<<\s*\\\_$\_s*\z([^ \t|>]\+\)" matchgroup=shHereDoc07 end="^\z1\s*$" contains=@shDblQuoteList +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc08 start="<<\s*\\\_$\_s*'\z([^ \t|>]\+\)'" matchgroup=shHereDoc08 end="^\z1\s*$" +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc09 start="<<\s*\\\_$\_s*\"\z([^ \t|>]\+\)\"" matchgroup=shHereDoc09 end="^\z1\s*$" +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc10 start="<<-\s*\\\_$\_s*\z([^ \t|>]\+\)" matchgroup=shHereDoc10 end="^\s*\z1\s*$" +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc11 start="<<-\s*\\\_$\_s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc11 end="^\s*\z1\s*$" +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc12 start="<<-\s*\\\_$\_s*'\z([^ \t|>]\+\)'" matchgroup=shHereDoc12 end="^\s*\z1\s*$" +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc13 start="<<-\s*\\\_$\_s*\"\z([^ \t|>]\+\)\"" matchgroup=shHereDoc13 end="^\s*\z1\s*$" +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc14 start="<<\\\z([^ \t|>]\+\)" matchgroup=shHereDoc14 end="^\z1\s*$" +ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc15 start="<<-\s*\\\z([^ \t|>]\+\)" matchgroup=shHereDoc15 end="^\s*\z1\s*$" " Here Strings: {{{1 " ============= " available for: bash; ksh (really should be ksh93 only) but not if its a posix -if exists("b:is_bash") || (exists("b:is_kornshell") && !exists("g:is_posix")) - syn match shRedir "<<<" skipwhite nextgroup=shCmdParenRegion +if exists("b:is_bash") || (exists("b:is_kornshell") && !exists("b:is_posix")) + syn match shHereString "<<<" skipwhite nextgroup=shCmdParenRegion endif " Identifiers: {{{1 @@ -406,7 +413,7 @@ else endif " Functions: {{{1 -if !exists("g:is_posix") +if !exists("b:is_posix") syn keyword shFunctionKey function skipwhite skipnl nextgroup=shFunctionTwo endif @@ -427,13 +434,14 @@ endif if !exists("g:sh_no_error") syn match shDerefWordError "[^}$[~]" contained endif -syn match shDerefSimple "\$\%(\k\+\|\d\)" +syn match shDerefSimple "\$\%(\h\w*\|\d\)" nextgroup=@shNoZSList syn region shDeref matchgroup=PreProc start="\${" end="}" contains=@shDerefList,shDerefVarArray -syn match shDerefSimple "\$[-#*@!?]" -syn match shDerefSimple "\$\$" +syn match shDerefSimple "\$[-#*@!?]" nextgroup=@shNoZSList +syn match shDerefSimple "\$\$" nextgroup=@shNoZSList +syn match shDerefSimple "\${\d}" nextgroup=@shNoZSList if exists("b:is_bash") || exists("b:is_kornshell") - syn region shDeref matchgroup=PreProc start="\${##\=" end="}" contains=@shDerefList - syn region shDeref matchgroup=PreProc start="\${\$\$" end="}" contains=@shDerefList + syn region shDeref matchgroup=PreProc start="\${##\=" end="}" contains=@shDerefList nextgroup=@shSpecialNoZS + syn region shDeref matchgroup=PreProc start="\${\$\$" end="}" contains=@shDerefList nextgroup=@shSpecialNoZS endif " ksh: ${!var[*]} array index list syntax: {{{1 @@ -445,18 +453,19 @@ endif " bash: ${!prefix*} and ${#parameter}: {{{1 " ==================================== if exists("b:is_bash") - syn region shDeref matchgroup=PreProc start="\${!" end="\*\=}" contains=@shDerefList,shDerefOp - syn match shDerefVar contained "{\@<=!\k\+" nextgroup=@shDerefVarList + syn region shDeref matchgroup=PreProc start="\${!" end="\*\=}" contains=@shDerefList,shDerefOff + syn match shDerefVar contained "{\@<=!\h\w*" nextgroup=@shDerefVarList endif if exists("b:is_kornshell") - syn match shDerefVar contained "{\@<=!\k[[:alnum:]_.]*" nextgroup=@shDerefVarList + syn match shDerefVar contained "{\@<=!\h\w*[[:alnum:]_.]*" nextgroup=@shDerefVarList endif syn match shDerefSpecial contained "{\@<=[-*@?0]" nextgroup=shDerefOp,shDerefOpError syn match shDerefSpecial contained "\({[#!]\)\@<=[[:alnum:]*@_]\+" nextgroup=@shDerefVarList,shDerefOp -syn match shDerefVar contained "{\@<=\k\+" nextgroup=@shDerefVarList +syn match shDerefVar contained "{\@<=\h\w*" nextgroup=@shDerefVarList +syn match shDerefVar contained '\d' nextgroup=@shDerefVarList if exists("b:is_kornshell") - syn match shDerefVar contained "{\@<=\k[[:alnum:]_.]*" nextgroup=@shDerefVarList + syn match shDerefVar contained "{\@<=\h\w*[[:alnum:]_.]*" nextgroup=@shDerefVarList endif " sh ksh bash : ${var[... ]...} array reference: {{{1 @@ -482,24 +491,25 @@ endif syn match shDerefOp contained ":\=[-=?]" nextgroup=@shDerefPatternList syn match shDerefOp contained ":\=+" nextgroup=@shDerefPatternList if exists("b:is_bash") || exists("b:is_kornshell") - syn match shDerefOp contained "#\{1,2}" nextgroup=@shDerefPatternList - syn match shDerefOp contained "%\{1,2}" nextgroup=@shDerefPatternList - syn match shDerefPattern contained "[^{}]\+" contains=shDeref,shDerefSimple,shDerefPattern,shDerefString,shCommandSub,shDerefEscape nextgroup=shDerefPattern + syn match shDerefOp contained "#\{1,2}" nextgroup=@shDerefPatternList + syn match shDerefOp contained "%\{1,2}" nextgroup=@shDerefPatternList + syn match shDerefPattern contained "[^{}]\+" contains=shDeref,shDerefSimple,shDerefPattern,shDerefString,shCommandSub,shDerefEscape nextgroup=shDerefPattern syn region shDerefPattern contained start="{" end="}" contains=shDeref,shDerefSimple,shDerefString,shCommandSub nextgroup=shDerefPattern syn match shDerefEscape contained '\%(\\\\\)*\\.' endif if exists("b:is_bash") syn match shDerefOp contained "[,^]\{1,2}" nextgroup=@shDerefPatternList endif -syn region shDerefString contained matchgroup=shDerefDelim start=+\%(\\\)\@" " Default Highlighting: {{{1 " ===================== -hi def link shArithRegion shShellVariables -hi def link shAstQuote shDoubleQuote -hi def link shAtExpr shSetList -hi def link shBeginHere shRedir -hi def link shCaseBar shConditional -hi def link shCaseCommandSub shCommandSub -hi def link shCaseDoubleQuote shDoubleQuote -hi def link shCaseIn shConditional -hi def link shQuote shOperator -hi def link shCaseSingleQuote shSingleQuote -hi def link shCaseStart shConditional -hi def link shCmdSubRegion shShellVariables -hi def link shColon shComment -hi def link shDerefOp shOperator -hi def link shDerefPOL shDerefOp -hi def link shDerefPPS shDerefOp -hi def link shDerefPSR shDerefOp -hi def link shDeref shShellVariables -hi def link shDerefDelim shOperator -hi def link shDerefSimple shDeref -hi def link shDerefSpecial shDeref -hi def link shDerefString shDoubleQuote -hi def link shDerefVar shDeref -hi def link shDoubleQuote shString -hi def link shEcho shString -hi def link shEchoDelim shOperator -hi def link shEchoQuote shString -hi def link shForPP shLoop -hi def link shEmbeddedEcho shString -hi def link shEscape shCommandSub -hi def link shExDoubleQuote shDoubleQuote -hi def link shExSingleQuote shSingleQuote -hi def link shHereDoc shString -hi def link shHerePayload shHereDoc -hi def link shLoop shStatement -hi def link shMoreSpecial shSpecial -hi def link shNoQuote shDoubleQuote -hi def link shOption shCommandSub -hi def link shPattern shString -hi def link shParen shArithmetic -hi def link shPosnParm shShellVariables -hi def link shQuickComment shComment -hi def link shRange shOperator -hi def link shRedir shOperator -hi def link shSetListDelim shOperator -hi def link shSetOption shOption -hi def link shSingleQuote shString -hi def link shSource shOperator -hi def link shStringSpecial shSpecial -hi def link shSubShRegion shOperator -hi def link shTestOpr shConditional -hi def link shTestPattern shString -hi def link shTestDoubleQuote shString -hi def link shTestSingleQuote shString -hi def link shTouchCmd shStatement -hi def link shVariable shSetList -hi def link shWrapLineOperator shOperator +if !exists("skip_sh_syntax_inits") + hi def link shArithRegion shShellVariables + hi def link shAstQuote shDoubleQuote + hi def link shAtExpr shSetList + hi def link shBeginHere shRedir + hi def link shCaseBar shConditional + hi def link shCaseCommandSub shCommandSub + hi def link shCaseDoubleQuote shDoubleQuote + hi def link shCaseIn shConditional + hi def link shQuote shOperator + hi def link shCaseSingleQuote shSingleQuote + hi def link shCaseStart shConditional + hi def link shCmdSubRegion shShellVariables + hi def link shColon shComment + hi def link shDerefOp shOperator + hi def link shDerefPOL shDerefOp + hi def link shDerefPPS shDerefOp + hi def link shDerefPSR shDerefOp + hi def link shDeref shShellVariables + hi def link shDerefDelim shOperator + hi def link shDerefSimple shDeref + hi def link shDerefSpecial shDeref + hi def link shDerefString shDoubleQuote + hi def link shDerefVar shDeref + hi def link shDoubleQuote shString + hi def link shEcho shString + hi def link shEchoDelim shOperator + hi def link shEchoQuote shString + hi def link shForPP shLoop + hi def link shFunction Function + hi def link shEmbeddedEcho shString + hi def link shEscape shCommandSub + hi def link shExDoubleQuote shDoubleQuote + hi def link shExSingleQuote shSingleQuote + hi def link shHereDoc shString + hi def link shHereString shRedir + hi def link shHerePayload shHereDoc + hi def link shLoop shStatement + hi def link shSpecialNxt shSpecial + hi def link shNoQuote shDoubleQuote + hi def link shOption shCommandSub + hi def link shPattern shString + hi def link shParen shArithmetic + hi def link shPosnParm shShellVariables + hi def link shQuickComment shComment + hi def link shRange shOperator + hi def link shRedir shOperator + hi def link shSetListDelim shOperator + hi def link shSetOption shOption + hi def link shSingleQuote shString + hi def link shSource shOperator + hi def link shStringSpecial shSpecial + hi def link shSubShRegion shOperator + hi def link shTestOpr shConditional + hi def link shTestPattern shString + hi def link shTestDoubleQuote shString + hi def link shTestSingleQuote shString + hi def link shTouchCmd shStatement + hi def link shVariable shSetList + hi def link shWrapLineOperator shOperator -if exists("b:is_bash") - hi def link bashAdminStatement shStatement - hi def link bashSpecialVariables shShellVariables - hi def link bashStatement shStatement - hi def link shCharClass shSpecial -endif -if exists("b:is_kornshell") - hi def link kshSpecialVariables shShellVariables - hi def link kshStatement shStatement -endif - -if !exists("g:sh_no_error") - hi def link shCaseError Error - hi def link shCondError Error - hi def link shCurlyError Error - hi def link shDerefOpError Error - hi def link shDerefWordError Error - hi def link shDoError Error - hi def link shEsacError Error - hi def link shIfError Error - hi def link shInError Error - hi def link shParenError Error - hi def link shTestError Error - if exists("b:is_kornshell") - hi def link shDTestError Error + if exists("b:is_bash") + hi def link bashAdminStatement shStatement + hi def link bashSpecialVariables shShellVariables + hi def link bashStatement shStatement + hi def link shCharClass shSpecial + hi def link shDerefOff shDerefOp + hi def link shDerefLen shDerefOff + endif + if exists("b:is_kornshell") + hi def link kshSpecialVariables shShellVariables + hi def link kshStatement shStatement endif -endif -hi def link shArithmetic Special -hi def link shCharClass Identifier -hi def link shSnglCase Statement -hi def link shCommandSub Special -hi def link shComment Comment -hi def link shConditional Conditional -hi def link shCtrlSeq Special -hi def link shExprRegion Delimiter -hi def link shFunctionKey Function -hi def link shFunctionName Function -hi def link shNumber Number -hi def link shOperator Operator -hi def link shRepeat Repeat -hi def link shSet Statement -hi def link shSetList Identifier -hi def link shShellVariables PreProc -hi def link shSpecial Special -hi def link shStatement Statement -hi def link shString String -hi def link shTodo Todo -hi def link shAlias Identifier -hi def link shHereDoc01 shRedir -hi def link shHereDoc02 shRedir -hi def link shHereDoc03 shRedir -hi def link shHereDoc04 shRedir -hi def link shHereDoc05 shRedir -hi def link shHereDoc06 shRedir -hi def link shHereDoc07 shRedir -hi def link shHereDoc08 shRedir -hi def link shHereDoc09 shRedir -hi def link shHereDoc10 shRedir -hi def link shHereDoc11 shRedir -hi def link shHereDoc12 shRedir -hi def link shHereDoc13 shRedir -hi def link shHereDoc14 shRedir -hi def link shHereDoc15 shRedir + if !exists("g:sh_no_error") + hi def link shCaseError Error + hi def link shCondError Error + hi def link shCurlyError Error + hi def link shDerefOpError Error + hi def link shDerefWordError Error + hi def link shDoError Error + hi def link shEsacError Error + hi def link shIfError Error + hi def link shInError Error + hi def link shParenError Error + hi def link shTestError Error + if exists("b:is_kornshell") + hi def link shDTestError Error + endif + endif + + hi def link shArithmetic Special + hi def link shCharClass Identifier + hi def link shSnglCase Statement + hi def link shCommandSub Special + hi def link shComment Comment + hi def link shConditional Conditional + hi def link shCtrlSeq Special + hi def link shExprRegion Delimiter + hi def link shFunctionKey Function + hi def link shFunctionName Function + hi def link shNumber Number + hi def link shOperator Operator + hi def link shRepeat Repeat + hi def link shSet Statement + hi def link shSetList Identifier + hi def link shShellVariables PreProc + hi def link shSpecial Special + hi def link shSpecialNoZS shSpecial + hi def link shStatement Statement + hi def link shString String + hi def link shTodo Todo + hi def link shAlias Identifier + hi def link shHereDoc01 shRedir + hi def link shHereDoc02 shRedir + hi def link shHereDoc03 shRedir + hi def link shHereDoc04 shRedir + hi def link shHereDoc05 shRedir + hi def link shHereDoc06 shRedir + hi def link shHereDoc07 shRedir + hi def link shHereDoc08 shRedir + hi def link shHereDoc09 shRedir + hi def link shHereDoc10 shRedir + hi def link shHereDoc11 shRedir + hi def link shHereDoc12 shRedir + hi def link shHereDoc13 shRedir + hi def link shHereDoc14 shRedir + hi def link shHereDoc15 shRedir +endif " Delete shell folding commands {{{1 " ============================= diff --git a/runtime/syntax/sicad.vim b/runtime/syntax/sicad.vim index 7e32451bed..20eb14cba1 100644 --- a/runtime/syntax/sicad.vim +++ b/runtime/syntax/sicad.vim @@ -4,28 +4,17 @@ " Last Change: 2003 May 11 " URL: http://lmark.mgx.hu:81/download/vim/sicad.vim -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif " use SQL highlighting after 'sql' command -if version >= 600 - syn include @SQL syntax/sql.vim -else - syn include @SQL :p:h/sql.vim -endif +syn include @SQL syntax/sql.vim unlet b:current_syntax " spaces are used in (auto)indents since sicad hates tabulator characters -if version >= 600 - setlocal expandtab -else - set expandtab -endif +setlocal expandtab " ignore case syn case ignore @@ -369,44 +358,32 @@ syn keyword sicadStatement zparbn zparf zparfn zparfw zparfwn syn keyword sicadStatement zparp zparpn zwinkp zwinkpn " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_sicad_syntax_inits") +" Only when an item doesn't have highlighting yet - if version < 508 - let did_sicad_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +hi def link sicadLabel PreProc +hi def link sicadLabel1 sicadLabel +hi def link sicadLabel2 sicadLabel +hi def link sicadConditional Conditional +hi def link sicadBoolean Boolean +hi def link sicadNumber Number +hi def link sicadFloat Float +hi def link sicadOperator Operator +hi def link sicadStatement Statement +hi def link sicadParameter sicadStatement +hi def link sicadGoto sicadStatement +hi def link sicadLineCont sicadStatement +hi def link sicadString String +hi def link sicadComment Comment +hi def link sicadSpecial Special +hi def link sicadIdentifier Type +" hi def link sicadIdentifier Identifier +hi def link sicadError Error +hi def link sicadParenError sicadError +hi def link sicadApostropheError sicadError +hi def link sicadStringError sicadError +hi def link sicadCommentError sicadError +" hi def link sqlStatement Special " modified highlight group in sql.vim - HiLink sicadLabel PreProc - HiLink sicadLabel1 sicadLabel - HiLink sicadLabel2 sicadLabel - HiLink sicadConditional Conditional - HiLink sicadBoolean Boolean - HiLink sicadNumber Number - HiLink sicadFloat Float - HiLink sicadOperator Operator - HiLink sicadStatement Statement - HiLink sicadParameter sicadStatement - HiLink sicadGoto sicadStatement - HiLink sicadLineCont sicadStatement - HiLink sicadString String - HiLink sicadComment Comment - HiLink sicadSpecial Special - HiLink sicadIdentifier Type -" HiLink sicadIdentifier Identifier - HiLink sicadError Error - HiLink sicadParenError sicadError - HiLink sicadApostropheError sicadError - HiLink sicadStringError sicadError - HiLink sicadCommentError sicadError -" HiLink sqlStatement Special " modified highlight group in sql.vim - - delcommand HiLink - -endif let b:current_syntax = "sicad" diff --git a/runtime/syntax/sieve.vim b/runtime/syntax/sieve.vim index 4bb4417f39..35b4dfb79c 100644 --- a/runtime/syntax/sieve.vim +++ b/runtime/syntax/sieve.vim @@ -1,7 +1,7 @@ " Vim syntax file -" Language: Sieve filtering language input file -" Maintainer: Nikolai Weibull -" Latest Revision: 2007-10-25 +" Language: Sieve filtering language input file +" Previous Maintainer: Nikolai Weibull +" Latest Revision: 2007-10-25 if exists("b:current_syntax") finish diff --git a/runtime/syntax/simula.vim b/runtime/syntax/simula.vim index e952ee26c3..82f66d049e 100644 --- a/runtime/syntax/simula.vim +++ b/runtime/syntax/simula.vim @@ -4,11 +4,8 @@ " URL: http://folk.uio.no/hakonrk/vim/syntax/simula.vim " Last Change: 2001 May 15 -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syn clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -58,42 +55,33 @@ syn match simulaReal "-\=\<\d\+\(\.\d\+\)\=\(&&\=[+-]\=\d\+\)\=\>" " Real starting with a `.', optional exponent syn match simulaReal "-\=\.\d\+\(&&\=[+-]\=\d\+\)\=\>" -if version >= 508 || !exists("did_simula_syntax_inits") - if version < 508 - let did_simula_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - HiLink simulaAssigned Identifier - HiLink simulaBoolean Boolean - HiLink simulaCharacter Character - HiLink simulaCharError Error - HiLink simulaComment Comment - HiLink simulaCompound Statement - HiLink simulaConditional Conditional - HiLink simulaConstant Constant - HiLink simulaFunction Function - HiLink simulaNumber Number - HiLink simulaOperator Operator - HiLink simulaReal Float - HiLink simulaReferenceType Type - HiLink simulaRepeat Repeat - HiLink simulaReserved Error - HiLink simulaSemicolon Statement - HiLink simulaSpecial Special - HiLink simulaSpecialChar SpecialChar - HiLink simulaSpecialCharErr Error - HiLink simulaStatement Statement - HiLink simulaStorageClass StorageClass - HiLink simulaString String - HiLink simulaStructure Structure - HiLink simulaTodo Todo - HiLink simulaType Type +hi def link simulaAssigned Identifier +hi def link simulaBoolean Boolean +hi def link simulaCharacter Character +hi def link simulaCharError Error +hi def link simulaComment Comment +hi def link simulaCompound Statement +hi def link simulaConditional Conditional +hi def link simulaConstant Constant +hi def link simulaFunction Function +hi def link simulaNumber Number +hi def link simulaOperator Operator +hi def link simulaReal Float +hi def link simulaReferenceType Type +hi def link simulaRepeat Repeat +hi def link simulaReserved Error +hi def link simulaSemicolon Statement +hi def link simulaSpecial Special +hi def link simulaSpecialChar SpecialChar +hi def link simulaSpecialCharErr Error +hi def link simulaStatement Statement +hi def link simulaStorageClass StorageClass +hi def link simulaString String +hi def link simulaStructure Structure +hi def link simulaTodo Todo +hi def link simulaType Type - delcommand HiLink -endif let b:current_syntax = "simula" " vim: sts=4 sw=4 ts=8 diff --git a/runtime/syntax/sinda.vim b/runtime/syntax/sinda.vim index 2bde267c2f..a6e5b45fcd 100644 --- a/runtime/syntax/sinda.vim +++ b/runtime/syntax/sinda.vim @@ -8,11 +8,8 @@ -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -32,11 +29,7 @@ syn case ignore let fortran_free_source=1 " Load FORTRAN syntax file -if version < 600 - source :p:h/fortran.vim -else - runtime! syntax/fortran.vim -endif +runtime! syntax/fortran.vim unlet b:current_syntax @@ -106,39 +99,29 @@ endif " Define the default highlighting -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_sinda_syntax_inits") - if version < 508 - let did_sinda_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink sindaMacro Macro - HiLink sindaOptions Special - HiLink sindaRoutine Type - HiLink sindaControl Special - HiLink sindaSubRoutine Function - HiLink sindaIdentifier Identifier +hi def link sindaMacro Macro +hi def link sindaOptions Special +hi def link sindaRoutine Type +hi def link sindaControl Special +hi def link sindaSubRoutine Function +hi def link sindaIdentifier Identifier - HiLink sindaFortran PreProc - HiLink sindaMotran PreProc +hi def link sindaFortran PreProc +hi def link sindaMotran PreProc - HiLink sindaComment Comment - HiLink sindaHeader Typedef - HiLink sindaIncludeFile Type - HiLink sindaInteger Number - HiLink sindaFloat Float - HiLink sindaScientific Float +hi def link sindaComment Comment +hi def link sindaHeader Typedef +hi def link sindaIncludeFile Type +hi def link sindaInteger Number +hi def link sindaFloat Float +hi def link sindaScientific Float - HiLink sindaEndData Macro +hi def link sindaEndData Macro - HiLink sindaTodo Todo +hi def link sindaTodo Todo - delcommand HiLink -endif let b:current_syntax = "sinda" diff --git a/runtime/syntax/sindacmp.vim b/runtime/syntax/sindacmp.vim index 87b483409a..88373eb285 100644 --- a/runtime/syntax/sindacmp.vim +++ b/runtime/syntax/sindacmp.vim @@ -8,11 +8,8 @@ -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -45,28 +42,18 @@ syn match sindacmpFloat "-\=\<[0-9]*\.[0-9]*" " Define the default highlighting -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_sindacmp_syntax_inits") - if version < 508 - let did_sindacmp_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink sindacmpTitle Type - HiLink sindacmpUnit PreProc +hi def link sindacmpTitle Type +hi def link sindacmpUnit PreProc - HiLink sindacmpLabel Statement +hi def link sindacmpLabel Statement - HiLink sindacmpHeader sindaHeader +hi def link sindacmpHeader sindaHeader - HiLink sindacmpInteger Number - HiLink sindacmpFloat Special +hi def link sindacmpInteger Number +hi def link sindacmpFloat Special - delcommand HiLink -endif let b:current_syntax = "sindacmp" diff --git a/runtime/syntax/sindaout.vim b/runtime/syntax/sindaout.vim index b557e017eb..c362f19467 100644 --- a/runtime/syntax/sindaout.vim +++ b/runtime/syntax/sindaout.vim @@ -8,11 +8,8 @@ -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -24,11 +21,7 @@ syn case match " Load SINDA syntax file -if version < 600 - source :p:h/sinda.vim -else - runtime! syntax/sinda.vim -endif +runtime! syntax/sinda.vim unlet b:current_syntax @@ -66,33 +59,23 @@ syn match sindaoutError "<<< Error >>>" " Define the default highlighting -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_sindaout_syntax_inits") - if version < 508 - let did_sindaout_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - hi sindaHeaderDelim ctermfg=Black ctermbg=Green guifg=Black guibg=Green +hi sindaHeaderDelim ctermfg=Black ctermbg=Green guifg=Black guibg=Green - HiLink sindaoutPos Statement - HiLink sindaoutNeg PreProc - HiLink sindaoutTitle Type - HiLink sindaoutFile sindaIncludeFile - HiLink sindaoutInteger sindaInteger +hi def link sindaoutPos Statement +hi def link sindaoutNeg PreProc +hi def link sindaoutTitle Type +hi def link sindaoutFile sindaIncludeFile +hi def link sindaoutInteger sindaInteger - HiLink sindaoutSectionDelim Delimiter - HiLink sindaoutSectionTitle Exception - HiLink sindaoutHeaderDelim SpecialComment - HiLink sindaoutLabel Identifier +hi def link sindaoutSectionDelim Delimiter +hi def link sindaoutSectionTitle Exception +hi def link sindaoutHeaderDelim SpecialComment +hi def link sindaoutLabel Identifier - HiLink sindaoutError Error +hi def link sindaoutError Error - delcommand HiLink -endif let b:current_syntax = "sindaout" diff --git a/runtime/syntax/sisu.vim b/runtime/syntax/sisu.vim index 0e0f2dbe0a..264aae0600 100644 --- a/runtime/syntax/sisu.vim +++ b/runtime/syntax/sisu.vim @@ -1,16 +1,14 @@ " SiSU Vim syntax file " SiSU Maintainer: Ralph Amissah " SiSU Markup: SiSU (sisu-5.6.7) -" Last Change: 2014-09-14 +" Last Change: 2017 Jun 22 " URL: " "(originally looked at Ruby Vim by Mirko Nasato) -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish -else endif let s:cpo_save = &cpo set cpo&vim @@ -104,7 +102,7 @@ syn region sisu_content_alt contains=sisu_strikeout,sisu_number,sisu_bold,sisu_c syn region sisu_content_alt contains=sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^```\s\+table" end="^```\(\s\|$\)" syn region sisu_content_alt contains=sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^{\(t\|table\)\(\~h\)\?\(\sc[0-9]\+;\)\?[0-9; ]*}" end="\n$" " block, group, poem, alt -syn region sisu_content_alt contains=sisu_mark_endnote,sisu_content_endnote,sisu_link,sisu_mark,sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^\(block\|group\|poem\|alt\){" end="^}\1" +syn region sisu_content_alt contains=sisu_mark_endnote,sisu_content_endnote,sisu_link,sisu_mark,sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^\z(block\|group\|poem\|alt\){" end="^}\z1" syn region sisu_content_alt contains=sisu_mark_endnote,sisu_content_endnote,sisu_link,sisu_mark,sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^```\s\+\(block\|group\|poem\|alt\)" end="^```\(\s\|$\)" " box syn region sisu_content_alt contains=sisu_mark_endnote,sisu_content_endnote,sisu_link,sisu_mark,sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^box\(\.[a-z]\+\)\?{" end="^}box" diff --git a/runtime/syntax/skill.vim b/runtime/syntax/skill.vim index 8b960441f6..47afffc0a9 100644 --- a/runtime/syntax/skill.vim +++ b/runtime/syntax/skill.vim @@ -9,11 +9,8 @@ " database. This file also defines syntax highlighting for " certain Design Framework II interface functions. -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -525,37 +522,27 @@ syn match skillCommentError "\*/" syn sync ccomment skillComment minlines=10 " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_skill_syntax_inits") - if version < 508 - let did_skill_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink skillcdfFunctions Function - HiLink skillgeFunctions Function - HiLink skillhiFunctions Function - HiLink skillleFunctions Function - HiLink skilldbefFunctions Function - HiLink skillddFunctions Function - HiLink skillpcFunctions Function - HiLink skilltechFunctions Function - HiLink skillConstants Constant - HiLink skillFunction Function - HiLink skillKeywords Statement - HiLink skillConditional Conditional - HiLink skillRepeat Repeat - HiLink skillString String - HiLink skillTodo Todo - HiLink skillNote Todo - HiLink skillComment Comment - HiLink skillCommentError Error +hi def link skillcdfFunctions Function +hi def link skillgeFunctions Function +hi def link skillhiFunctions Function +hi def link skillleFunctions Function +hi def link skilldbefFunctions Function +hi def link skillddFunctions Function +hi def link skillpcFunctions Function +hi def link skilltechFunctions Function +hi def link skillConstants Constant +hi def link skillFunction Function +hi def link skillKeywords Statement +hi def link skillConditional Conditional +hi def link skillRepeat Repeat +hi def link skillString String +hi def link skillTodo Todo +hi def link skillNote Todo +hi def link skillComment Comment +hi def link skillCommentError Error - delcommand HiLink -endif let b:current_syntax = "skill" diff --git a/runtime/syntax/sl.vim b/runtime/syntax/sl.vim index fa3bca06dd..1f6c847353 100644 --- a/runtime/syntax/sl.vim +++ b/runtime/syntax/sl.vim @@ -3,11 +3,8 @@ " Maintainer: Dan Piponi " Last Change: 2001 May 09 -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -75,45 +72,35 @@ syn keyword slVariable dtime dPdtime syn sync ccomment slComment minlines=10 " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_sl_syntax_inits") - if version < 508 - let did_sl_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink slLabel Label - HiLink slUserLabel Label - HiLink slConditional Conditional - HiLink slRepeat Repeat - HiLink slCharacter Character - HiLink slSpecialCharacter slSpecial - HiLink slNumber Number - HiLink slFloat Float - HiLink slParenError slError - HiLink slInParen slError - HiLink slCommentError slError - HiLink slOperator Operator - HiLink slStorageClass StorageClass - HiLink slError Error - HiLink slStatement Statement - HiLink slType Type - HiLink slCommentError slError - HiLink slCommentString slString - HiLink slComment2String slString - HiLink slCommentSkip slComment - HiLink slString String - HiLink slComment Comment - HiLink slSpecial SpecialChar - HiLink slTodo Todo - HiLink slVariable Identifier - "HiLink slIdentifier Identifier +hi def link slLabel Label +hi def link slUserLabel Label +hi def link slConditional Conditional +hi def link slRepeat Repeat +hi def link slCharacter Character +hi def link slSpecialCharacter slSpecial +hi def link slNumber Number +hi def link slFloat Float +hi def link slParenError slError +hi def link slInParen slError +hi def link slCommentError slError +hi def link slOperator Operator +hi def link slStorageClass StorageClass +hi def link slError Error +hi def link slStatement Statement +hi def link slType Type +hi def link slCommentError slError +hi def link slCommentString slString +hi def link slComment2String slString +hi def link slCommentSkip slComment +hi def link slString String +hi def link slComment Comment +hi def link slSpecial SpecialChar +hi def link slTodo Todo +hi def link slVariable Identifier +"hi def link slIdentifier Identifier - delcommand HiLink -endif let b:current_syntax = "sl" diff --git a/runtime/syntax/slang.vim b/runtime/syntax/slang.vim index 9fa89b4d61..53ede4dc5a 100644 --- a/runtime/syntax/slang.vim +++ b/runtime/syntax/slang.vim @@ -3,11 +3,8 @@ " Maintainer: Jan Hlavacek " Last Change: 980216 -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -55,47 +52,37 @@ syn keyword slangOperator sizeof syn region slangPreCondit start="^\s*#\s*\(ifdef\>\|ifndef\>\|iftrue\>\|ifnfalse\>\|iffalse\>\|ifntrue\>\|if\$\|ifn\$\|\|elif\>\|else\>\|endif\>\)" skip="\\$" end="$" contains=cComment,slangString,slangCharacter,slangNumber " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_slang_syntax_inits") - if version < 508 - let did_slang_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink slangDefinition Type - HiLink slangBlock slangDefinition - HiLink slangLabel Label - HiLink slangConditional Conditional - HiLink slangRepeat Repeat - HiLink slangCharacter Character - HiLink slangFloat Float - HiLink slangImaginary Float - HiLink slangDecimal slangNumber - HiLink slangOctal slangNumber - HiLink slangHex slangNumber - HiLink slangNumber Number - HiLink slangParenError Error - HiLink slangOctalError Error - HiLink slangOperator Operator - HiLink slangStructure Structure - HiLink slangInclude Include - HiLink slangPreCondit PreCondit - HiLink slangError Error - HiLink slangStatement Statement - HiLink slangType Type - HiLink slangString String - HiLink slangConstant Constant - HiLink slangRangeArray slangConstant - HiLink slangComment Comment - HiLink slangSpecial SpecialChar - HiLink slangTodo Todo - HiLink slangDelim Delimiter +hi def link slangDefinition Type +hi def link slangBlock slangDefinition +hi def link slangLabel Label +hi def link slangConditional Conditional +hi def link slangRepeat Repeat +hi def link slangCharacter Character +hi def link slangFloat Float +hi def link slangImaginary Float +hi def link slangDecimal slangNumber +hi def link slangOctal slangNumber +hi def link slangHex slangNumber +hi def link slangNumber Number +hi def link slangParenError Error +hi def link slangOctalError Error +hi def link slangOperator Operator +hi def link slangStructure Structure +hi def link slangInclude Include +hi def link slangPreCondit PreCondit +hi def link slangError Error +hi def link slangStatement Statement +hi def link slangType Type +hi def link slangString String +hi def link slangConstant Constant +hi def link slangRangeArray slangConstant +hi def link slangComment Comment +hi def link slangSpecial SpecialChar +hi def link slangTodo Todo +hi def link slangDelim Delimiter - delcommand HiLink -endif let b:current_syntax = "slang" diff --git a/runtime/syntax/slice.vim b/runtime/syntax/slice.vim index 4e2f9a8604..3a57ece913 100644 --- a/runtime/syntax/slice.vim +++ b/runtime/syntax/slice.vim @@ -3,11 +3,8 @@ " Maintainer: Morel Bodin " Last Change: 2005 Dec 03 -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -58,33 +55,23 @@ syn match sliceComment "//.*" syn sync ccomment sliceComment " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_slice_syn_inits") - if version < 508 - let did_slice_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink sliceComment Comment - HiLink sliceConstruct Keyword - HiLink sliceType Type - HiLink sliceString String - HiLink sliceIncluded String - HiLink sliceQualifier Keyword - HiLink sliceInclude Include - HiLink sliceGuard PreProc - HiLink sliceBoolean Boolean - HiLink sliceFloat Number - HiLink sliceNumber Number - HiLink sliceOctal Number - HiLink sliceOctalZero Special - HiLink sliceNumberError Special +hi def link sliceComment Comment +hi def link sliceConstruct Keyword +hi def link sliceType Type +hi def link sliceString String +hi def link sliceIncluded String +hi def link sliceQualifier Keyword +hi def link sliceInclude Include +hi def link sliceGuard PreProc +hi def link sliceBoolean Boolean +hi def link sliceFloat Number +hi def link sliceNumber Number +hi def link sliceOctal Number +hi def link sliceOctalZero Special +hi def link sliceNumberError Special - delcommand HiLink -endif let b:current_syntax = "slice" diff --git a/runtime/syntax/slpconf.vim b/runtime/syntax/slpconf.vim index 9fe4503780..712ba90719 100644 --- a/runtime/syntax/slpconf.vim +++ b/runtime/syntax/slpconf.vim @@ -1,7 +1,7 @@ " Vim syntax file -" Language: RFC 2614 - An API for Service Location configuration file -" Maintainer: Nikolai Weibull -" Latest Revision: 2006-04-19 +" Language: RFC 2614 - An API for Service Location configuration file +" Previous Maintainer: Nikolai Weibull +" Latest Revision: 2006-04-19 if exists("b:current_syntax") finish diff --git a/runtime/syntax/slpreg.vim b/runtime/syntax/slpreg.vim index f3c8a7fc8e..a177b063f0 100644 --- a/runtime/syntax/slpreg.vim +++ b/runtime/syntax/slpreg.vim @@ -1,7 +1,7 @@ " Vim syntax file -" Language: RFC 2614 - An API for Service Location registration file -" Maintainer: Nikolai Weibull -" Latest Revision: 2006-04-19 +" Language: RFC 2614 - An API for Service Location registration file +" Previous Maintainer: Nikolai Weibull +" Latest Revision: 2006-04-19 if exists("b:current_syntax") finish diff --git a/runtime/syntax/slpspi.vim b/runtime/syntax/slpspi.vim index 8507e3de69..eaeb02a80f 100644 --- a/runtime/syntax/slpspi.vim +++ b/runtime/syntax/slpspi.vim @@ -1,7 +1,7 @@ " Vim syntax file -" Language: RFC 2614 - An API for Service Location SPI file -" Maintainer: Nikolai Weibull -" Latest Revision: 2006-04-19 +" Language: RFC 2614 - An API for Service Location SPI file +" Previous Maintainer: Nikolai Weibull +" Latest Revision: 2006-04-19 if exists("b:current_syntax") finish diff --git a/runtime/syntax/slrnrc.vim b/runtime/syntax/slrnrc.vim index 038b62e166..cf0734ae85 100644 --- a/runtime/syntax/slrnrc.vim +++ b/runtime/syntax/slrnrc.vim @@ -3,11 +3,8 @@ " Maintainer: Preben 'Peppe' Guldberg " Last Change: 23 April 2006 -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -150,44 +147,34 @@ syn match slrnrcSetkey "^\s*setkey\>" skipwhite nextgroup=slrnrcSetkeyArt,slrn syn match slrnrcUnsetkey '^\s*unsetkey\s\+\("\)\=\(article\|group\|readline\)\>\1' skipwhite nextgroup=slrnrcKey contains=slrnrcSetkeyObj\(Str\)\= " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_slrnrc_syntax_inits") - if version < 508 - let did_slrnrc_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink slrnrcTodo Todo - HiLink slrnrcSpaceError Error - HiLink slrnrcNumber Number - HiLink slrnrcSpecKey SpecialChar - HiLink slrnrcKey String - HiLink slrnrcSpecChar SpecialChar - HiLink slrnrcString String - HiLink slrnSlangPreCondit Special - HiLink slrnrcComment Comment - HiLink slrnrcVarInt Identifier - HiLink slrnrcVarStr Identifier - HiLink slrnrcCmd slrnrcSet - HiLink slrnrcSet Operator - HiLink slrnrcColor Keyword - HiLink slrnrcColorObj Identifier - HiLink slrnrcColorVal String - HiLink slrnrcMono Keyword - HiLink slrnrcMonoObj Identifier - HiLink slrnrcMonoVal String - HiLink slrnrcFunArt Macro - HiLink slrnrcFunGroup Macro - HiLink slrnrcFunRead Macro - HiLink slrnrcSetkeyObj Identifier - HiLink slrnrcSetkey Keyword - HiLink slrnrcUnsetkey slrnrcSetkey +hi def link slrnrcTodo Todo +hi def link slrnrcSpaceError Error +hi def link slrnrcNumber Number +hi def link slrnrcSpecKey SpecialChar +hi def link slrnrcKey String +hi def link slrnrcSpecChar SpecialChar +hi def link slrnrcString String +hi def link slrnSlangPreCondit Special +hi def link slrnrcComment Comment +hi def link slrnrcVarInt Identifier +hi def link slrnrcVarStr Identifier +hi def link slrnrcCmd slrnrcSet +hi def link slrnrcSet Operator +hi def link slrnrcColor Keyword +hi def link slrnrcColorObj Identifier +hi def link slrnrcColorVal String +hi def link slrnrcMono Keyword +hi def link slrnrcMonoObj Identifier +hi def link slrnrcMonoVal String +hi def link slrnrcFunArt Macro +hi def link slrnrcFunGroup Macro +hi def link slrnrcFunRead Macro +hi def link slrnrcSetkeyObj Identifier +hi def link slrnrcSetkey Keyword +hi def link slrnrcUnsetkey slrnrcSetkey - delcommand HiLink -endif let b:current_syntax = "slrnrc" diff --git a/runtime/syntax/slrnsc.vim b/runtime/syntax/slrnsc.vim index 838af6ad1c..9f51cad380 100644 --- a/runtime/syntax/slrnsc.vim +++ b/runtime/syntax/slrnsc.vim @@ -3,20 +3,13 @@ " Maintainer: Preben 'Peppe' Guldberg " Last Change: 8 Oct 2004 -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif " characters in newsgroup names -if version < 600 - set isk=@,48-57,.,-,_,+ -else - setlocal isk=@,48-57,.,-,_,+ -endif +setlocal isk=@,48-57,.,-,_,+ syn match slrnscComment "%.*$" syn match slrnscSectionCom ".].*"lc=2 @@ -51,34 +44,24 @@ syn match slrnscScoreIdent contained "%.*" syn match slrnScoreLine "^\s*Score::\=\s\+=\=[-+]\=\d\+\s*\(%.*\)\=$" skipempty nextgroup=slrnscScoreItem contains=slrnscScore,slrnscDelim,slrnscOper,slrnscNumber,slrnscScoreIdent " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_slrnsc_syntax_inits") - if version < 508 - let did_slrnsc_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink slrnscComment Comment - HiLink slrnscSectionCom slrnscComment - HiLink slrnscGroup String - HiLink slrnscNumber Number - HiLink slrnscDate Special - HiLink slrnscDelim Delimiter - HiLink slrnscComma SpecialChar - HiLink slrnscOper SpecialChar - HiLink slrnscEsc String - HiLink slrnscSectionStd Type - HiLink slrnscSectionNot Delimiter - HiLink slrnscItem Statement - HiLink slrnscScore Keyword - HiLink slrnscScoreIdent Identifier - HiLink slrnscInclude Keyword +hi def link slrnscComment Comment +hi def link slrnscSectionCom slrnscComment +hi def link slrnscGroup String +hi def link slrnscNumber Number +hi def link slrnscDate Special +hi def link slrnscDelim Delimiter +hi def link slrnscComma SpecialChar +hi def link slrnscOper SpecialChar +hi def link slrnscEsc String +hi def link slrnscSectionStd Type +hi def link slrnscSectionNot Delimiter +hi def link slrnscItem Statement +hi def link slrnscScore Keyword +hi def link slrnscScoreIdent Identifier +hi def link slrnscInclude Keyword - delcommand HiLink -endif let b:current_syntax = "slrnsc" diff --git a/runtime/syntax/sm.vim b/runtime/syntax/sm.vim index 8fdc14b71a..0ecc96875f 100644 --- a/runtime/syntax/sm.vim +++ b/runtime/syntax/sm.vim @@ -1,10 +1,9 @@ " Vim syntax file " Language: sendmail " Maintainer: Charles E. Campbell -" Last Change: Oct 23, 2014 -" Version: 7 +" Last Change: Oct 25, 2016 +" Version: 8 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SM - if exists("b:current_syntax") finish endif @@ -56,36 +55,25 @@ syn match smClauseCont contained "^\t" syn region smClause matchgroup=Delimiter start="\$?." matchgroup=Delimiter end="\$\." contains=smElse,smClause,smVar,smClauseCont " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_smil_syntax_inits") - if version < 508 - let did_smil_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink smClause Special - HiLink smClauseError Error - HiLink smComment Comment - HiLink smDefine Statement - HiLink smElse Delimiter - HiLink smHeader Statement - HiLink smHeaderSep String - HiLink smMesg Special - HiLink smPrecedence Number - HiLink smRewrite Statement - HiLink smRewriteComment Comment - HiLink smRewriteLhsToken String - HiLink smRewriteLhsUser Statement - HiLink smRewriteRhsToken String - HiLink smRuleset Preproc - HiLink smTrusted Special - HiLink smVar String - - delcommand HiLink -endif +hi def link smClause Special +hi def link smClauseError Error +hi def link smComment Comment +hi def link smDefine Statement +hi def link smElse Delimiter +hi def link smHeader Statement +hi def link smHeaderSep String +hi def link smMesg Special +hi def link smPrecedence Number +hi def link smRewrite Statement +hi def link smRewriteComment Comment +hi def link smRewriteLhsToken String +hi def link smRewriteLhsUser Statement +hi def link smRewriteRhsToken String +hi def link smRuleset Preproc +hi def link smTrusted Special +hi def link smVar String let b:current_syntax = "sm" diff --git a/runtime/syntax/smarty.vim b/runtime/syntax/smarty.vim index 6dda366ba2..a39c290abe 100644 --- a/runtime/syntax/smarty.vim +++ b/runtime/syntax/smarty.vim @@ -8,11 +8,10 @@ " For version 5.x: Clear all syntax items " For version 6.x: Quit when a syntax file was already loaded if !exists("main_syntax") - if version < 600 - syntax clear - elseif exists("b:current_syntax") - finish -endif + " quit when a syntax file was already loaded + if exists("b:current_syntax") + finish + endif let main_syntax = 'smarty' endif @@ -57,25 +56,16 @@ syn region htmlString contained start=+'+ end=+'+ contains=htmlSpecialChar,ja syn region htmlLink start="\_[^>]*\" end=""me=e-4 contains=@Spell,htmlTag,htmlEndTag,htmlSpecialChar,htmlPreProc,htmlComment,javaScript,@htmlPreproc,smartyZone -if version >= 508 || !exists("did_smarty_syn_inits") - if version < 508 - let did_smarty_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - HiLink smartyTagName Identifier - HiLink smartyProperty Constant - " if you want the text inside the braces to be colored, then - " remove the comment in from of the next statement - "HiLink smartyZone Include - HiLink smartyInFunc Function - HiLink smartyBlock Constant - HiLink smartyDot SpecialChar - HiLink smartyModifier Function - delcommand HiLink -endif +hi def link smartyTagName Identifier +hi def link smartyProperty Constant +" if you want the text inside the braces to be colored, then +" remove the comment in from of the next statement +"hi def link smartyZone Include +hi def link smartyInFunc Function +hi def link smartyBlock Constant +hi def link smartyDot SpecialChar +hi def link smartyModifier Function let b:current_syntax = "smarty" diff --git a/runtime/syntax/smcl.vim b/runtime/syntax/smcl.vim index d9afba6de5..a5baa47e96 100644 --- a/runtime/syntax/smcl.vim +++ b/runtime/syntax/smcl.vim @@ -10,9 +10,8 @@ " check for 'b:current_syntax', removed 'did_smcl_syntax_inits' " 26apr2006 changed 'stata_smcl' to 'smcl' -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif diff --git a/runtime/syntax/smil.vim b/runtime/syntax/smil.vim index 6b5a002868..4cf6e84710 100644 --- a/runtime/syntax/smil.vim +++ b/runtime/syntax/smil.vim @@ -7,11 +7,8 @@ " To learn more about SMIL, please refer to http://www.w3.org/AudioVideo/ " and to http://www.helio.org/products/smil/tutorial/ -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -115,38 +112,28 @@ endif syn region smilComment start=++ " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_smil_syntax_inits") - if version < 508 - let did_smil_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink smilTag Function - HiLink smilEndTag Identifier - HiLink smilArg Type - HiLink smilTagName smilStatement - HiLink smilSpecialTagName Exception - HiLink smilValue Value - HiLink smilSpecialChar Special +hi def link smilTag Function +hi def link smilEndTag Identifier +hi def link smilArg Type +hi def link smilTagName smilStatement +hi def link smilSpecialTagName Exception +hi def link smilValue Value +hi def link smilSpecialChar Special - HiLink smilSpecial Special - HiLink smilSpecialChar Special - HiLink smilString String - HiLink smilStatement Statement - HiLink smilComment Comment - HiLink smilCommentPart Comment - HiLink smilPreProc PreProc - HiLink smilValue String - HiLink smilCommentError smilError - HiLink smilTagError smilError - HiLink smilError Error +hi def link smilSpecial Special +hi def link smilSpecialChar Special +hi def link smilString String +hi def link smilStatement Statement +hi def link smilComment Comment +hi def link smilCommentPart Comment +hi def link smilPreProc PreProc +hi def link smilValue String +hi def link smilCommentError smilError +hi def link smilTagError smilError +hi def link smilError Error - delcommand HiLink -endif let b:current_syntax = "smil" diff --git a/runtime/syntax/smith.vim b/runtime/syntax/smith.vim index e05ce69683..b045d3b963 100644 --- a/runtime/syntax/smith.vim +++ b/runtime/syntax/smith.vim @@ -3,11 +3,8 @@ " Maintainer: Rafal M. Sulejman " Last Change: 21.07.2000 -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -28,24 +25,14 @@ syn region smithString start=+"+ skip=+\\\\\|\\"+ end=+"+ syn case match " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_smith_syntax_inits") - if version < 508 - let did_smith_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink smithRegister Identifier - HiLink smithKeyword Keyword - HiLink smithComment Comment - HiLink smithString String - HiLink smithNumber Number +hi def link smithRegister Identifier +hi def link smithKeyword Keyword +hi def link smithComment Comment +hi def link smithString String +hi def link smithNumber Number - delcommand HiLink -endif let b:current_syntax = "smith" diff --git a/runtime/syntax/sml.vim b/runtime/syntax/sml.vim index aa7d64a33a..fa4524f93d 100644 --- a/runtime/syntax/sml.vim +++ b/runtime/syntax/sml.vim @@ -8,11 +8,8 @@ " 2002 Jun 02 - Fixed small typo (MM) " 2001 Nov 20 - Fixed small highlighting bug with modules (MM) -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -168,62 +165,52 @@ syn sync match smlSigSync grouphere smlSig "\" syn sync match smlSigSync groupthere smlSig "\" " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_sml_syntax_inits") - if version < 508 - let did_sml_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink smlBraceErr Error - HiLink smlBrackErr Error - HiLink smlParenErr Error +hi def link smlBraceErr Error +hi def link smlBrackErr Error +hi def link smlParenErr Error - HiLink smlCommentErr Error +hi def link smlCommentErr Error - HiLink smlEndErr Error - HiLink smlThenErr Error +hi def link smlEndErr Error +hi def link smlThenErr Error - HiLink smlCharErr Error +hi def link smlCharErr Error - HiLink smlComment Comment +hi def link smlComment Comment - HiLink smlModPath Include - HiLink smlModule Include - HiLink smlModParam1 Include - HiLink smlModType Include - HiLink smlMPRestr3 Include - HiLink smlFullMod Include - HiLink smlModTypeRestr Include - HiLink smlWith Include - HiLink smlMTDef Include +hi def link smlModPath Include +hi def link smlModule Include +hi def link smlModParam1 Include +hi def link smlModType Include +hi def link smlMPRestr3 Include +hi def link smlFullMod Include +hi def link smlModTypeRestr Include +hi def link smlWith Include +hi def link smlMTDef Include - HiLink smlConstructor Constant +hi def link smlConstructor Constant - HiLink smlModPreRHS Keyword - HiLink smlMPRestr2 Keyword - HiLink smlKeyword Keyword - HiLink smlFunDef Keyword - HiLink smlRefAssign Keyword - HiLink smlKeyChar Keyword - HiLink smlAnyVar Keyword - HiLink smlTopStop Keyword - HiLink smlOperator Keyword +hi def link smlModPreRHS Keyword +hi def link smlMPRestr2 Keyword +hi def link smlKeyword Keyword +hi def link smlFunDef Keyword +hi def link smlRefAssign Keyword +hi def link smlKeyChar Keyword +hi def link smlAnyVar Keyword +hi def link smlTopStop Keyword +hi def link smlOperator Keyword - HiLink smlBoolean Boolean - HiLink smlCharacter Character - HiLink smlNumber Number - HiLink smlReal Float - HiLink smlString String - HiLink smlType Type - HiLink smlTodo Todo - HiLink smlEncl Keyword +hi def link smlBoolean Boolean +hi def link smlCharacter Character +hi def link smlNumber Number +hi def link smlReal Float +hi def link smlString String +hi def link smlType Type +hi def link smlTodo Todo +hi def link smlEncl Keyword - delcommand HiLink -endif let b:current_syntax = "sml" diff --git a/runtime/syntax/snnsnet.vim b/runtime/syntax/snnsnet.vim index 6b24de5634..9dc9e06e78 100644 --- a/runtime/syntax/snnsnet.vim +++ b/runtime/syntax/snnsnet.vim @@ -8,9 +8,8 @@ " SNNS http://www-ra.informatik.uni-tuebingen.de/SNNS/ " is a simulator for neural networks. -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -54,23 +53,14 @@ syn match snnsnetNumbers "\d" contained syn match snnsnetComment "#.*$" contains=snnsnetTodo syn keyword snnsnetTodo TODO XXX FIXME contained -if version >= 508 || !exists("did_snnsnet_syn_inits") - if version < 508 - let did_snnsnet_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - HiLink snnsnetType Type - HiLink snnsnetComment Comment - HiLink snnsnetNumbers Number - HiLink snnsnetSection Statement - HiLink snnsnetTitle Label - HiLink snnsnetTodo Todo +hi def link snnsnetType Type +hi def link snnsnetComment Comment +hi def link snnsnetNumbers Number +hi def link snnsnetSection Statement +hi def link snnsnetTitle Label +hi def link snnsnetTodo Todo - delcommand HiLink -endif let b:current_syntax = "snnsnet" diff --git a/runtime/syntax/snnspat.vim b/runtime/syntax/snnspat.vim index 5bfa48e624..cb6e9c5bd1 100644 --- a/runtime/syntax/snnspat.vim +++ b/runtime/syntax/snnspat.vim @@ -8,9 +8,8 @@ " SNNS http://www-ra.informatik.uni-tuebingen.de/SNNS/ " is a simulator for neural networks. -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -44,26 +43,17 @@ syn match snnspatNumbers "\d" contained syn match snnspatComment "#.*$" contains=snnspatTodo syn keyword snnspatTodo TODO XXX FIXME contained -if version >= 508 || !exists("did_snnspat_syn_inits") - if version < 508 - let did_snnspat_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - HiLink snnspatGen Statement - HiLink snnspatHeader Error - HiLink snnspatNoHeader Define - HiLink snnspatNumbers Number - HiLink snnspatComment Comment - HiLink snnspatError Error - HiLink snnspatTodo Todo - HiLink snnspatAccepted NONE - HiLink snnspatBrac NONE +hi def link snnspatGen Statement +hi def link snnspatHeader Error +hi def link snnspatNoHeader Define +hi def link snnspatNumbers Number +hi def link snnspatComment Comment +hi def link snnspatError Error +hi def link snnspatTodo Todo +hi def link snnspatAccepted NONE +hi def link snnspatBrac NONE - delcommand HiLink -endif let b:current_syntax = "snnspat" diff --git a/runtime/syntax/snnsres.vim b/runtime/syntax/snnsres.vim index 4c1d596009..2f19b67dbe 100644 --- a/runtime/syntax/snnsres.vim +++ b/runtime/syntax/snnsres.vim @@ -8,9 +8,8 @@ " SNNS http://www-ra.informatik.uni-tuebingen.de/SNNS/ " is a simulator for neural networks. -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -37,23 +36,14 @@ syn match snnsresNumbers "\d" contained syn match snnsresComment "#.*$" contains=snnsresTodo syn keyword snnsresTodo TODO XXX FIXME contained -if version >= 508 || !exists("did_snnsres_syn_inits") - if version < 508 - let did_snnsres_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - HiLink snnsresGen Statement - HiLink snnsresHeader Statement - HiLink snnsresNoHeader Define - HiLink snnsresNumbers Number - HiLink snnsresComment Comment - HiLink snnsresTodo Todo +hi def link snnsresGen Statement +hi def link snnsresHeader Statement +hi def link snnsresNoHeader Define +hi def link snnsresNumbers Number +hi def link snnsresComment Comment +hi def link snnsresTodo Todo - delcommand HiLink -endif let b:current_syntax = "snnsres" diff --git a/runtime/syntax/snobol4.vim b/runtime/syntax/snobol4.vim index 07eb63dec7..a14f15eef4 100644 --- a/runtime/syntax/snobol4.vim +++ b/runtime/syntax/snobol4.vim @@ -10,11 +10,8 @@ " - one character labels weren't displayed correctly. " - nonexistent Snobol4 keywords displayed as errors. -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -79,47 +76,37 @@ syn match snobol4ErrInBracket display contained "[){}]\|<%\|%>" " syn match snobol4Comment "^\#\!.*$" " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_snobol4_syntax_inits") - if version < 508 - let did_snobol4_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink snobol4Constant Constant - HiLink snobol4Label Label - HiLink snobol4Goto Repeat - HiLink snobol4Conditional Conditional - HiLink snobol4Repeat Repeat - HiLink snobol4Number Number - HiLink snobol4Error Error - HiLink snobol4Statement PreProc - HiLink snobol4BogusStatement snobol4Error - HiLink snobol4String String - HiLink snobol4Comment Comment - HiLink snobol4Special Special - HiLink snobol4Todo Todo - HiLink snobol4Keyword Keyword - HiLink snobol4Function Function - HiLink snobol4MathsOperator Operator - HiLink snobol4ParenError snobol4Error - HiLink snobol4ErrInParen snobol4Error - HiLink snobol4ErrInBracket snobol4Error - HiLink snobol4SysVar Keyword - HiLink snobol4BogusSysVar snobol4Error - if exists("snobol4_strict_mode") - HiLink snobol4ExtSysVar WarningMsg - HiLink snobol4ExtKeyword WarningMsg - else - HiLink snobol4ExtSysVar snobol4SysVar - HiLink snobol4ExtKeyword snobol4Keyword - endif - - delcommand HiLink +hi def link snobol4Constant Constant +hi def link snobol4Label Label +hi def link snobol4Goto Repeat +hi def link snobol4Conditional Conditional +hi def link snobol4Repeat Repeat +hi def link snobol4Number Number +hi def link snobol4Error Error +hi def link snobol4Statement PreProc +hi def link snobol4BogusStatement snobol4Error +hi def link snobol4String String +hi def link snobol4Comment Comment +hi def link snobol4Special Special +hi def link snobol4Todo Todo +hi def link snobol4Keyword Keyword +hi def link snobol4Function Function +hi def link snobol4MathsOperator Operator +hi def link snobol4ParenError snobol4Error +hi def link snobol4ErrInParen snobol4Error +hi def link snobol4ErrInBracket snobol4Error +hi def link snobol4SysVar Keyword +hi def link snobol4BogusSysVar snobol4Error +if exists("snobol4_strict_mode") +hi def link snobol4ExtSysVar WarningMsg +hi def link snobol4ExtKeyword WarningMsg +else +hi def link snobol4ExtSysVar snobol4SysVar +hi def link snobol4ExtKeyword snobol4Keyword endif + let b:current_syntax = "snobol4" " vim: ts=8 diff --git a/runtime/syntax/spec.vim b/runtime/syntax/spec.vim index 9952bd2548..3a7dc9e422 100644 --- a/runtime/syntax/spec.vim +++ b/runtime/syntax/spec.vim @@ -5,11 +5,8 @@ " Former Maintainer: Donovan Rebbechi elflord@panix.com (until March 2014) " Last Change: Sat Apr 9 15:30 2016 Filip Szymański -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -159,78 +156,68 @@ syn sync match shCaseEsacSync grouphere shCaseEsac "\" syn sync match shCaseEsacSync groupthere shCaseEsac "\" " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_spec_syntax_inits") - if version < 508 - let did_spec_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - "main types color definitions - HiLink specSection Structure - HiLink specSectionMacro Macro - HiLink specWWWlink PreProc - HiLink specOpts Operator +"main types color definitions +hi def link specSection Structure +hi def link specSectionMacro Macro +hi def link specWWWlink PreProc +hi def link specOpts Operator - "yes, it's ugly, but white is sooo cool - if &background == "dark" - hi def specGlobalMacro ctermfg=white - else - HiLink specGlobalMacro Identifier - endif - - "sh colors - HiLink shComment Comment - HiLink shIf Statement - HiLink shOperator Special - HiLink shQuote1 String - HiLink shQuote2 String - HiLink shQuoteDelim Statement - - "spec colors - HiLink specBlock Function - HiLink specColon Special - HiLink specCommand Statement - HiLink specCommandOpts specOpts - HiLink specCommandSpecial Special - HiLink specComment Comment - HiLink specConfigure specCommand - HiLink specDate String - HiLink specDescriptionOpts specOpts - HiLink specEmail specWWWlink - HiLink specError Error - HiLink specFilesDirective specSectionMacro - HiLink specFilesOpts specOpts - HiLink specLicense String - HiLink specMacroNameLocal specGlobalMacro - HiLink specMacroNameOther specGlobalMacro - HiLink specManpageFile NONE - HiLink specMonth specDate - HiLink specNoNumberHilite NONE - HiLink specNumber Number - HiLink specPackageOpts specOpts - HiLink specPercent Special - HiLink specSpecialChar Special - HiLink specSpecialVariables specGlobalMacro - HiLink specSpecialVariablesNames specGlobalMacro - HiLink specTarCommand specCommand - HiLink specURL specWWWlink - HiLink specURLMacro specWWWlink - HiLink specVariables Identifier - HiLink specWeekday specDate - HiLink specListedFilesBin Statement - HiLink specListedFilesDoc Statement - HiLink specListedFilesEtc Statement - HiLink specListedFilesLib Statement - HiLink specListedFilesPrefix Statement - HiLink specListedFilesShare Statement - - delcommand HiLink +"yes, it's ugly, but white is sooo cool +if &background == "dark" +hi def specGlobalMacro ctermfg=white +else +hi def link specGlobalMacro Identifier endif +"sh colors +hi def link shComment Comment +hi def link shIf Statement +hi def link shOperator Special +hi def link shQuote1 String +hi def link shQuote2 String +hi def link shQuoteDelim Statement + +"spec colors +hi def link specBlock Function +hi def link specColon Special +hi def link specCommand Statement +hi def link specCommandOpts specOpts +hi def link specCommandSpecial Special +hi def link specComment Comment +hi def link specConfigure specCommand +hi def link specDate String +hi def link specDescriptionOpts specOpts +hi def link specEmail specWWWlink +hi def link specError Error +hi def link specFilesDirective specSectionMacro +hi def link specFilesOpts specOpts +hi def link specLicense String +hi def link specMacroNameLocal specGlobalMacro +hi def link specMacroNameOther specGlobalMacro +hi def link specManpageFile NONE +hi def link specMonth specDate +hi def link specNoNumberHilite NONE +hi def link specNumber Number +hi def link specPackageOpts specOpts +hi def link specPercent Special +hi def link specSpecialChar Special +hi def link specSpecialVariables specGlobalMacro +hi def link specSpecialVariablesNames specGlobalMacro +hi def link specTarCommand specCommand +hi def link specURL specWWWlink +hi def link specURLMacro specWWWlink +hi def link specVariables Identifier +hi def link specWeekday specDate +hi def link specListedFilesBin Statement +hi def link specListedFilesDoc Statement +hi def link specListedFilesEtc Statement +hi def link specListedFilesLib Statement +hi def link specListedFilesPrefix Statement +hi def link specListedFilesShare Statement + + let b:current_syntax = "spec" " vim: ts=8 diff --git a/runtime/syntax/specman.vim b/runtime/syntax/specman.vim index 93fb4a86c6..9387925ef2 100644 --- a/runtime/syntax/specman.vim +++ b/runtime/syntax/specman.vim @@ -10,11 +10,8 @@ "--------------------------------------------------------- " Remove any old syntax stuff hanging around -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -137,46 +134,36 @@ syn region specmanString start=+"+ end=+"+ syn sync lines=50 " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_specman_syn_inits") - if version < 508 - let did_specman_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - " The default methods for highlighting. Can be overridden later - HiLink specmanConditional Conditional - HiLink specmanConstraint Conditional - HiLink specmanRepeat Repeat - HiLink specmanString String - HiLink specmanComment Comment - HiLink specmanConstant Macro - HiLink specmanNumber Number - HiLink specmanCompare Operator - HiLink specmanOperator Operator - HiLink specmanLogical Operator - HiLink specmanStatement Statement - HiLink specmanHDL SpecialChar - HiLink specmanMethod Function - HiLink specmanInclude Include - HiLink specmanStructure Structure - HiLink specmanBoolean Boolean - HiLink specmanFSM Label - HiLink specmanSpecial Special - HiLink specmanType Type - HiLink specmanTemporal Type - HiLink specmanFile Include - HiLink specmanPreCondit Include - HiLink specmanDefine Typedef - HiLink specmanLabel Label - HiLink specmanPacking keyword - HiLink specmanTodo Todo - HiLink specmanParenError Error - HiLink specmanErrInParen Error - HiLink specmanErrInBracket Error - delcommand HiLink -endif +" Only when an item doesn't have highlighting yet +" The default methods for highlighting. Can be overridden later +hi def link specmanConditional Conditional +hi def link specmanConstraint Conditional +hi def link specmanRepeat Repeat +hi def link specmanString String +hi def link specmanComment Comment +hi def link specmanConstant Macro +hi def link specmanNumber Number +hi def link specmanCompare Operator +hi def link specmanOperator Operator +hi def link specmanLogical Operator +hi def link specmanStatement Statement +hi def link specmanHDL SpecialChar +hi def link specmanMethod Function +hi def link specmanInclude Include +hi def link specmanStructure Structure +hi def link specmanBoolean Boolean +hi def link specmanFSM Label +hi def link specmanSpecial Special +hi def link specmanType Type +hi def link specmanTemporal Type +hi def link specmanFile Include +hi def link specmanPreCondit Include +hi def link specmanDefine Typedef +hi def link specmanLabel Label +hi def link specmanPacking keyword +hi def link specmanTodo Todo +hi def link specmanParenError Error +hi def link specmanErrInParen Error +hi def link specmanErrInBracket Error let b:current_syntax = "specman" diff --git a/runtime/syntax/spice.vim b/runtime/syntax/spice.vim index 200e1aaea4..306039bc74 100644 --- a/runtime/syntax/spice.vim +++ b/runtime/syntax/spice.vim @@ -7,11 +7,8 @@ " This is based on sh.vim by Lennart Schultz " but greatly simplified -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -53,28 +50,18 @@ syn match spiceParenError ")" syn sync minlines=50 " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_spice_syntax_inits") - if version < 508 - let did_spice_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink spiceTodo Todo - HiLink spiceWrapLineOperator spiceOperator - HiLink spiceSinglequote spiceExpr - HiLink spiceExpr Function - HiLink spiceParenError Error - HiLink spiceStatement Statement - HiLink spiceNumber Number - HiLink spiceComment Comment - HiLink spiceOperator Operator +hi def link spiceTodo Todo +hi def link spiceWrapLineOperator spiceOperator +hi def link spiceSinglequote spiceExpr +hi def link spiceExpr Function +hi def link spiceParenError Error +hi def link spiceStatement Statement +hi def link spiceNumber Number +hi def link spiceComment Comment +hi def link spiceOperator Operator - delcommand HiLink -endif let b:current_syntax = "spice" diff --git a/runtime/syntax/splint.vim b/runtime/syntax/splint.vim index dc09d8b9d6..8eba57d288 100644 --- a/runtime/syntax/splint.vim +++ b/runtime/syntax/splint.vim @@ -15,20 +15,13 @@ " in your vimrc file or filetype.vim -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif " Read the C syntax to start with -if version < 600 - so :p:h/c.vim -else - runtime! syntax/c.vim -endif +runtime! syntax/c.vim " FIXME: uses and changes several clusters defined in c.vim @@ -199,61 +192,51 @@ syn cluster cPreProcGroup add=@splintAllStuff syn cluster cMultiGroup add=@splintAllStuff " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_splint_syntax_inits") - if version < 508 - let did_splint_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink splintShortAnn splintAnnotation - HiLink splintAnnotation Comment - HiLink splintAnnError splintError - HiLink splintAnnError2 splintError - HiLink splintFlag SpecialComment - HiLink splintGlobalFlag splintError - HiLink splintSpecialAnnot splintAnnKey - HiLink splintStateAnnot splintAnnKey - HiLink splintSpecTag splintAnnKey - HiLink splintModifies splintAnnKey - HiLink splintRequires splintAnnKey - HiLink splintGlobals splintAnnKey - HiLink splintGlobitem Constant - HiLink splintGlobannot splintAnnKey - HiLink splintWarning splintAnnKey - HiLink splintModitem Constant - HiLink splintIter splintAnnKey - HiLink splintConst splintAnnKey - HiLink splintAlt splintAnnKey - HiLink splintType splintAnnKey - HiLink splintGlobalType splintAnnKey - HiLink splintMemMgm splintAnnKey - HiLink splintAlias splintAnnKey - HiLink splintExposure splintAnnKey - HiLink splintDefState splintAnnKey - HiLink splintGlobState splintAnnKey - HiLink splintNullState splintAnnKey - HiLink splintNullPred splintAnnKey - HiLink splintExit splintAnnKey - HiLink splintExec splintAnnKey - HiLink splintSef splintAnnKey - HiLink splintDecl splintAnnKey - HiLink splintCase splintAnnKey - HiLink splintBreak splintAnnKey - HiLink splintUnreach splintAnnKey - HiLink splintSpecFunc splintAnnKey - HiLink splintErrSupp splintAnnKey - HiLink splintTypeAcc splintAnnKey - HiLink splintMacro splintAnnKey - HiLink splintSpecType splintAnnKey - HiLink splintAnnKey Type - HiLink splintError Error +hi def link splintShortAnn splintAnnotation +hi def link splintAnnotation Comment +hi def link splintAnnError splintError +hi def link splintAnnError2 splintError +hi def link splintFlag SpecialComment +hi def link splintGlobalFlag splintError +hi def link splintSpecialAnnot splintAnnKey +hi def link splintStateAnnot splintAnnKey +hi def link splintSpecTag splintAnnKey +hi def link splintModifies splintAnnKey +hi def link splintRequires splintAnnKey +hi def link splintGlobals splintAnnKey +hi def link splintGlobitem Constant +hi def link splintGlobannot splintAnnKey +hi def link splintWarning splintAnnKey +hi def link splintModitem Constant +hi def link splintIter splintAnnKey +hi def link splintConst splintAnnKey +hi def link splintAlt splintAnnKey +hi def link splintType splintAnnKey +hi def link splintGlobalType splintAnnKey +hi def link splintMemMgm splintAnnKey +hi def link splintAlias splintAnnKey +hi def link splintExposure splintAnnKey +hi def link splintDefState splintAnnKey +hi def link splintGlobState splintAnnKey +hi def link splintNullState splintAnnKey +hi def link splintNullPred splintAnnKey +hi def link splintExit splintAnnKey +hi def link splintExec splintAnnKey +hi def link splintSef splintAnnKey +hi def link splintDecl splintAnnKey +hi def link splintCase splintAnnKey +hi def link splintBreak splintAnnKey +hi def link splintUnreach splintAnnKey +hi def link splintSpecFunc splintAnnKey +hi def link splintErrSupp splintAnnKey +hi def link splintTypeAcc splintAnnKey +hi def link splintMacro splintAnnKey +hi def link splintSpecType splintAnnKey +hi def link splintAnnKey Type +hi def link splintError Error - delcommand HiLink -endif let b:current_syntax = "splint" diff --git a/runtime/syntax/spup.vim b/runtime/syntax/spup.vim index 8d7a9e525c..743c7b5711 100644 --- a/runtime/syntax/spup.vim +++ b/runtime/syntax/spup.vim @@ -17,11 +17,8 @@ " If you encounter problems or have questions or suggestions, mail me " Remove old syntax stuff -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -206,74 +203,64 @@ syn sync match spupSyncTitle grouphere spupTitle "^TITLE" syn sync match spupSyncUnit grouphere spupUnit "^UNIT" " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_spup_syn_inits") - if version < 508 - let did_spup_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink spupCdi spupSection - HiLink spupConditions spupSection - HiLink spupDeclare spupSection - HiLink spupEstimation spupSection - HiLink spupExternal spupSection - HiLink spupFlowsheet spupSection - HiLink spupFunction spupSection - HiLink spupGlobal spupSection - HiLink spupHomotopy spupSection - HiLink spupMacro spupSection - HiLink spupModel spupSection - HiLink spupOperation spupSection - HiLink spupOptions spupSection - HiLink spupProcedure spupSection - HiLink spupProfiles spupSection - HiLink spupReport spupSection - HiLink spupTitle spupConstant " this is correct, truly ;) - HiLink spupUnit spupSection +hi def link spupCdi spupSection +hi def link spupConditions spupSection +hi def link spupDeclare spupSection +hi def link spupEstimation spupSection +hi def link spupExternal spupSection +hi def link spupFlowsheet spupSection +hi def link spupFunction spupSection +hi def link spupGlobal spupSection +hi def link spupHomotopy spupSection +hi def link spupMacro spupSection +hi def link spupModel spupSection +hi def link spupOperation spupSection +hi def link spupOptions spupSection +hi def link spupProcedure spupSection +hi def link spupProfiles spupSection +hi def link spupReport spupSection +hi def link spupTitle spupConstant " this is correct, truly ;) +hi def link spupUnit spupSection - HiLink spupCdiSubs spupSubs - HiLink spupConditionsSubs spupSubs - HiLink spupDeclareSubs spupSubs - HiLink spupEstimationSubs spupSubs - HiLink spupExternalSubs spupSubs - HiLink spupFlowsheetSubs spupSubs - HiLink spupFunctionSubs spupSubs - HiLink spupHomotopySubs spupSubs - HiLink spupMacroSubs spupSubs - HiLink spupModelSubs spupSubs - HiLink spupOperationSubs spupSubs - HiLink spupOptionsSubs spupSubs - HiLink spupProcedureSubs spupSubs - HiLink spupReportSubs spupSubs - HiLink spupUnitSubs spupSubs +hi def link spupCdiSubs spupSubs +hi def link spupConditionsSubs spupSubs +hi def link spupDeclareSubs spupSubs +hi def link spupEstimationSubs spupSubs +hi def link spupExternalSubs spupSubs +hi def link spupFlowsheetSubs spupSubs +hi def link spupFunctionSubs spupSubs +hi def link spupHomotopySubs spupSubs +hi def link spupMacroSubs spupSubs +hi def link spupModelSubs spupSubs +hi def link spupOperationSubs spupSubs +hi def link spupOptionsSubs spupSubs +hi def link spupProcedureSubs spupSubs +hi def link spupReportSubs spupSubs +hi def link spupUnitSubs spupSubs - HiLink spupCode Normal - HiLink spupComment Comment - HiLink spupComment2 spupComment - HiLink spupConditional Statement - HiLink spupConstant Constant - HiLink spupError Error - HiLink spupHelp Normal - HiLink spupIdentifier Identifier - HiLink spupNumber Constant - HiLink spupOperator Special - HiLink spupOpenBrace spupError - HiLink spupSection Statement - HiLink spupSpecial spupTextprocGeneric - HiLink spupStreams Type - HiLink spupString Constant - HiLink spupSubs Statement - HiLink spupSymbol Special - HiLink spupTextprocError Normal - HiLink spupTextprocGeneric PreProc - HiLink spupTypes Type +hi def link spupCode Normal +hi def link spupComment Comment +hi def link spupComment2 spupComment +hi def link spupConditional Statement +hi def link spupConstant Constant +hi def link spupError Error +hi def link spupHelp Normal +hi def link spupIdentifier Identifier +hi def link spupNumber Constant +hi def link spupOperator Special +hi def link spupOpenBrace spupError +hi def link spupSection Statement +hi def link spupSpecial spupTextprocGeneric +hi def link spupStreams Type +hi def link spupString Constant +hi def link spupSubs Statement +hi def link spupSymbol Special +hi def link spupTextprocError Normal +hi def link spupTextprocGeneric PreProc +hi def link spupTypes Type - delcommand HiLink -endif let b:current_syntax = "spup" diff --git a/runtime/syntax/spyce.vim b/runtime/syntax/spyce.vim index e76cb1a1a2..169de199dc 100644 --- a/runtime/syntax/spyce.vim +++ b/runtime/syntax/spyce.vim @@ -4,11 +4,8 @@ " URL: http://spyce.sourceforge.net " Last Change: 2009 Nov 11 -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -20,13 +17,9 @@ endif " Read the HTML syntax to start with let b:did_indent = 1 " don't perform HTML indentation! let html_no_rendering = 1 " do not render ,, etc... -if version < 600 - so :p:h/html.vim -else - runtime! syntax/html.vim - unlet b:current_syntax - syntax spell default " added by Bram -endif +runtime! syntax/html.vim +unlet b:current_syntax +syntax spell default " added by Bram " include python syn include @Python :p:h/python.vim diff --git a/runtime/syntax/sql.vim b/runtime/syntax/sql.vim index 7ba20f3446..6de3f4a5c0 100644 --- a/runtime/syntax/sql.vim +++ b/runtime/syntax/sql.vim @@ -10,11 +10,8 @@ " If the above exist, it will source the type specified. " If none exist, it will source the default sql.vim file. " -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif diff --git a/runtime/syntax/sqlanywhere.vim b/runtime/syntax/sqlanywhere.vim index 05b05c9f4f..e91a99de65 100644 --- a/runtime/syntax/sqlanywhere.vim +++ b/runtime/syntax/sqlanywhere.vim @@ -12,11 +12,8 @@ " Updated to Adaptive Server Anywhere 9.0.1 " Updated to Adaptive Server Anywhere 9.0.0 " -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif diff --git a/runtime/syntax/sqlforms.vim b/runtime/syntax/sqlforms.vim index 055b2ae870..6077dd1e94 100644 --- a/runtime/syntax/sqlforms.vim +++ b/runtime/syntax/sqlforms.vim @@ -7,21 +7,14 @@ " " TODO Find a new maintainer who knows SQL*Forms. - " For version 5.x, clear all syntax items. - " For version 6.x, quit when a syntax file was already loaded. -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif syntax case ignore -if version >= 600 - setlocal iskeyword=a-z,A-Z,48-57,_,.,-,> -else - set iskeyword=a-z,A-Z,48-57,_,.,-,> -endif +setlocal iskeyword=a-z,A-Z,48-57,_,.,-,> " The SQL reserved words, defined as keywords. @@ -138,30 +131,21 @@ syntax match sqlNumber "-\=\<[0-9]*\.\=[0-9_]\>" syntax sync ccomment sqlComment -if version >= 508 || !exists("did_sqlforms_syn_inits") - if version < 508 - let did_sqlforms_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - HiLink sqlComment Comment - HiLink sqlKeyword Statement - HiLink sqlNumber Number - HiLink sqlOperator Statement - HiLink sqlProcedure Statement - HiLink sqlFunction Statement - HiLink sqlSystem Identifier - HiLink sqlSpecial Special - HiLink sqlStatement Statement - HiLink sqlString String - HiLink sqlType Type - HiLink sqlCodes Identifier - HiLink sqlTriggers PreProc +hi def link sqlComment Comment +hi def link sqlKeyword Statement +hi def link sqlNumber Number +hi def link sqlOperator Statement +hi def link sqlProcedure Statement +hi def link sqlFunction Statement +hi def link sqlSystem Identifier +hi def link sqlSpecial Special +hi def link sqlStatement Statement +hi def link sqlString String +hi def link sqlType Type +hi def link sqlCodes Identifier +hi def link sqlTriggers PreProc - delcommand HiLink -endif let b:current_syntax = "sqlforms" diff --git a/runtime/syntax/sqlhana.vim b/runtime/syntax/sqlhana.vim index 1410e99eb4..2e334bb56e 100644 --- a/runtime/syntax/sqlhana.vim +++ b/runtime/syntax/sqlhana.vim @@ -7,11 +7,8 @@ " Description: Updated to SAP HANA SP4 " -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif diff --git a/runtime/syntax/sqlinformix.vim b/runtime/syntax/sqlinformix.vim index b4d023600c..e01912bc40 100644 --- a/runtime/syntax/sqlinformix.vim +++ b/runtime/syntax/sqlinformix.vim @@ -4,11 +4,8 @@ " Maintainer: Dean Hill " Last Change: 2004 Aug 30 -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -154,43 +151,33 @@ syn keyword sqlTodo TODO FIXME XXX DEBUG NOTE " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_sql_syn_inits") - if version < 508 - let did_sql_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - " === Comment syntax group === - HiLink sqlComment Comment +" === Comment syntax group === +hi def link sqlComment Comment - " === Constant syntax group === - HiLink sqlNumber Number - HiLink sqlBoolean Boolean - HiLink sqlString String +" === Constant syntax group === +hi def link sqlNumber Number +hi def link sqlBoolean Boolean +hi def link sqlString String - " === Statment syntax group === - HiLink sqlStatement Statement - HiLink sqlConditional Conditional - HiLink sqlRepeat Repeat - HiLink sqlKeyword Keyword - HiLink sqlOperator Operator - HiLink sqlException Exception +" === Statment syntax group === +hi def link sqlStatement Statement +hi def link sqlConditional Conditional +hi def link sqlRepeat Repeat +hi def link sqlKeyword Keyword +hi def link sqlOperator Operator +hi def link sqlException Exception - " === Identifier syntax group === - HiLink sqlFunction Function +" === Identifier syntax group === +hi def link sqlFunction Function - " === Type syntax group === - HiLink sqlType Type +" === Type syntax group === +hi def link sqlType Type - " === Todo syntax group === - HiLink sqlTodo Todo +" === Todo syntax group === +hi def link sqlTodo Todo - delcommand HiLink -endif let b:current_syntax = "sqlinformix" diff --git a/runtime/syntax/sqlj.vim b/runtime/syntax/sqlj.vim index 51398ef9c2..c901145c3c 100644 --- a/runtime/syntax/sqlj.vim +++ b/runtime/syntax/sqlj.vim @@ -8,10 +8,8 @@ " au BufNewFile,BufRead *.sqlj so $VIM/syntax/sqlj.vim -" Remove any old syntax stuff hanging around -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -76,27 +74,18 @@ syn match sqlComment "--.*" syn sync ccomment sqljComment -if version >= 508 || !exists("did_sqlj_syn_inits") - if version < 508 - let did_sqlj_syn_inits = 1 - command! -nargs=+ HiLink hi link - else - command! -nargs=+ HiLink hi def link - endif - " The default methods for highlighting. Can be overridden later. - HiLink sqljComment Comment - HiLink sqljKeyword sqljSpecial - HiLink sqljNumber Number - HiLink sqljOperator sqljStatement - HiLink sqljSpecial Special - HiLink sqljStatement Statement - HiLink sqljString String - HiLink sqljType Type - HiLink sqljPre PreProc +" The default methods for highlighting. Can be overridden later. +hi def link sqljComment Comment +hi def link sqljKeyword sqljSpecial +hi def link sqljNumber Number +hi def link sqljOperator sqljStatement +hi def link sqljSpecial Special +hi def link sqljStatement Statement +hi def link sqljString String +hi def link sqljType Type +hi def link sqljPre PreProc - delcommand HiLink -endif let b:current_syntax = "sqlj" diff --git a/runtime/syntax/sqloracle.vim b/runtime/syntax/sqloracle.vim index f9e24af98c..bf2862f497 100644 --- a/runtime/syntax/sqloracle.vim +++ b/runtime/syntax/sqloracle.vim @@ -128,19 +128,17 @@ syn keyword sqlFunction xmlparse xmlpatch xmlpi xmlquery xmlroot xmlsequence xml syn keyword sqlTodo TODO FIXME XXX DEBUG NOTE contained " Define the default highlighting. -command -nargs=+ HiLink hi def link -HiLink Quote Special -HiLink sqlComment Comment -HiLink sqlFunction Function -HiLink sqlKeyword sqlSpecial -HiLink sqlNumber Number -HiLink sqlOperator sqlStatement -HiLink sqlSpecial Special -HiLink sqlStatement Statement -HiLink sqlString String -HiLink sqlType Type -HiLink sqlTodo Todo +hi def link Quote Special +hi def link sqlComment Comment +hi def link sqlFunction Function +hi def link sqlKeyword sqlSpecial +hi def link sqlNumber Number +hi def link sqlOperator sqlStatement +hi def link sqlSpecial Special +hi def link sqlStatement Statement +hi def link sqlString String +hi def link sqlType Type +hi def link sqlTodo Todo -delcommand HiLink let b:current_syntax = "sql" " vim: ts=8 diff --git a/runtime/syntax/sqr.vim b/runtime/syntax/sqr.vim index 8c9e7b49e4..40b48358c6 100644 --- a/runtime/syntax/sqr.vim +++ b/runtime/syntax/sqr.vim @@ -16,19 +16,12 @@ " http://lanzarotta.tripod.com/vim.html " jefflanzarotta at yahoo dot com -" For version 5.x, clear all syntax items. -" For version 6.x, quit when a syntax file was already loaded. -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif -if version >= 600 - setlocal iskeyword=@,48-57,_,-,#,$,{,} -else - set iskeyword=@,48-57,_,-,#,$,{,} -endif +setlocal iskeyword=@,48-57,_,-,#,$,{,} syn case ignore @@ -220,75 +213,49 @@ syn match sqrNumber /-\=\<\d*\.\=[0-9_]\>/ syn keyword sqrTodo TODO FIXME XXX DEBUG NOTE ### syn match sqrTodo /???/ -if version >= 600 - " See also the sqrString section above for handling of ! characters - " inside of strings. (Those patterns override the ones below.) - syn match sqrComment /!\@= 508 || !exists("did_sqr_syn_inits") - if version < 508 - let did_sqr_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet. - HiLink sqrSection Statement - HiLink sqrParagraph Statement - HiLink sqrReserved Statement - HiLink sqrParameter Statement - HiLink sqrPreProc PreProc - HiLink sqrSubstVar PreProc - HiLink sqrCommand Statement - HiLink sqrParam Type - HiLink sqrFunction Special +hi def link sqrSection Statement +hi def link sqrParagraph Statement +hi def link sqrReserved Statement +hi def link sqrParameter Statement +hi def link sqrPreProc PreProc +hi def link sqrSubstVar PreProc +hi def link sqrCommand Statement +hi def link sqrParam Type +hi def link sqrFunction Special - HiLink sqrString String - HiLink sqrStrOpen Todo - HiLink sqrNumber Number - HiLink sqrVariable Identifier +hi def link sqrString String +hi def link sqrStrOpen Todo +hi def link sqrNumber Number +hi def link sqrVariable Identifier - HiLink sqrComment Comment - HiLink sqrTodo Todo - HiLink sqrError Error +hi def link sqrComment Comment +hi def link sqrTodo Todo +hi def link sqrError Error - delcommand HiLink -endif let b:current_syntax = "sqr" diff --git a/runtime/syntax/squid.vim b/runtime/syntax/squid.vim index a8462bbdce..a8abd180a0 100644 --- a/runtime/syntax/squid.vim +++ b/runtime/syntax/squid.vim @@ -7,11 +7,8 @@ " Michael Dotzler -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -123,30 +120,20 @@ syn match squidRegexOpt contained "\(^\s*acl\s\+\S\+\s\+\S\+\(_regex\|_mime_type syn sync minlines=3 " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_squid_syntax_inits") - if version < 508 - let did_squid_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink squidTodo Todo - HiLink squidComment Comment - HiLink squidTag Special - HiLink squidConf Keyword - HiLink squidOpt Constant - HiLink squidAction String - HiLink squidNumber Number - HiLink squidIP Number - HiLink squidAcl Keyword - HiLink squidStr String - HiLink squidRegexOpt Special +hi def link squidTodo Todo +hi def link squidComment Comment +hi def link squidTag Special +hi def link squidConf Keyword +hi def link squidOpt Constant +hi def link squidAction String +hi def link squidNumber Number +hi def link squidIP Number +hi def link squidAcl Keyword +hi def link squidStr String +hi def link squidRegexOpt Special - delcommand HiLink -endif let b:current_syntax = "squid" diff --git a/runtime/syntax/srec.vim b/runtime/syntax/srec.vim index 19b6d97426..6ac22d9062 100644 --- a/runtime/syntax/srec.vim +++ b/runtime/syntax/srec.vim @@ -24,11 +24,8 @@ " States in parentheses in the upper format description indicate that they " should not appear in a valid file. -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -63,33 +60,23 @@ syn match srecDataUnexpected "[0-9a-fA-F]\{2}" contained nextgroup=srecDataUnexp syn match srecChecksum "[0-9a-fA-F]\{2}$" contained " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_srec_syntax_inits") - if version < 508 - let did_srec_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - " The default methods for highlighting. Can be overridden later - HiLink srecRecStart srecRecType - HiLink srecRecTypeUnknown srecRecType - HiLink srecRecType WarningMsg - HiLink srecByteCount Constant - hi def srecAddressFieldUnknown term=italic cterm=italic gui=italic - HiLink srecNoAddress DiffAdd - HiLink srecDataAddress Comment - HiLink srecRecCount srecNoAddress - HiLink srecStartAddress srecDataAddress - hi def srecDataOdd term=bold cterm=bold gui=bold - hi def srecDataEven term=NONE cterm=NONE gui=NONE - HiLink srecDataUnexpected Error - HiLink srecChecksum DiffChange +" The default methods for highlighting. Can be overridden later +hi def link srecRecStart srecRecType +hi def link srecRecTypeUnknown srecRecType +hi def link srecRecType WarningMsg +hi def link srecByteCount Constant +hi def srecAddressFieldUnknown term=italic cterm=italic gui=italic +hi def link srecNoAddress DiffAdd +hi def link srecDataAddress Comment +hi def link srecRecCount srecNoAddress +hi def link srecStartAddress srecDataAddress +hi def srecDataOdd term=bold cterm=bold gui=bold +hi def srecDataEven term=NONE cterm=NONE gui=NONE +hi def link srecDataUnexpected Error +hi def link srecChecksum DiffChange - delcommand HiLink -endif let b:current_syntax = "srec" diff --git a/runtime/syntax/sshconfig.vim b/runtime/syntax/sshconfig.vim index 302d073f1e..755d08e768 100644 --- a/runtime/syntax/sshconfig.vim +++ b/runtime/syntax/sshconfig.vim @@ -5,24 +5,17 @@ " Contributor: Leonard Ehrenfried " Contributor: Karsten Hopp " Contributor: Dean, Adam Kenneth -" Last Change: 2016 Aug 11 -" SSH Version: 7.3p1 +" Last Change: 2016 Dec 28 +" SSH Version: 7.4p1 " " Setup -if version >= 600 - if exists("b:current_syntax") - finish - endif -else - syntax clear +" quit when a syntax file was already loaded +if exists("b:current_syntax") + finish endif -if version >= 600 - setlocal iskeyword=_,-,a-z,A-Z,48-57 -else - set iskeyword=_,-,a-z,A-Z,48-57 -endif +setlocal iskeyword=_,-,a-z,A-Z,48-57 " case on @@ -188,6 +181,7 @@ syn keyword sshconfigKeyword IPQoS syn keyword sshconfigKeyword IdentitiesOnly syn keyword sshconfigKeyword IdentityFile syn keyword sshconfigKeyword IgnoreUnknown +syn keyword sshconfigKeyword Include syn keyword sshconfigKeyword IPQoS syn keyword sshconfigKeyword KbdInteractiveAuthentication syn keyword sshconfigKeyword KbdInteractiveDevices @@ -233,40 +227,31 @@ syn keyword sshconfigKeyword VisualHostKey syn keyword sshconfigKeyword XAuthLocation " Define the default highlighting -if version >= 508 || !exists("did_sshconfig_syntax_inits") - if version < 508 - let did_sshconfig_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - HiLink sshconfigComment Comment - HiLink sshconfigTodo Todo - HiLink sshconfigHostPort sshconfigConstant - HiLink sshconfigNumber sshconfigConstant - HiLink sshconfigConstant Constant - HiLink sshconfigYesNo sshconfigEnum - HiLink sshconfigCipher sshconfigEnum - HiLink sshconfigCiphers sshconfigEnum - HiLink sshconfigMAC sshconfigEnum - HiLink sshconfigHostKeyAlgo sshconfigEnum - HiLink sshconfigLogLevel sshconfigEnum - HiLink sshconfigSysLogFacility sshconfigEnum - HiLink sshconfigAddressFamily sshconfigEnum - HiLink sshconfigIPQoS sshconfigEnum - HiLink sshconfigKbdInteractive sshconfigEnum - HiLink sshconfigKexAlgo sshconfigEnum - HiLink sshconfigTunnel sshconfigEnum - HiLink sshconfigPreferredAuth sshconfigEnum - HiLink sshconfigVar sshconfigEnum - HiLink sshconfigEnum Identifier - HiLink sshconfigSpecial Special - HiLink sshconfigKeyword Keyword - HiLink sshconfigHostSect Type - HiLink sshconfigMatch Type - delcommand HiLink -endif +hi def link sshconfigComment Comment +hi def link sshconfigTodo Todo +hi def link sshconfigHostPort sshconfigConstant +hi def link sshconfigNumber sshconfigConstant +hi def link sshconfigConstant Constant +hi def link sshconfigYesNo sshconfigEnum +hi def link sshconfigCipher sshconfigEnum +hi def link sshconfigCiphers sshconfigEnum +hi def link sshconfigMAC sshconfigEnum +hi def link sshconfigHostKeyAlgo sshconfigEnum +hi def link sshconfigLogLevel sshconfigEnum +hi def link sshconfigSysLogFacility sshconfigEnum +hi def link sshconfigAddressFamily sshconfigEnum +hi def link sshconfigIPQoS sshconfigEnum +hi def link sshconfigKbdInteractive sshconfigEnum +hi def link sshconfigKexAlgo sshconfigEnum +hi def link sshconfigTunnel sshconfigEnum +hi def link sshconfigPreferredAuth sshconfigEnum +hi def link sshconfigVar sshconfigEnum +hi def link sshconfigEnum Identifier +hi def link sshconfigSpecial Special +hi def link sshconfigKeyword Keyword +hi def link sshconfigHostSect Type +hi def link sshconfigMatch Type let b:current_syntax = "sshconfig" diff --git a/runtime/syntax/sshdconfig.vim b/runtime/syntax/sshdconfig.vim index 6b7b98d893..3924aaf94a 100644 --- a/runtime/syntax/sshdconfig.vim +++ b/runtime/syntax/sshdconfig.vim @@ -6,24 +6,17 @@ " Contributor: Leonard Ehrenfried " Contributor: Karsten Hopp " Originally: 2009-07-09 -" Last Change: 2016 Mar 1 -" SSH Version: 7.2 +" Last Change: 2017 Oct 25 +" SSH Version: 7.6p1 " " Setup -if version >= 600 - if exists("b:current_syntax") - finish - endif -else - syntax clear +" quit when a syntax file was already loaded +if exists("b:current_syntax") + finish endif -if version >= 600 - setlocal iskeyword=_,-,a-z,A-Z,48-57 -else - set iskeyword=_,-,a-z,A-Z,48-57 -endif +setlocal iskeyword=_,-,a-z,A-Z,48-57 " case on @@ -168,6 +161,7 @@ syn keyword sshdconfigKeyword Compression syn keyword sshdconfigKeyword DebianBanner syn keyword sshdconfigKeyword DenyGroups syn keyword sshdconfigKeyword DenyUsers +syn keyword sshdconfigKeyword DisableForwarding syn keyword sshdconfigKeyword ForceCommand syn keyword sshdconfigKeyword GSSAPIAuthentication syn keyword sshdconfigKeyword GSSAPICleanupCredentials @@ -230,7 +224,6 @@ syn keyword sshdconfigKeyword TrustedUserCAKeys syn keyword sshdconfigKeyword UseDNS syn keyword sshdconfigKeyword UseLogin syn keyword sshdconfigKeyword UsePAM -syn keyword sshdconfigKeyword UsePrivilegeSeparation syn keyword sshdconfigKeyword VersionAddendum syn keyword sshdconfigKeyword X11DisplayOffset syn keyword sshdconfigKeyword X11Forwarding @@ -239,43 +232,34 @@ syn keyword sshdconfigKeyword XAuthLocation " Define the default highlighting -if version >= 508 || !exists("did_sshdconfig_syntax_inits") - if version < 508 - let did_sshdconfig_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - HiLink sshdconfigComment Comment - HiLink sshdconfigTodo Todo - HiLink sshdconfigHostPort sshdconfigConstant - HiLink sshdconfigTime sshdconfigConstant - HiLink sshdconfigNumber sshdconfigConstant - HiLink sshdconfigConstant Constant - HiLink sshdconfigYesNo sshdconfigEnum - HiLink sshdconfigAddressFamily sshdconfigEnum - HiLink sshdconfigPrivilegeSeparation sshdconfigEnum - HiLink sshdconfigTcpForwarding sshdconfigEnum - HiLink sshdconfigRootLogin sshdconfigEnum - HiLink sshdconfigCiphers sshdconfigEnum - HiLink sshdconfigMAC sshdconfigEnum - HiLink sshdconfigHostKeyAlgo sshdconfigEnum - HiLink sshdconfigRootLogin sshdconfigEnum - HiLink sshdconfigLogLevel sshdconfigEnum - HiLink sshdconfigSysLogFacility sshdconfigEnum - HiLink sshdconfigVar sshdconfigEnum - HiLink sshdconfigCompression sshdconfigEnum - HiLink sshdconfigIPQoS sshdconfigEnum - HiLink sshdconfigKexAlgo sshdconfigEnum - HiLink sshdconfigTunnel sshdconfigEnum - HiLink sshdconfigSubsystem sshdconfigEnum - HiLink sshdconfigEnum Function - HiLink sshdconfigSpecial Special - HiLink sshdconfigKeyword Keyword - HiLink sshdconfigMatch Type - delcommand HiLink -endif +hi def link sshdconfigComment Comment +hi def link sshdconfigTodo Todo +hi def link sshdconfigHostPort sshdconfigConstant +hi def link sshdconfigTime sshdconfigConstant +hi def link sshdconfigNumber sshdconfigConstant +hi def link sshdconfigConstant Constant +hi def link sshdconfigYesNo sshdconfigEnum +hi def link sshdconfigAddressFamily sshdconfigEnum +hi def link sshdconfigPrivilegeSeparation sshdconfigEnum +hi def link sshdconfigTcpForwarding sshdconfigEnum +hi def link sshdconfigRootLogin sshdconfigEnum +hi def link sshdconfigCiphers sshdconfigEnum +hi def link sshdconfigMAC sshdconfigEnum +hi def link sshdconfigHostKeyAlgo sshdconfigEnum +hi def link sshdconfigRootLogin sshdconfigEnum +hi def link sshdconfigLogLevel sshdconfigEnum +hi def link sshdconfigSysLogFacility sshdconfigEnum +hi def link sshdconfigVar sshdconfigEnum +hi def link sshdconfigCompression sshdconfigEnum +hi def link sshdconfigIPQoS sshdconfigEnum +hi def link sshdconfigKexAlgo sshdconfigEnum +hi def link sshdconfigTunnel sshdconfigEnum +hi def link sshdconfigSubsystem sshdconfigEnum +hi def link sshdconfigEnum Function +hi def link sshdconfigSpecial Special +hi def link sshdconfigKeyword Keyword +hi def link sshdconfigMatch Type let b:current_syntax = "sshdconfig" diff --git a/runtime/syntax/st.vim b/runtime/syntax/st.vim index 47aa07de5d..8160c7704a 100644 --- a/runtime/syntax/st.vim +++ b/runtime/syntax/st.vim @@ -3,11 +3,8 @@ " Maintainer: Arndt Hesse " Last Change: 2012 Feb 12 by Thilo Six -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -77,30 +74,20 @@ hi link stBlockError stError syn sync minlines=50 " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_st_syntax_inits") - if version < 508 - let did_st_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink stKeyword Statement - HiLink stMethod Statement - HiLink stComment Comment - HiLink stCharacter Constant - HiLink stString Constant - HiLink stSymbol Special - HiLink stNumber Type - HiLink stFloat Type - HiLink stError Error - HiLink stLocalVariables Identifier - HiLink stBlockVariable Identifier +hi def link stKeyword Statement +hi def link stMethod Statement +hi def link stComment Comment +hi def link stCharacter Constant +hi def link stString Constant +hi def link stSymbol Special +hi def link stNumber Type +hi def link stFloat Type +hi def link stError Error +hi def link stLocalVariables Identifier +hi def link stBlockVariable Identifier - delcommand HiLink -endif let b:current_syntax = "st" diff --git a/runtime/syntax/stata.vim b/runtime/syntax/stata.vim index e1f19c84fc..29f5052ebe 100644 --- a/runtime/syntax/stata.vim +++ b/runtime/syntax/stata.vim @@ -12,9 +12,8 @@ " 26apr2006 fixed brace confusion in stataErrInParen and stataErrInBracket " fixed paren/bracket confusion in stataFuncGroup -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif diff --git a/runtime/syntax/stp.vim b/runtime/syntax/stp.vim index f4f0f3b615..2992d8be47 100644 --- a/runtime/syntax/stp.vim +++ b/runtime/syntax/stp.vim @@ -4,11 +4,8 @@ " URL: http://lanzarotta.tripod.com/vim/syntax/stp.vim.zip " Last Change: March 05, 2002 -" For version 5.x, clear all syntax items. -" For version 6.x, quit when a syntax file was already loaded. -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -131,36 +128,26 @@ syn match stpParenError ")" syn sync minlines=10 maxlines=100 " Define the default highlighting. -" For version 5.x and earlier, only when not done already. -" For version 5.8 and later, only when and item doesn't have highlighting yet. -if version >= 508 || !exists("did_stp_syn_inits") - if version < 508 - let did_stp_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when and item doesn't have highlighting yet. - HiLink stpConditional Conditional - HiLink stpComment Comment - HiLink stpKeyword Keyword - HiLink stpNumber Number - HiLink stpOperator Operator - HiLink stpSpecial Special - HiLink stpStatement Statement - HiLink stpString String - HiLink stpStringError Error - HiLink stpType Type - HiLink stpTodo Todo - HiLink stpFunction Function - HiLink stpGlobals Macro - HiLink stpParen Normal - HiLink stpParenError Error - HiLink stpSQLKeyword Function - HiLink stpRepeat Repeat +hi def link stpConditional Conditional +hi def link stpComment Comment +hi def link stpKeyword Keyword +hi def link stpNumber Number +hi def link stpOperator Operator +hi def link stpSpecial Special +hi def link stpStatement Statement +hi def link stpString String +hi def link stpStringError Error +hi def link stpType Type +hi def link stpTodo Todo +hi def link stpFunction Function +hi def link stpGlobals Macro +hi def link stpParen Normal +hi def link stpParenError Error +hi def link stpSQLKeyword Function +hi def link stpRepeat Repeat - delcommand HiLink -endif let b:current_syntax = "stp" diff --git a/runtime/syntax/strace.vim b/runtime/syntax/strace.vim index 0f686fd808..206c58919e 100644 --- a/runtime/syntax/strace.vim +++ b/runtime/syntax/strace.vim @@ -5,12 +5,9 @@ " Last Change: 2015-01-16 " Setup -if version >= 600 - if exists("b:current_syntax") - finish - endif -else - syntax clear +" quit when a syntax file was already loaded +if exists("b:current_syntax") + finish endif syn case match @@ -35,31 +32,22 @@ syn match straceOperator "[-+=*/!%&|:,]" syn region straceComment start="/\*" end="\*/" oneline " Define the default highlighting -if version >= 508 || !exists("did_strace_syntax_inits") - if version < 508 - let did_strace_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - HiLink straceComment Comment - HiLink straceVerbosed Comment - HiLink stracePID PreProc - HiLink straceNumber Number - HiLink straceNumberRHS Type - HiLink straceOtherRHS Type - HiLink straceString String - HiLink straceConstant Function - HiLink straceEquals Type - HiLink straceSysCallEmbed straceSysCall - HiLink straceSysCall Statement - HiLink straceParenthesis Statement - HiLink straceOperator Normal - HiLink straceSpecialChar Special - HiLink straceOtherPID PreProc +hi def link straceComment Comment +hi def link straceVerbosed Comment +hi def link stracePID PreProc +hi def link straceNumber Number +hi def link straceNumberRHS Type +hi def link straceOtherRHS Type +hi def link straceString String +hi def link straceConstant Function +hi def link straceEquals Type +hi def link straceSysCallEmbed straceSysCall +hi def link straceSysCall Statement +hi def link straceParenthesis Statement +hi def link straceOperator Normal +hi def link straceSpecialChar Special +hi def link straceOtherPID PreProc - delcommand HiLink -endif let b:current_syntax = "strace" diff --git a/runtime/syntax/sudoers.vim b/runtime/syntax/sudoers.vim index fffc1cf8bb..df1eb99b42 100644 --- a/runtime/syntax/sudoers.vim +++ b/runtime/syntax/sudoers.vim @@ -1,7 +1,7 @@ " Vim syntax file -" Language: sudoers(5) configuration files -" Maintainer: Nikolai Weibull -" Latest Revision: 2011-02-24 +" Language: sudoers(5) configuration files +" Previous Maintainer: Nikolai Weibull +" Latest Revision: 2011-02-24 if exists("b:current_syntax") finish diff --git a/runtime/syntax/svn.vim b/runtime/syntax/svn.vim index 6536d6d11c..6239790f12 100644 --- a/runtime/syntax/svn.vim +++ b/runtime/syntax/svn.vim @@ -15,11 +15,8 @@ " Myk Taylor " Stefano Zacchiroli -" For version 5.x: Clear all syntax items. -" For version 6.x: Quit when a syntax file was already loaded. -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded. +if exists("b:current_syntax") finish endif @@ -42,28 +39,18 @@ syn sync clear syn sync match svnSync grouphere svnRegion "^--.*--$"me=s-1 " Define the default highlighting. -" For version 5.7 and earlier: only when not done already. -" For version 5.8 and later: only when an item doesn't have highlighting yet. -if version >= 508 || !exists("did_svn_syn_inits") - if version <= 508 - let did_svn_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet. - HiLink svnSummary Keyword - HiLink svnBlank Error +hi def link svnSummary Keyword +hi def link svnBlank Error - HiLink svnRegion Comment - HiLink svnDelimiter NonText - HiLink svnRemoved Constant - HiLink svnAdded Identifier - HiLink svnModified Special - HiLink svnProperty Special - HiLink svnRenamed Special +hi def link svnRegion Comment +hi def link svnDelimiter NonText +hi def link svnRemoved Constant +hi def link svnAdded Identifier +hi def link svnModified Special +hi def link svnProperty Special +hi def link svnRenamed Special - delcommand HiLink -endif let b:current_syntax = "svn" diff --git a/runtime/syntax/synload.vim b/runtime/syntax/synload.vim index 6183f33a59..ab918c645b 100644 --- a/runtime/syntax/synload.vim +++ b/runtime/syntax/synload.vim @@ -1,6 +1,6 @@ " Vim syntax support file " Maintainer: Bram Moolenaar -" Last Change: 2012 Sep 25 +" Last Change: 2016 Nov 04 " This file sets up for syntax highlighting. " It is loaded from "syntax.vim" and "manual.vim". @@ -69,8 +69,11 @@ au Syntax c,cpp,cs,idl,java,php,datascript " Source the user-specified syntax highlighting file -if exists("mysyntaxfile") && filereadable(expand(mysyntaxfile)) - execute "source " . mysyntaxfile +if exists("mysyntaxfile") + let s:fname = expand(mysyntaxfile) + if filereadable(s:fname) + execute "source " . fnameescape(s:fname) + endif endif " Restore 'cpoptions' diff --git a/runtime/syntax/sysctl.vim b/runtime/syntax/sysctl.vim index 748054fd73..d99ac01835 100644 --- a/runtime/syntax/sysctl.vim +++ b/runtime/syntax/sysctl.vim @@ -1,7 +1,7 @@ " Vim syntax file -" Language: sysctl.conf(5) configuration file -" Maintainer: Nikolai Weibull -" Latest Revision: 2011-05-02 +" Language: sysctl.conf(5) configuration file +" Previous Maintainer: Nikolai Weibull +" Latest Revision: 2011-05-02 if exists("b:current_syntax") finish diff --git a/runtime/syntax/systemverilog.vim b/runtime/syntax/systemverilog.vim index 5bf2935078..f99ea8d889 100644 --- a/runtime/syntax/systemverilog.vim +++ b/runtime/syntax/systemverilog.vim @@ -3,21 +3,14 @@ " Maintainer: kocha " Last Change: 12-Aug-2013. -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif " Read in Verilog syntax files -if version < 600 - so :p:h/verilog.vim -else - runtime! syntax/verilog.vim - unlet b:current_syntax -endif +runtime! syntax/verilog.vim +unlet b:current_syntax " IEEE1800-2005 syn keyword systemverilogStatement always_comb always_ff always_latch @@ -76,25 +69,16 @@ syn keyword systemverilogStatement implements syn keyword systemverilogStatement interconnect soft nettype " Define the default highlighting. -if version >= 508 || !exists("did_systemverilog_syn_inits") - if version < 508 - let did_systemverilog_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - " The default highlighting. - HiLink systemverilogStatement Statement - HiLink systemverilogTypeDef TypeDef - HiLink systemverilogConditional Conditional - HiLink systemverilogRepeat Repeat - HiLink systemverilogLabel Label - HiLink systemverilogGlobal Define - HiLink systemverilogNumber Number +" The default highlighting. +hi def link systemverilogStatement Statement +hi def link systemverilogTypeDef TypeDef +hi def link systemverilogConditional Conditional +hi def link systemverilogRepeat Repeat +hi def link systemverilogLabel Label +hi def link systemverilogGlobal Define +hi def link systemverilogNumber Number - delcommand HiLink -endif let b:current_syntax = "systemverilog" diff --git a/runtime/syntax/tads.vim b/runtime/syntax/tads.vim index 260ff360f7..23a65b99ec 100644 --- a/runtime/syntax/tads.vim +++ b/runtime/syntax/tads.vim @@ -13,11 +13,8 @@ " Actually, should cvtstr etc. be functions?! (change tadsFunction) " Make global etc. into Identifiers, since we don't have regular variables? -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -122,57 +119,47 @@ endif execute "syn sync maxlines=" . tads_sync_dist " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_tads_syn_inits") - if version < 508 - let did_tads_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - " The default methods for highlighting. Can be overridden later - HiLink tadsFunctionDef Function - HiLink tadsFunction Structure - HiLink tadsClass Structure - HiLink tadsClassDef Identifier - HiLink tadsObjectDef Identifier +" The default methods for highlighting. Can be overridden later +hi def link tadsFunctionDef Function +hi def link tadsFunction Structure +hi def link tadsClass Structure +hi def link tadsClassDef Identifier +hi def link tadsObjectDef Identifier " no highlight for tadsEmbedded, so it prints as normal text w/in the string - HiLink tadsOperator Operator - HiLink tadsStructure Structure - HiLink tadsTodo Todo - HiLink tadsLabel Label - HiLink tadsConditional Conditional - HiLink tadsRepeat Repeat - HiLink tadsException Exception - HiLink tadsStatement Statement - HiLink tadsStorageClass StorageClass - HiLink tadsKeyWord Keyword - HiLink tadsSpecial SpecialChar - HiLink tadsNumber Number - HiLink tadsBoolean Boolean - HiLink tadsDoubleString tadsString - HiLink tadsSingleString tadsString +hi def link tadsOperator Operator +hi def link tadsStructure Structure +hi def link tadsTodo Todo +hi def link tadsLabel Label +hi def link tadsConditional Conditional +hi def link tadsRepeat Repeat +hi def link tadsException Exception +hi def link tadsStatement Statement +hi def link tadsStorageClass StorageClass +hi def link tadsKeyWord Keyword +hi def link tadsSpecial SpecialChar +hi def link tadsNumber Number +hi def link tadsBoolean Boolean +hi def link tadsDoubleString tadsString +hi def link tadsSingleString tadsString - HiLink tadsOctalError tadsError - HiLink tadsCommentError tadsError - HiLink tadsBraceError tadsError - HiLink tadsInBrace tadsError - HiLink tadsError Error +hi def link tadsOctalError tadsError +hi def link tadsCommentError tadsError +hi def link tadsBraceError tadsError +hi def link tadsInBrace tadsError +hi def link tadsError Error - HiLink tadsInclude Include - HiLink tadsPreProc PreProc - HiLink tadsDefine Macro - HiLink tadsIncluded tadsString - HiLink tadsPreCondit PreCondit +hi def link tadsInclude Include +hi def link tadsPreProc PreProc +hi def link tadsDefine Macro +hi def link tadsIncluded tadsString +hi def link tadsPreCondit PreCondit - HiLink tadsString String - HiLink tadsComment Comment +hi def link tadsString String +hi def link tadsComment Comment - delcommand HiLink -endif let b:current_syntax = "tads" diff --git a/runtime/syntax/tags.vim b/runtime/syntax/tags.vim index c86f17a618..f34696d4b0 100644 --- a/runtime/syntax/tags.vim +++ b/runtime/syntax/tags.vim @@ -1,47 +1,31 @@ " Language: tags " Maintainer: Charles E. Campbell -" Last Change: Oct 23, 2014 -" Version: 4 +" Last Change: Oct 26, 2016 +" Version: 7 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_TAGS -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif -syn match tagName "^[^\t]\+" skipwhite nextgroup=tagPath -syn match tagPath "[^\t]\+" contained skipwhite nextgroup=tagAddr contains=tagBaseFile +syn match tagName "^[^\t]\+" skipwhite nextgroup=tagPath +syn match tagPath "[^\t]\+" contained skipwhite nextgroup=tagAddr contains=tagBaseFile syn match tagBaseFile "[a-zA-Z_]\+[\.a-zA-Z_0-9]*\t"me=e-1 contained -syn match tagAddr "\d*" contained skipwhite nextgroup=tagComment -syn region tagAddr matchgroup=tagDelim start="/" skip="\(\\\\\)*\\/" matchgroup=tagDelim end="$\|/" oneline contained skipwhite nextgroup=tagComment -syn match tagComment ";.*$" contained contains=tagField +syn match tagAddr "\d*" contained skipwhite nextgroup=tagComment +syn region tagAddr matchgroup=tagDelim start="/" skip="\(\\\\\)*\\/" matchgroup=tagDelim end="$\|/" oneline contained skipwhite nextgroup=tagComment +syn match tagComment ";.*$" contained contains=tagField syn match tagComment "^!_TAG_.*$" -syn match tagField contained "[a-z]*:" +syn match tagField contained "[a-z]*:" " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_drchip_tags_inits") - if version < 508 - let did_drchip_tags_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - - HiLink tagBaseFile PreProc - HiLink tagComment Comment - HiLink tagDelim Delimiter - HiLink tagField Number - HiLink tagName Identifier - HiLink tagPath PreProc - - delcommand HiLink +if !exists("skip_drchip_tags_inits") + hi def link tagBaseFile PreProc + hi def link tagComment Comment + hi def link tagDelim Delimiter + hi def link tagField Number + hi def link tagName Identifier + hi def link tagPath PreProc endif let b:current_syntax = "tags" - -" vim: ts=12 diff --git a/runtime/syntax/tak.vim b/runtime/syntax/tak.vim index 20186db143..7a8fceb860 100644 --- a/runtime/syntax/tak.vim +++ b/runtime/syntax/tak.vim @@ -8,11 +8,8 @@ -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -32,11 +29,7 @@ syn case ignore let fortran_free_source=1 " Load FORTRAN syntax file -if version < 600 - source :p:h/fortran.vim -else - runtime! syntax/fortran.vim -endif +runtime! syntax/fortran.vim unlet b:current_syntax @@ -95,40 +88,30 @@ endif " Define the default highlighting -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_tak_syntax_inits") - if version < 508 - let did_tak_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink takMacro Macro - HiLink takOptions Special - HiLink takRoutine Type - HiLink takControl Special - HiLink takSolids Special - HiLink takSolidsArg Statement - HiLink takIdentifier Identifier +hi def link takMacro Macro +hi def link takOptions Special +hi def link takRoutine Type +hi def link takControl Special +hi def link takSolids Special +hi def link takSolidsArg Statement +hi def link takIdentifier Identifier - HiLink takFortran PreProc - HiLink takMotran PreProc +hi def link takFortran PreProc +hi def link takMotran PreProc - HiLink takComment Comment - HiLink takHeader Typedef - HiLink takIncludeFile Type - HiLink takInteger Number - HiLink takFloat Float - HiLink takScientific Float +hi def link takComment Comment +hi def link takHeader Typedef +hi def link takIncludeFile Type +hi def link takInteger Number +hi def link takFloat Float +hi def link takScientific Float - HiLink takEndData Macro +hi def link takEndData Macro - HiLink takTodo Todo +hi def link takTodo Todo - delcommand HiLink -endif let b:current_syntax = "tak" diff --git a/runtime/syntax/takcmp.vim b/runtime/syntax/takcmp.vim index a94609b325..9426e02223 100644 --- a/runtime/syntax/takcmp.vim +++ b/runtime/syntax/takcmp.vim @@ -8,11 +8,8 @@ -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -51,30 +48,20 @@ syn case ignore " Define the default highlighting -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_takcmp_syntax_inits") - if version < 508 - let did_takcmp_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink takcmpTitle Type - HiLink takcmpUnit PreProc +hi def link takcmpTitle Type +hi def link takcmpUnit PreProc - HiLink takcmpLabel Statement +hi def link takcmpLabel Statement - HiLink takcmpHeader takHeader +hi def link takcmpHeader takHeader - HiLink takcmpDate Identifier - HiLink takcmpTime Identifier - HiLink takcmpInteger Number - HiLink takcmpFloat Special +hi def link takcmpDate Identifier +hi def link takcmpTime Identifier +hi def link takcmpInteger Number +hi def link takcmpFloat Special - delcommand HiLink -endif let b:current_syntax = "takcmp" diff --git a/runtime/syntax/takout.vim b/runtime/syntax/takout.vim index 774353942a..5e5d360767 100644 --- a/runtime/syntax/takout.vim +++ b/runtime/syntax/takout.vim @@ -8,11 +8,8 @@ -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -24,11 +21,7 @@ syn case match " Load TAK syntax file -if version < 600 - source :p:h/tak.vim -else - runtime! syntax/tak.vim -endif +runtime! syntax/tak.vim unlet b:current_syntax @@ -70,31 +63,21 @@ syn match takoutError "<<< Error >>>" " Define the default highlighting -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_takout_syntax_inits") - if version < 508 - let did_takout_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink takoutPos Statement - HiLink takoutNeg PreProc - HiLink takoutTitle Type - HiLink takoutFile takIncludeFile - HiLink takoutInteger takInteger +hi def link takoutPos Statement +hi def link takoutNeg PreProc +hi def link takoutTitle Type +hi def link takoutFile takIncludeFile +hi def link takoutInteger takInteger - HiLink takoutSectionDelim Delimiter - HiLink takoutSectionTitle Exception - HiLink takoutHeaderDelim SpecialComment - HiLink takoutLabel Identifier +hi def link takoutSectionDelim Delimiter +hi def link takoutSectionTitle Exception +hi def link takoutHeaderDelim SpecialComment +hi def link takoutLabel Identifier - HiLink takoutError Error +hi def link takoutError Error - delcommand HiLink -endif let b:current_syntax = "takout" diff --git a/runtime/syntax/tap.vim b/runtime/syntax/tap.vim new file mode 100644 index 0000000000..db37bb8980 --- /dev/null +++ b/runtime/syntax/tap.vim @@ -0,0 +1,97 @@ +" Vim syntax file +" Language: Verbose TAP Output +" Maintainer: Rufus Cable +" Remark: Simple syntax highlighting for TAP output +" License: +" Copyright: (c) 2008-2013 Rufus Cable +" Last Change: 2014-12-13 + +if exists("b:current_syntax") + finish +endif + +syn match tapTestDiag /^ *#.*/ contains=tapTestTodo +syn match tapTestTime /^ *\[\d\d:\d\d:\d\d\].*/ contains=tapTestFile +syn match tapTestFile /\w\+\/[^. ]*/ contained +syn match tapTestFileWithDot /\w\+\/[^ ]*/ contained + +syn match tapTestPlan /^ *\d\+\.\.\d\+$/ + +" tapTest is a line like 'ok 1', 'not ok 2', 'ok 3 - xxxx' +syn match tapTest /^ *\(not \)\?ok \d\+.*/ contains=tapTestStatusOK,tapTestStatusNotOK,tapTestLine + +" tapTestLine is the line without the ok/not ok status - i.e. number and +" optional message +syn match tapTestLine /\d\+\( .*\|$\)/ contains=tapTestNumber,tapTestLoadMessage,tapTestTodo,tapTestSkip contained + +" turn ok/not ok messages green/red respectively +syn match tapTestStatusOK /ok/ contained +syn match tapTestStatusNotOK /not ok/ contained + +" highlight todo tests +syn match tapTestTodo /\(# TODO\|Failed (TODO)\) .*$/ contained contains=tapTestTodoRev +syn match tapTestTodoRev /\/ contained + +" highlight skipped tests +syn match tapTestSkip /# skip .*$/ contained contains=tapTestSkipTag +syn match tapTestSkipTag /\(# \)\@<=skip\>/ contained + +" look behind so "ok 123" and "not ok 124" match test number +syn match tapTestNumber /\(ok \)\@<=\d\d*/ contained +syn match tapTestLoadMessage /\*\*\*.*\*\*\*/ contained contains=tapTestThreeStars,tapTestFileWithDot +syn match tapTestThreeStars /\*\*\*/ contained + +syn region tapTestRegion start=/^ *\(not \)\?ok.*$/me=e+1 end=/^\(\(not \)\?ok\|# Looks like you planned \|All tests successful\|Bailout called\)/me=s-1 fold transparent excludenl +syn region tapTestResultsOKRegion start=/^\(All tests successful\|Result: PASS\)/ end=/$/ +syn region tapTestResultsNotOKRegion start=/^\(# Looks like you planned \|Bailout called\|# Looks like you failed \|Result: FAIL\)/ end=/$/ +syn region tapTestResultsSummaryRegion start=/^Test Summary Report/ end=/^Files=.*$/ contains=tapTestResultsSummaryHeading,tapTestResultsSummaryNotOK + +syn region tapTestResultsSummaryHeading start=/^Test Summary Report/ end=/^-\+$/ contained +syn region tapTestResultsSummaryNotOK start=/TODO passed:/ end=/$/ contained + +syn region tapTestInstructionsRegion start=/\%1l/ end=/^$/ + +set foldtext=TAPTestLine_foldtext() +function! TAPTestLine_foldtext() + let line = getline(v:foldstart) + let sub = substitute(line, '/\*\|\*/\|{{{\d\=', '', 'g') + return sub +endfunction + +set foldminlines=5 +set foldcolumn=2 +set foldenable +set foldmethod=syntax +syn sync fromstart + +if !exists("did_tapverboseoutput_syntax_inits") + let did_tapverboseoutput_syntax_inits = 1 + + hi tapTestStatusOK term=bold ctermfg=green guifg=Green + hi tapTestStatusNotOK term=reverse ctermfg=black ctermbg=red guifg=Black guibg=Red + hi tapTestTodo term=bold ctermfg=yellow ctermbg=black guifg=Yellow guibg=Black + hi tapTestTodoRev term=reverse ctermfg=black ctermbg=yellow guifg=Black guibg=Yellow + hi tapTestSkip term=bold ctermfg=lightblue guifg=LightBlue + hi tapTestSkipTag term=reverse ctermfg=black ctermbg=lightblue guifg=Black guibg=LightBlue + hi tapTestTime term=bold ctermfg=blue guifg=Blue + hi tapTestFile term=reverse ctermfg=black ctermbg=yellow guibg=Black guifg=Yellow + hi tapTestLoadedFile term=bold ctermfg=black ctermbg=cyan guibg=Cyan guifg=Black + hi tapTestThreeStars term=reverse ctermfg=blue guifg=Blue + hi tapTestPlan term=bold ctermfg=yellow guifg=Yellow + + hi link tapTestFileWithDot tapTestLoadedFile + hi link tapTestNumber Number + hi link tapTestDiag Comment + + hi tapTestRegion ctermbg=green + + hi tapTestResultsOKRegion ctermbg=green ctermfg=black + hi tapTestResultsNotOKRegion ctermbg=red ctermfg=black + + hi tapTestResultsSummaryHeading ctermbg=blue ctermfg=white + hi tapTestResultsSummaryNotOK ctermbg=red ctermfg=black + + hi tapTestInstructionsRegion ctermbg=lightmagenta ctermfg=black +endif + +let b:current_syntax="tapVerboseOutput" diff --git a/runtime/syntax/taskdata.vim b/runtime/syntax/taskdata.vim index b37c70cc1f..63a8284adf 100644 --- a/runtime/syntax/taskdata.vim +++ b/runtime/syntax/taskdata.vim @@ -4,11 +4,8 @@ " Updated: Wed Jul 8 19:46:20 EDT 2009 -" For version 5.x: Clear all syntax items. -" For version 6.x: Quit when a syntax file was already loaded. -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded. +if exists("b:current_syntax") finish endif let s:keepcpo= &cpo diff --git a/runtime/syntax/taskedit.vim b/runtime/syntax/taskedit.vim index 170153c0ee..d33ca78650 100644 --- a/runtime/syntax/taskedit.vim +++ b/runtime/syntax/taskedit.vim @@ -4,11 +4,8 @@ " Updated: Wed Jul 8 19:46:32 EDT 2009 -" For version 5.x: Clear all syntax items. -" For version 6.x: Quit when a syntax file was already loaded. -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded. +if exists("b:current_syntax") finish endif let s:keepcpo= &cpo diff --git a/runtime/syntax/tasm.vim b/runtime/syntax/tasm.vim index 2f8559610e..c9fc8186d0 100644 --- a/runtime/syntax/tasm.vim +++ b/runtime/syntax/tasm.vim @@ -3,11 +3,8 @@ " Maintaner: FooLman of United Force " Last Change: 2012 Feb 03 by Thilo Six -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -95,32 +92,22 @@ syn match tasmOct "\<[0-7]\+O\>" syn match tasmBin "\<[01]\+B\>" " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_tasm_syntax_inits") - if version < 508 - let did_tasm_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink tasmString String - HiLink tasmDec Number - HiLink tasmHex Number - HiLink tasmOct Number - HiLink tasmBin Number - HiLink tasmInstruction Keyword - HiLink tasmCoprocInstr Keyword - HiLink tasmMMXInst Keyword - HiLink tasmDirective PreProc - HiLink tasmRegister Identifier - HiLink tasmProctype PreProc - HiLink tasmComment Comment - HiLink tasmLabel Label +hi def link tasmString String +hi def link tasmDec Number +hi def link tasmHex Number +hi def link tasmOct Number +hi def link tasmBin Number +hi def link tasmInstruction Keyword +hi def link tasmCoprocInstr Keyword +hi def link tasmMMXInst Keyword +hi def link tasmDirective PreProc +hi def link tasmRegister Identifier +hi def link tasmProctype PreProc +hi def link tasmComment Comment +hi def link tasmLabel Label - delcommand HiLink -endif let b:curret_syntax = "tasm" diff --git a/runtime/syntax/tcl.vim b/runtime/syntax/tcl.vim index 06629d077f..64efd6fec4 100644 --- a/runtime/syntax/tcl.vim +++ b/runtime/syntax/tcl.vim @@ -10,11 +10,8 @@ " Version: 1.14 " URL: http://bitbucket.org/taylor_venable/metasyntax/src/tip/Config/vim/syntax/tcl.vim -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -238,49 +235,39 @@ syn region tclComment start=/;\s*\#/hs=s+1 skip="\\$" end="$" contains=tclTodo "syn sync ccomment tclComment " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_tcl_syntax_inits") - if version < 508 - let did_tcl_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink tcltkSwitch Special - HiLink tclExpand Special - HiLink tclLabel Label - HiLink tclConditional Conditional - HiLink tclRepeat Repeat - HiLink tclNumber Number - HiLink tclError Error - HiLink tclCommand Statement - HiLink tclProcCommand Type - HiLink tclString String - HiLink tclComment Comment - HiLink tclSpecial Special - HiLink tclTodo Todo - " Below here are the commands and their options. - HiLink tcltkCommandColor Statement - HiLink tcltkWidgetColor Structure - HiLink tclLineContinue WarningMsg +hi def link tcltkSwitch Special +hi def link tclExpand Special +hi def link tclLabel Label +hi def link tclConditional Conditional +hi def link tclRepeat Repeat +hi def link tclNumber Number +hi def link tclError Error +hi def link tclCommand Statement +hi def link tclProcCommand Type +hi def link tclString String +hi def link tclComment Comment +hi def link tclSpecial Special +hi def link tclTodo Todo +" Below here are the commands and their options. +hi def link tcltkCommandColor Statement +hi def link tcltkWidgetColor Structure +hi def link tclLineContinue WarningMsg if exists('g:tcl_warn_continuation') - HiLink tclNotLineContinue ErrorMsg +hi def link tclNotLineContinue ErrorMsg endif - HiLink tcltkStringSwitch Special - HiLink tcltkArraySwitch Special - HiLink tcltkLsortSwitch Special - HiLink tcltkPackSwitch Special - HiLink tcltkPackConfSwitch Special - HiLink tcltkMaths Special - HiLink tcltkNamespaceSwitch Special - HiLink tcltkWidgetSwitch Special - HiLink tcltkPackConfColor Identifier - HiLink tclVarRef Identifier +hi def link tcltkStringSwitch Special +hi def link tcltkArraySwitch Special +hi def link tcltkLsortSwitch Special +hi def link tcltkPackSwitch Special +hi def link tcltkPackConfSwitch Special +hi def link tcltkMaths Special +hi def link tcltkNamespaceSwitch Special +hi def link tcltkWidgetSwitch Special +hi def link tcltkPackConfColor Identifier +hi def link tclVarRef Identifier - delcommand HiLink -endif let b:current_syntax = "tcl" diff --git a/runtime/syntax/teraterm.vim b/runtime/syntax/teraterm.vim index 521331d8ce..1924996738 100644 --- a/runtime/syntax/teraterm.vim +++ b/runtime/syntax/teraterm.vim @@ -1,9 +1,9 @@ " Vim syntax file " Language: Tera Term Language (TTL) -" Based on Tera Term Version 4.86 +" Based on Tera Term Version 4.92 " Maintainer: Ken Takata " URL: https://github.com/k-takata/vim-teraterm -" Last Change: 2015 Jun 24 +" Last Change: 2016 Aug 17 " Filenames: *.ttl " License: VIM License @@ -33,7 +33,7 @@ syn keyword ttlOperator and or xor not syn match ttlVar "\" syn match ttlVar "\" -syn keyword ttlVar inputstr matchstr paramcnt result timeout mtimeout +syn keyword ttlVar inputstr matchstr paramcnt params result timeout mtimeout syn match ttlLine nextgroup=ttlStatement "^" diff --git a/runtime/syntax/terminfo.vim b/runtime/syntax/terminfo.vim index 0ea112ad47..2b0ab0860a 100644 --- a/runtime/syntax/terminfo.vim +++ b/runtime/syntax/terminfo.vim @@ -1,7 +1,7 @@ " Vim syntax file -" Language: terminfo(5) definition -" Maintainer: Nikolai Weibull -" Latest Revision: 2006-04-19 +" Language: terminfo(5) definition +" Previous Maintainer: Nikolai Weibull +" Latest Revision: 2006-04-19 if exists("b:current_syntax") finish diff --git a/runtime/syntax/tex.vim b/runtime/syntax/tex.vim index e560573e6e..d5a5de65c8 100644 --- a/runtime/syntax/tex.vim +++ b/runtime/syntax/tex.vim @@ -1,8 +1,8 @@ " Vim syntax file " Language: TeX " Maintainer: Charles E. Campbell -" Last Change: Jun 17, 2016 -" Version: 97 +" Last Change: Oct 12, 2017 +" Version: 105 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_TEX " " Notes: {{{1 @@ -40,29 +40,14 @@ " using conceal mode :help tex-conceal " Version Clears: {{{1 -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif let s:keepcpo= &cpo set cpo&vim scriptencoding utf-8 -" Define the default highlighting. {{{1 -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_tex_syntax_inits") - let did_tex_syntax_inits = 1 - if version < 508 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif -endif - " by default, enable all region-based highlighting let s:tex_fast= "bcmMprsSvV" if exists("g:tex_fast") @@ -132,14 +117,20 @@ endif " One may override this iskeyword setting by providing " g:tex_isk if exists("g:tex_isk") - exe "setlocal isk=".g:tex_isk -elseif !has("patch-7.4.1142") - setl isk=48-57,a-z,A-Z,192-255 + if b:tex_stylish && g:tex_isk !~ '@' + let b:tex_isk= '@,'.g:tex_isk + else + let b:tex_isk= g:tex_isk + endif +elseif b:tex_stylish + let b:tex_isk="@,48-57,a-z,A-Z,192-255" else - syn iskeyword 48-57,a-z,A-Z,192-255 + let b:tex_isk="48-57,a-z,A-Z,192-255" endif -if b:tex_stylish - setlocal isk+=@-@ +if v:version > 704 || (v:version == 704 && has("patch-7.4.1142")) + exe "syn iskeyword ".b:tex_isk +else + exe "setl isk=".b:tex_isk endif if exists("g:tex_no_error") && g:tex_no_error let s:tex_no_error= 1 @@ -159,7 +150,7 @@ endif " Clusters: {{{1 " -------- -syn cluster texCmdGroup contains=texCmdBody,texComment,texDefParm,texDelimiter,texDocType,texInput,texLength,texLigature,texMathDelim,texMathOper,texNewCmd,texNewEnv,texRefZone,texSection,texBeginEnd,texBeginEndName,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle +syn cluster texCmdGroup contains=texCmdBody,texComment,texDefParm,texDelimiter,texDocType,texInput,texLength,texLigature,texMathDelim,texMathOper,texNewCmd,texNewEnv,texRefZone,texSection,texBeginEnd,texBeginEndName,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,@texMathZones if !s:tex_no_error syn cluster texCmdGroup add=texMathError endif @@ -169,15 +160,17 @@ syn cluster texBoldGroup contains=texAccent,texBadMath,texComment,texDefCmd,tex syn cluster texItalGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texInputFile,texLength,texLigature,texMatcher,texMathZoneV,texMathZoneW,texMathZoneX,texMathZoneY,texMathZoneZ,texNewCmd,texNewEnv,texOnlyMath,texOption,texParen,texRefZone,texSection,texBeginEnd,texSectionZone,texSpaceCode,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone,@texMathZones,texTitle,texAbstract,texItalStyle,texItalBoldStyle,texNoSpell if !s:tex_nospell syn cluster texMatchGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMatcher,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone,texInputFile,texOption,@Spell + syn cluster texMatchNMGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMatcherNM,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone,texInputFile,texOption,@Spell syn cluster texStyleGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone,texInputFile,texOption,texStyleStatement,@Spell,texStyleMatcher else syn cluster texMatchGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMatcher,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone,texInputFile,texOption + syn cluster texMatchNMGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMatcherNM,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone,texInputFile,texOption syn cluster texStyleGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone,texInputFile,texOption,texStyleStatement,texStyleMatcher endif -syn cluster texPreambleMatchGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMatcher,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTitle,texTypeSize,texTypeStyle,texZone,texInputFile,texOption,texMathZoneZ +syn cluster texPreambleMatchGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMatcherNM,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTitle,texTypeSize,texTypeStyle,texZone,texInputFile,texOption,texMathZoneZ syn cluster texRefGroup contains=texMatcher,texComment,texDelimiter if !exists("g:tex_no_math") - syn cluster texPreambleMatchGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMatcher,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTitle,texTypeSize,texTypeStyle,texZone,texInputFile,texOption,texMathZoneZ + syn cluster texPreambleMatchGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMatcherNM,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTitle,texTypeSize,texTypeStyle,texZone,texInputFile,texOption,texMathZoneZ syn cluster texMathZones contains=texMathZoneV,texMathZoneW,texMathZoneX,texMathZoneY,texMathZoneZ syn cluster texMatchGroup add=@texMathZones syn cluster texMathDelimGroup contains=texMathDelimBad,texMathDelimKey,texMathDelimSet1,texMathDelimSet2 @@ -208,9 +201,13 @@ if s:tex_fast =~# 'm' if !s:tex_no_error syn region texMatcher matchgroup=Delimiter start="{" skip="\\\\\|\\[{}]" end="}" transparent contains=@texMatchGroup,texError syn region texMatcher matchgroup=Delimiter start="\[" end="]" transparent contains=@texMatchGroup,texError,@NoSpell + syn region texMatcherNM matchgroup=Delimiter start="{" skip="\\\\\|\\[{}]" end="}" transparent contains=@texMatchNMGroup,texError + syn region texMatcherNM matchgroup=Delimiter start="\[" end="]" transparent contains=@texMatchNMGroup,texError,@NoSpell else syn region texMatcher matchgroup=Delimiter start="{" skip="\\\\\|\\[{}]" end="}" transparent contains=@texMatchGroup syn region texMatcher matchgroup=Delimiter start="\[" end="]" transparent contains=@texMatchGroup + syn region texMatcherNM matchgroup=Delimiter start="{" skip="\\\\\|\\[{}]" end="}" transparent contains=@texMatchNMGroup + syn region texMatcherNM matchgroup=Delimiter start="\[" end="]" transparent contains=@texMatchNMGroup endif if !s:tex_nospell syn region texParen start="(" end=")" transparent contains=@texMatchGroup,@Spell @@ -262,6 +259,7 @@ syn match texAccent +\\[=^.\~"`']+ syn match texAccent +\\['=t'.c^ud"vb~Hr]{\a}+ syn match texLigature "\\\([ijolL]\|ae\|oe\|ss\|AA\|AE\|OE\)$" + " \begin{}/\end{} section markers: {{{1 syn match texBeginEnd "\\begin\>\|\\end\>" nextgroup=texBeginEndName if s:tex_fast =~# 'm' @@ -408,7 +406,7 @@ if !exists("g:tex_no_math") " TexNewMathZone: function creates a mathzone with the given suffix and mathzone name. {{{2 " Starred forms are created if starform is true. Starred " forms have syntax group and synchronization groups with a - " "S" appended. Handles: cluster, syntax, sync, and HiLink. + " "S" appended. Handles: cluster, syntax, sync, and highlighting. fun! TexNewMathZone(sfx,mathzone,starform) let grpname = "texMathZone".a:sfx let syncname = "texSyncMathZone".a:sfx @@ -447,9 +445,8 @@ if !exists("g:tex_no_math") call TexNewMathZone("G","gather",1) call TexNewMathZone("H","math",1) call TexNewMathZone("I","multline",1) - call TexNewMathZone("J","subequations",0) - call TexNewMathZone("K","xalignat",1) - call TexNewMathZone("L","xxalignat",0) + call TexNewMathZone("J","xalignat",1) + call TexNewMathZone("K","xxalignat",0) " Inline Math Zones: {{{2 if s:tex_fast =~# 'M' @@ -481,8 +478,9 @@ if !exists("g:tex_no_math") " \left..something.. and \right..something.. support: {{{2 syn match texMathDelimBad contained "\S" if has("conceal") && &enc == 'utf-8' && s:tex_conceal =~# 'm' - syn match texMathDelim contained "\\left\\{\>" skipwhite nextgroup=texMathDelimSet1,texMathDelimSet2,texMathDelimBad contains=texMathSymbol cchar={ - syn match texMathDelim contained "\\right\\}\>" skipwhite nextgroup=texMathDelimSet1,texMathDelimSet2,texMathDelimBad contains=texMathSymbol cchar=} + syn match texMathDelim contained "\\left\[" + syn match texMathDelim contained "\\left\\{" skipwhite nextgroup=texMathDelimSet1,texMathDelimSet2,texMathDelimBad contains=texMathSymbol cchar={ + syn match texMathDelim contained "\\right\\}" skipwhite nextgroup=texMathDelimSet1,texMathDelimSet2,texMathDelimBad contains=texMathSymbol cchar=} let s:texMathDelimList=[ \ ['<' , '<'] , \ ['>' , '>'] , @@ -497,13 +495,11 @@ if !exists("g:tex_no_math") \ ['\\backslash' , '\'] , \ ['\\downarrow' , '↓'] , \ ['\\Downarrow' , '⇓'] , - \ ['\\langle' , '<'] , \ ['\\lbrace' , '['] , \ ['\\lceil' , '⌈'] , \ ['\\lfloor' , '⌊'] , \ ['\\lgroup' , '⌊'] , \ ['\\lmoustache' , '⎛'] , - \ ['\\rangle' , '>'] , \ ['\\rbrace' , ']'] , \ ['\\rceil' , '⌉'] , \ ['\\rfloor' , '⌋'] , @@ -513,6 +509,15 @@ if !exists("g:tex_no_math") \ ['\\Uparrow' , '↑'] , \ ['\\updownarrow', '↕'] , \ ['\\Updownarrow', '⇕']] + if &ambw == "double" || exists("g:tex_usedblwidth") + let s:texMathDelimList= s:texMathDelimList + [ + \ ['\\langle' , '〈'] , + \ ['\\rangle' , '〉']] + else + let s:texMathDelimList= s:texMathDelimList + [ + \ ['\\langle' , '<'] , + \ ['\\rangle' , '>']] + endif syn match texMathDelim '\\[bB]igg\=[lr]' contained nextgroup=texMathDelimBad for texmath in s:texMathDelimList exe "syn match texMathDelim '\\\\[bB]igg\\=[lr]\\=".texmath[0]."' contained conceal cchar=".texmath[1] @@ -584,6 +589,13 @@ else endif endif +" %begin-include ... %end-include acts like a texDocZone for \include'd files. Permits spell checking, for example, in such files. +if !s:tex_nospell + TexFold syn region texDocZone matchgroup=texSection start='^\s*%begin-include\>' end='^\s*%end-include\>' contains=@texFoldGroup,@texDocGroup,@Spell +else + TexFold syn region texDocZone matchgroup=texSection start='^\s*%begin-include\>' end='^\s*%end-include\>' contains=@texFoldGroup,@texDocGroup +endif + " Separate lines used for verb` and verb# so that the end conditions {{{1 " will appropriately terminate. " If g:tex_verbspell exists, then verbatim texZones will permit spellchecking there. @@ -592,27 +604,17 @@ if s:tex_fast =~# 'v' syn region texZone start="\\begin{[vV]erbatim}" end="\\end{[vV]erbatim}\|%stopzone\>" contains=@Spell " listings package: syn region texZone start="\\begin{lstlisting}" end="\\end{lstlisting}\|%stopzone\>" contains=@Spell - if version < 600 - syn region texZone start="\\verb\*\=`" end="`\|%stopzone\>" contains=@Spell - syn region texZone start="\\verb\*\=#" end="#\|%stopzone\>" contains=@Spell + if b:tex_stylish + syn region texZone start="\\verb\*\=\z([^\ta-zA-Z@]\)" end="\z1\|%stopzone\>" contains=@Spell else - if b:tex_stylish - syn region texZone start="\\verb\*\=\z([^\ta-zA-Z@]\)" end="\z1\|%stopzone\>" contains=@Spell - else - syn region texZone start="\\verb\*\=\z([^\ta-zA-Z]\)" end="\z1\|%stopzone\>" contains=@Spell - endif + syn region texZone start="\\verb\*\=\z([^\ta-zA-Z]\)" end="\z1\|%stopzone\>" contains=@Spell endif else syn region texZone start="\\begin{[vV]erbatim}" end="\\end{[vV]erbatim}\|%stopzone\>" - if version < 600 - syn region texZone start="\\verb\*\=`" end="`\|%stopzone\>" - syn region texZone start="\\verb\*\=#" end="#\|%stopzone\>" + if b:tex_stylish + syn region texZone start="\\verb\*\=\z([^\ta-zA-Z@]\)" end="\z1\|%stopzone\>" else - if b:tex_stylish - syn region texZone start="\\verb\*\=\z([^\ta-zA-Z@]\)" end="\z1\|%stopzone\>" - else - syn region texZone start="\\verb\*\=\z([^\ta-zA-Z]\)" end="\z1\|%stopzone\>" - endif + syn region texZone start="\\verb\*\=\z([^\ta-zA-Z]\)" end="\z1\|%stopzone\>" endif endif endif @@ -693,6 +695,7 @@ if has("conceal") && &enc == 'utf-8' \ ['backslash' , '∖'], \ ['barwedge' , '⊼'], \ ['because' , '∵'], + \ ['beth' , 'ܒ'], \ ['between' , '≬'], \ ['bigcap' , '∩'], \ ['bigcirc' , '○'], @@ -712,6 +715,7 @@ if has("conceal") && &enc == 'utf-8' \ ['boxminus' , '⊟'], \ ['boxplus' , '⊞'], \ ['boxtimes' , '⊠'], + \ ['Box' , '☐'], \ ['bullet' , '•'], \ ['bumpeq' , '≏'], \ ['Bumpeq' , '≎'], @@ -761,6 +765,7 @@ if has("conceal") && &enc == 'utf-8' \ ['eqslantgtr' , '⪖'], \ ['eqslantless' , '⪕'], \ ['equiv' , '≡'], + \ ['eth' , 'ð'], \ ['exists' , '∃'], \ ['fallingdotseq' , '≒'], \ ['flat' , '♭'], @@ -770,6 +775,7 @@ if has("conceal") && &enc == 'utf-8' \ ['geq' , '≥'], \ ['geqq' , '≧'], \ ['gets' , '←'], + \ ['gimel' , 'ℷ'], \ ['gg' , '⟫'], \ ['gneqq' , '≩'], \ ['gtrdot' , '⋗'], @@ -780,13 +786,17 @@ if has("conceal") && &enc == 'utf-8' \ ['heartsuit' , '♡'], \ ['hookleftarrow' , '↩'], \ ['hookrightarrow' , '↪'], + \ ['iff' , '⇔'], \ ['iiint' , '∭'], \ ['iint' , '∬'], \ ['Im' , 'ℑ'], \ ['imath' , 'ɩ'], + \ ['implies' , '⇒'], \ ['in' , '∈'], \ ['infty' , '∞'], \ ['int' , '∫'], + \ ['jmath' , '𝚥'], + \ ['land' , '∧'], \ ['lceil' , '⌈'], \ ['ldots' , '…'], \ ['le' , '≤'], @@ -813,6 +823,7 @@ if has("conceal") && &enc == 'utf-8' \ ['ll' , '≪'], \ ['lmoustache' , '╭'], \ ['lneqq' , '≨'], + \ ['lor' , '∨'], \ ['ltimes' , '⋉'], \ ['mapsto' , '↦'], \ ['measuredangle' , '∡'], @@ -839,6 +850,7 @@ if has("conceal") && &enc == 'utf-8' \ ['nless' , '≮'], \ ['nmid' , '∤'], \ ['notin' , '∉'], + \ ['nparallel' , '∦'], \ ['nprec' , '⊀'], \ ['nrightarrow' , '↛'], \ ['nRightarrow' , '⇏'], @@ -940,10 +952,12 @@ if has("conceal") && &enc == 'utf-8' \ ['trianglerighteq', '⊵'], \ ['twoheadleftarrow', '↞'], \ ['twoheadrightarrow', '↠'], + \ ['ulcorner' , '⌜'], \ ['uparrow' , '↑'], \ ['Uparrow' , '⇑'], \ ['updownarrow' , '↕'], \ ['Updownarrow' , '⇕'], + \ ['urcorner' , '⌝'], \ ['varnothing' , '∅'], \ ['vartriangle' , '∆'], \ ['vdash' , '⊢'], @@ -959,6 +973,15 @@ if has("conceal") && &enc == 'utf-8' " \ ['jmath' , 'X'] " \ ['uminus' , 'X'] " \ ['uplus' , 'X'] + if &ambw == "double" || exists("g:tex_usedblwidth") + let s:texMathList= s:texMathList + [ + \ ['right\\rangle' , '〉'], + \ ['left\\langle' , '〈']] + else + let s:texMathList= s:texMathList + [ + \ ['right\\rangle' , '>'], + \ ['left\\langle' , '<']] + endif for texmath in s:texMathList if texmath[0] =~# '\w$' exe "syn match texMathSymbol '\\\\".texmath[0]."\\>' contained conceal cchar=".texmath[1] @@ -1170,11 +1193,13 @@ if has("conceal") && &enc == 'utf-8' delfun s:SuperSub endif - " Accented characters: {{{2 + " Accented characters and Ligatures: {{{2 if s:tex_conceal =~# 'a' if b:tex_stylish syn match texAccent "\\[bcdvuH][^a-zA-Z@]"me=e-1 - syn match texLigature "\\\([ijolL]\|ae\|oe\|ss\|AA\|AE\|OE\)[^a-zA-Z@]"me=e-1 + syn match texLigature "\\\([ijolL]\|ae\|oe\|ss\|AA\|AE\|OE\)[^a-zA-Z@]"me=e-1 + syn match texLigature '--' + syn match texLigature '---' else fun! s:Accents(chr,...) let i= 1 @@ -1235,15 +1260,17 @@ if has("conceal") && &enc == 'utf-8' call s:Accents('\\i','ì','í','î','ï','ĩ','į',' ',' ',' ',' ',' ','ĭ',' ') " \` \' \^ \" \~ \. \= \c \H \k \r \u \v delfun s:Accents - syn match texAccent '\\aa\>' conceal cchar=å - syn match texAccent '\\AA\>' conceal cchar=Å - syn match texAccent '\\o\>' conceal cchar=ø - syn match texAccent '\\O\>' conceal cchar=Ø + syn match texAccent '\\aa\>' conceal cchar=å + syn match texAccent '\\AA\>' conceal cchar=Å + syn match texAccent '\\o\>' conceal cchar=ø + syn match texAccent '\\O\>' conceal cchar=Ø syn match texLigature '\\AE\>' conceal cchar=Æ syn match texLigature '\\ae\>' conceal cchar=æ syn match texLigature '\\oe\>' conceal cchar=œ syn match texLigature '\\OE\>' conceal cchar=Œ syn match texLigature '\\ss\>' conceal cchar=ß + syn match texLigature '--' conceal cchar=– + syn match texLigature '---' conceal cchar=— endif endif endif @@ -1273,86 +1300,87 @@ endif " --------------------------------------------------------------------- " Highlighting: {{{1 -if did_tex_syntax_inits == 1 - let did_tex_syntax_inits= 2 + +" Define the default highlighting. {{{1 +if !exists("skip_tex_syntax_inits") + " TeX highlighting groups which should share similar highlighting if !exists("g:tex_no_error") if !exists("g:tex_no_math") - HiLink texBadMath texError - HiLink texMathDelimBad texError - HiLink texMathError texError + hi def link texBadMath texError + hi def link texMathDelimBad texError + hi def link texMathError texError if !b:tex_stylish - HiLink texOnlyMath texError + hi def link texOnlyMath texError endif endif - HiLink texError Error + hi def link texError Error endif hi texBoldStyle gui=bold cterm=bold hi texItalStyle gui=italic cterm=italic hi texBoldItalStyle gui=bold,italic cterm=bold,italic hi texItalBoldStyle gui=bold,italic cterm=bold,italic - HiLink texCite texRefZone - HiLink texDefCmd texDef - HiLink texDefName texDef - HiLink texDocType texCmdName - HiLink texDocTypeArgs texCmdArgs - HiLink texInputFileOpt texCmdArgs - HiLink texInputCurlies texDelimiter - HiLink texLigature texSpecialChar + hi def link texCite texRefZone + hi def link texDefCmd texDef + hi def link texDefName texDef + hi def link texDocType texCmdName + hi def link texDocTypeArgs texCmdArgs + hi def link texInputFileOpt texCmdArgs + hi def link texInputCurlies texDelimiter + hi def link texLigature texSpecialChar if !exists("g:tex_no_math") - HiLink texMathDelimSet1 texMathDelim - HiLink texMathDelimSet2 texMathDelim - HiLink texMathDelimKey texMathDelim - HiLink texMathMatcher texMath - HiLink texAccent texStatement - HiLink texGreek texStatement - HiLink texSuperscript texStatement - HiLink texSubscript texStatement - HiLink texSuperscripts texSuperscript - HiLink texSubscripts texSubscript - HiLink texMathSymbol texStatement - HiLink texMathZoneV texMath - HiLink texMathZoneW texMath - HiLink texMathZoneX texMath - HiLink texMathZoneY texMath - HiLink texMathZoneV texMath - HiLink texMathZoneZ texMath + hi def link texMathDelimSet1 texMathDelim + hi def link texMathDelimSet2 texMathDelim + hi def link texMathDelimKey texMathDelim + hi def link texMathMatcher texMath + hi def link texAccent texStatement + hi def link texGreek texStatement + hi def link texSuperscript texStatement + hi def link texSubscript texStatement + hi def link texSuperscripts texSuperscript + hi def link texSubscripts texSubscript + hi def link texMathSymbol texStatement + hi def link texMathZoneV texMath + hi def link texMathZoneW texMath + hi def link texMathZoneX texMath + hi def link texMathZoneY texMath + hi def link texMathZoneV texMath + hi def link texMathZoneZ texMath endif - HiLink texBeginEnd texCmdName - HiLink texBeginEndName texSection - HiLink texSpaceCode texStatement - HiLink texStyleStatement texStatement - HiLink texTypeSize texType - HiLink texTypeStyle texType + hi def link texBeginEnd texCmdName + hi def link texBeginEndName texSection + hi def link texSpaceCode texStatement + hi def link texStyleStatement texStatement + hi def link texTypeSize texType + hi def link texTypeStyle texType " Basic TeX highlighting groups - HiLink texCmdArgs Number - HiLink texCmdName Statement - HiLink texComment Comment - HiLink texDef Statement - HiLink texDefParm Special - HiLink texDelimiter Delimiter - HiLink texInput Special - HiLink texInputFile Special - HiLink texLength Number - HiLink texMath Special - HiLink texMathDelim Statement - HiLink texMathOper Operator - HiLink texNewCmd Statement - HiLink texNewEnv Statement - HiLink texOption Number - HiLink texRefZone Special - HiLink texSection PreCondit - HiLink texSpaceCodeChar Special - HiLink texSpecialChar SpecialChar - HiLink texStatement Statement - HiLink texString String - HiLink texTodo Todo - HiLink texType Type - HiLink texZone PreCondit + hi def link texCmdArgs Number + hi def link texCmdName Statement + hi def link texComment Comment + hi def link texDef Statement + hi def link texDefParm Special + hi def link texDelimiter Delimiter + hi def link texInput Special + hi def link texInputFile Special + hi def link texLength Number + hi def link texMath Special + hi def link texMathDelim Statement + hi def link texMathOper Operator + hi def link texNewCmd Statement + hi def link texNewEnv Statement + hi def link texOption Number + hi def link texRefZone Special + hi def link texSection PreCondit + hi def link texSpaceCodeChar Special + hi def link texSpecialChar SpecialChar + hi def link texStatement Statement + hi def link texString String + hi def link texTodo Todo + hi def link texType Type + hi def link texZone PreCondit - delcommand HiLink endif " Cleanup: {{{1 diff --git a/runtime/syntax/texinfo.vim b/runtime/syntax/texinfo.vim index 134fc6763c..a4b7689707 100644 --- a/runtime/syntax/texinfo.vim +++ b/runtime/syntax/texinfo.vim @@ -9,10 +9,8 @@ " since @ can have special meanings, everything is 'match'-ed and 'region'-ed " (including @ in 'iskeyword' option has unexpected effects) -" Remove any old syntax stuff hanging around, if needed -if version < 600 - syn clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -356,48 +354,37 @@ syn cluster texinfoReducedAll contains=texinfoSpecialChar,texinfoBrcPrmAtCmd "============================================================================== " highlighting -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_texinfo_syn_inits") +" Only when an item doesn't have highlighting yet - if version < 508 - let did_texinfo_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +hi def link texinfoSpecialChar Special +hi def link texinfoHFSpecialChar Special - HiLink texinfoSpecialChar Special - HiLink texinfoHFSpecialChar Special - - HiLink texinfoError Error - HiLink texinfoIdent Identifier - HiLink texinfoAssignment Identifier - HiLink texinfoSinglePar Identifier - HiLink texinfoIndexPar Identifier - HiLink texinfoSIPar Identifier - HiLink texinfoDIEPar Identifier - HiLink texinfoTexCmd PreProc +hi def link texinfoError Error +hi def link texinfoIdent Identifier +hi def link texinfoAssignment Identifier +hi def link texinfoSinglePar Identifier +hi def link texinfoIndexPar Identifier +hi def link texinfoSIPar Identifier +hi def link texinfoDIEPar Identifier +hi def link texinfoTexCmd PreProc - HiLink texinfoAtCmd Statement "@-command - HiLink texinfoPrmAtCmd String "@-command in one line with unknown nr. of parameters - "is String because is found as a region and is 'matchgroup'-ed - "to texinfoAtCmd - HiLink texinfoBrcPrmAtCmd String "@-command with parameter(s) in braces ({}) - "is String because is found as a region and is 'matchgroup'-ed to texinfoAtCmd - HiLink texinfoMltlnAtCmdFLine texinfoAtCmd "repeated embedded First lines in @-commands - HiLink texinfoMltlnAtCmd String "@-command in multiple lines - "is String because is found as a region and is 'matchgroup'-ed to texinfoAtCmd - HiLink texinfoMltln2AtCmd PreProc "@-command in multiple lines (same as texinfoMltlnAtCmd, just with other colors) - HiLink texinfoMltlnDMAtCmd PreProc "@-command in multiple lines (same as texinfoMltlnAtCmd, just with other colors; used for @detailmenu, which can be included in @menu) - HiLink texinfoMltlnNAtCmd Normal "@-command in multiple lines (same as texinfoMltlnAtCmd, just with other colors) - HiLink texinfoThisAtCmd Statement "@-command used in headers and footers (@this... series) +hi def link texinfoAtCmd Statement "@-command +hi def link texinfoPrmAtCmd String "@-command in one line with unknown nr. of parameters + "is String because is found as a region and is 'matchgroup'-ed + "to texinfoAtCmd +hi def link texinfoBrcPrmAtCmd String "@-command with parameter(s) in braces ({}) + "is String because is found as a region and is 'matchgroup'-ed to texinfoAtCmd +hi def link texinfoMltlnAtCmdFLine texinfoAtCmd "repeated embedded First lines in @-commands +hi def link texinfoMltlnAtCmd String "@-command in multiple lines + "is String because is found as a region and is 'matchgroup'-ed to texinfoAtCmd +hi def link texinfoMltln2AtCmd PreProc "@-command in multiple lines (same as texinfoMltlnAtCmd, just with other colors) +hi def link texinfoMltlnDMAtCmd PreProc "@-command in multiple lines (same as texinfoMltlnAtCmd, just with other colors; used for @detailmenu, which can be included in @menu) +hi def link texinfoMltlnNAtCmd Normal "@-command in multiple lines (same as texinfoMltlnAtCmd, just with other colors) +hi def link texinfoThisAtCmd Statement "@-command used in headers and footers (@this... series) - HiLink texinfoComment Comment +hi def link texinfoComment Comment - delcommand HiLink -endif let b:current_syntax = "texinfo" diff --git a/runtime/syntax/texmf.vim b/runtime/syntax/texmf.vim index 7b91168f08..d1268faff7 100644 --- a/runtime/syntax/texmf.vim +++ b/runtime/syntax/texmf.vim @@ -6,12 +6,9 @@ " URL: http://physics.muni.cz/~yeti/download/syntax/texmf.vim " Setup -if version >= 600 - if exists("b:current_syntax") - finish - endif -else - syntax clear +" quit when a syntax file was already loaded +if exists("b:current_syntax") + finish endif syn case match @@ -45,42 +42,33 @@ syn region texmfBrace matchgroup=texmfBraceBrace start="{" end="}" contains=ALLB syn match texmfBraceError "}" " Define the default highlighting -if version >= 508 || !exists("did_texmf_syntax_inits") - if version < 508 - let did_texmf_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - HiLink texmfComment Comment - HiLink texmfTodo Todo +hi def link texmfComment Comment +hi def link texmfTodo Todo - HiLink texmfPassedParameter texmfVariable - HiLink texmfVariable Identifier +hi def link texmfPassedParameter texmfVariable +hi def link texmfVariable Identifier - HiLink texmfNumber Number - HiLink texmfString String +hi def link texmfNumber Number +hi def link texmfString String - HiLink texmfLHSStart texmfLHS - HiLink texmfLHSVariable texmfLHS - HiLink texmfLHSDot texmfLHS - HiLink texmfLHS Type +hi def link texmfLHSStart texmfLHS +hi def link texmfLHSVariable texmfLHS +hi def link texmfLHSDot texmfLHS +hi def link texmfLHS Type - HiLink texmfEquals Normal +hi def link texmfEquals Normal - HiLink texmfBraceBrace texmfDelimiter - HiLink texmfComma texmfDelimiter - HiLink texmfColons texmfDelimiter - HiLink texmfDelimiter Preproc +hi def link texmfBraceBrace texmfDelimiter +hi def link texmfComma texmfDelimiter +hi def link texmfColons texmfDelimiter +hi def link texmfDelimiter Preproc - HiLink texmfDoubleExclam Statement - HiLink texmfSpecial Special +hi def link texmfDoubleExclam Statement +hi def link texmfSpecial Special - HiLink texmfBraceError texmfError - HiLink texmfError Error +hi def link texmfBraceError texmfError +hi def link texmfError Error - delcommand HiLink -endif let b:current_syntax = "texmf" diff --git a/runtime/syntax/tf.vim b/runtime/syntax/tf.vim index 2a9a999883..47775b8637 100644 --- a/runtime/syntax/tf.vim +++ b/runtime/syntax/tf.vim @@ -9,11 +9,8 @@ " Remove any old syntax stuff hanging around -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -161,44 +158,34 @@ else endif " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_tf_syn_inits") - if version < 508 - let did_tf_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink tfComment Comment - HiLink tfString String - HiLink tfNumber Number - HiLink tfFloat Float - HiLink tfIdentifier Identifier - HiLink tfVar Identifier - HiLink tfWorld Identifier - HiLink tfReadonly Identifier - HiLink tfHook Identifier - HiLink tfFunctions Function - HiLink tfRepeat Repeat - HiLink tfConditional Conditional - HiLink tfLabel Label - HiLink tfStatement Statement - HiLink tfType Type - HiLink tfInclude Include - HiLink tfDefine Define - HiLink tfSpecialChar SpecialChar - HiLink tfSpecialCharEsc SpecialChar - HiLink tfParentError Error - HiLink tfTodo Todo - HiLink tfEndCommand Delimiter - HiLink tfJoinLines Delimiter - HiLink tfOperator Operator - HiLink tfRelation Operator +hi def link tfComment Comment +hi def link tfString String +hi def link tfNumber Number +hi def link tfFloat Float +hi def link tfIdentifier Identifier +hi def link tfVar Identifier +hi def link tfWorld Identifier +hi def link tfReadonly Identifier +hi def link tfHook Identifier +hi def link tfFunctions Function +hi def link tfRepeat Repeat +hi def link tfConditional Conditional +hi def link tfLabel Label +hi def link tfStatement Statement +hi def link tfType Type +hi def link tfInclude Include +hi def link tfDefine Define +hi def link tfSpecialChar SpecialChar +hi def link tfSpecialCharEsc SpecialChar +hi def link tfParentError Error +hi def link tfTodo Todo +hi def link tfEndCommand Delimiter +hi def link tfJoinLines Delimiter +hi def link tfOperator Operator +hi def link tfRelation Operator - delcommand HiLink -endif let b:current_syntax = "tf" diff --git a/runtime/syntax/tli.vim b/runtime/syntax/tli.vim index 5685a6cbf2..b96d4a2119 100644 --- a/runtime/syntax/tli.vim +++ b/runtime/syntax/tli.vim @@ -4,11 +4,8 @@ " Last Change: 2001 May 10 " Version: 1.0 -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -44,27 +41,17 @@ syn match tliComment "#.*" syn case match " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_tli_syntax_inits") - if version < 508 - let did_tli_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink tliNumber Number - HiLink tliString String - HiLink tliComment Comment - HiLink tliSpecial SpecialChar - HiLink tliIdentifier Identifier - HiLink tliObject Statement - HiLink tliField Type - HiLink tliStyle PreProc +hi def link tliNumber Number +hi def link tliString String +hi def link tliComment Comment +hi def link tliSpecial SpecialChar +hi def link tliIdentifier Identifier +hi def link tliObject Statement +hi def link tliField Type +hi def link tliStyle PreProc - delcommand HiLink -endif let b:current_syntax = "tli" diff --git a/runtime/syntax/tmux.vim b/runtime/syntax/tmux.vim new file mode 100644 index 0000000000..1ba5f67736 --- /dev/null +++ b/runtime/syntax/tmux.vim @@ -0,0 +1,124 @@ +" Language: tmux(1) configuration file +" Version: 2.3 (git-14dc2ac) +" URL: https://github.com/ericpruitt/tmux.vim/ +" Maintainer: Eric Pruitt +" License: 2-Clause BSD (http://opensource.org/licenses/BSD-2-Clause) + +if exists("b:current_syntax") + finish +endif + +" Explicitly change compatiblity options to Vim's defaults because this file +" uses line continuations. +let s:original_cpo = &cpo +set cpo&vim + +let b:current_syntax = "tmux" +setlocal iskeyword+=- +syntax case match + +syn keyword tmuxAction none any current other +syn keyword tmuxBoolean off on + +syn keyword tmuxTodo FIXME NOTE TODO XXX contained + +syn match tmuxColour /\ 231 && s:i < 235)) ? 15 : "none" + exec "syn match tmuxColour" . s:i . " /\\/ display" +\ " | highlight tmuxColour" . s:i . " ctermfg=" . s:i . " ctermbg=" . s:bg +endfor + +syn keyword tmuxOptions +\ buffer-limit command-alias default-terminal escape-time exit-unattached +\ focus-events history-file message-limit set-clipboard terminal-overrides +\ assume-paste-time base-index bell-action bell-on-alert default-command +\ default-shell destroy-unattached detach-on-destroy +\ display-panes-active-colour display-panes-colour display-panes-time +\ display-time history-limit key-table lock-after-time lock-command +\ message-attr message-bg message-command-attr message-command-bg +\ message-command-fg message-command-style message-fg message-style mouse +\ prefix prefix2 renumber-windows repeat-time set-titles set-titles-string +\ status status-attr status-bg status-fg status-interval status-justify +\ status-keys status-left status-left-attr status-left-bg status-left-fg +\ status-left-length status-left-style status-position status-right +\ status-right-attr status-right-bg status-right-fg status-right-length +\ status-right-style status-style update-environment visual-activity +\ visual-bell visual-silence word-separators aggressive-resize allow-rename +\ alternate-screen automatic-rename automatic-rename-format +\ clock-mode-colour clock-mode-style force-height force-width +\ main-pane-height main-pane-width mode-attr mode-bg mode-fg mode-keys +\ mode-style monitor-activity monitor-silence other-pane-height +\ other-pane-width pane-active-border-bg pane-active-border-fg +\ pane-active-border-style pane-base-index pane-border-bg pane-border-fg +\ pane-border-format pane-border-status pane-border-style remain-on-exit +\ synchronize-panes window-active-style window-style +\ window-status-activity-attr window-status-activity-bg +\ window-status-activity-fg window-status-activity-style window-status-attr +\ window-status-bell-attr window-status-bell-bg window-status-bell-fg +\ window-status-bell-style window-status-bg window-status-current-attr +\ window-status-current-bg window-status-current-fg +\ window-status-current-format window-status-current-style window-status-fg +\ window-status-format window-status-last-attr window-status-last-bg +\ window-status-last-fg window-status-last-style window-status-separator +\ window-status-style wrap-search xterm-keys + +syn keyword tmuxCommands +\ attach-session attach bind-key bind break-pane breakp capture-pane +\ capturep clear-history clearhist choose-buffer choose-client choose-tree +\ choose-session choose-window command-prompt confirm-before confirm +\ copy-mode clock-mode detach-client detach suspend-client suspendc +\ display-message display display-panes displayp find-window findw if-shell +\ if join-pane joinp move-pane movep kill-pane killp kill-server +\ start-server start kill-session kill-window killw unlink-window unlinkw +\ list-buffers lsb list-clients lsc list-keys lsk list-commands lscm +\ list-panes lsp list-sessions ls list-windows lsw load-buffer loadb +\ lock-server lock lock-session locks lock-client lockc move-window movew +\ link-window linkw new-session new has-session has new-window neww +\ paste-buffer pasteb pipe-pane pipep refresh-client refresh rename-session +\ rename rename-window renamew resize-pane resizep respawn-pane respawnp +\ respawn-window respawnw rotate-window rotatew run-shell run save-buffer +\ saveb show-buffer showb select-layout selectl next-layout nextl +\ previous-layout prevl select-pane selectp last-pane lastp select-window +\ selectw next-window next previous-window prev last-window last send-keys +\ send send-prefix set-buffer setb delete-buffer deleteb set-environment +\ setenv set-hook show-hooks set-option set set-window-option setw +\ show-environment showenv show-messages showmsgs show-options show +\ show-window-options showw source-file source split-window splitw swap-pane +\ swapp swap-window swapw switch-client switchc unbind-key unbind wait-for +\ wait + +let &cpo = s:original_cpo +unlet! s:original_cpo s:bg s:i diff --git a/runtime/syntax/tpp.vim b/runtime/syntax/tpp.vim index 050a2ba78d..1244b97f08 100644 --- a/runtime/syntax/tpp.vim +++ b/runtime/syntax/tpp.vim @@ -17,11 +17,8 @@ " the latest version of this file. " SPAM is _NOT_ welcome - be ready to be reported! -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -51,11 +48,7 @@ syn region tppAbstractOption start="^--\%(author\|title\|date\|footer\)" end="$" if main_syntax != 'sh' " shell command - if version < 600 - syn include @tppShExec :p:h/sh.vim - else - syn include @tppShExec syntax/sh.vim - endif + syn include @tppShExec syntax/sh.vim unlet b:current_syntax syn region shExec matchgroup=tppPageLocalOptionKey start='^--exec *' keepend end='$' contains=@tppShExec @@ -65,35 +58,25 @@ endif syn match tppComment "^--##.*$" " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_tpp_syn_inits") - if version < 508 - let did_tpp_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink tppAbstractOptionKey Special - HiLink tppPageLocalOptionKey Keyword - HiLink tppPageLocalSwitchKey Keyword - HiLink tppColorOptionKey Keyword - HiLink tppTimeOptionKey Comment - HiLink tppNewPageOptionKey PreProc - HiLink tppString String - HiLink tppColor String - HiLink tppTime Number - HiLink tppComment Comment - HiLink tppAbstractOption Error - HiLink tppPageLocalOption Error - HiLink tppPageLocalSwitch Error - HiLink tppColorOption Error - HiLink tppNewPageOption Error - HiLink tppTimeOption Error +hi def link tppAbstractOptionKey Special +hi def link tppPageLocalOptionKey Keyword +hi def link tppPageLocalSwitchKey Keyword +hi def link tppColorOptionKey Keyword +hi def link tppTimeOptionKey Comment +hi def link tppNewPageOptionKey PreProc +hi def link tppString String +hi def link tppColor String +hi def link tppTime Number +hi def link tppComment Comment +hi def link tppAbstractOption Error +hi def link tppPageLocalOption Error +hi def link tppPageLocalSwitch Error +hi def link tppColorOption Error +hi def link tppNewPageOption Error +hi def link tppTimeOption Error - delcommand HiLink -endif let b:current_syntax = "tpp" diff --git a/runtime/syntax/trasys.vim b/runtime/syntax/trasys.vim index cfecc1c1fd..d52b5eeb47 100644 --- a/runtime/syntax/trasys.vim +++ b/runtime/syntax/trasys.vim @@ -8,11 +8,8 @@ -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -21,11 +18,7 @@ endif let fortran_free_source=1 " Load FORTRAN syntax file -if version < 600 - source :p:h/fortran.vim -else - runtime! syntax/fortran.vim -endif +runtime! syntax/fortran.vim unlet b:current_syntax @@ -136,40 +129,30 @@ syn sync match trasysSync grouphere trasysComment "^HEADER DOCUMENTATION DATA" " Define the default highlighting -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_trasys_syntax_inits") - if version < 508 - let did_trasys_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink trasysOptions Special - HiLink trasysSurface Special - HiLink trasysSurfaceType Constant - HiLink trasysSurfaceArgs Constant - HiLink trasysArgs Constant - HiLink trasysOperations Statement - HiLink trasysSubRoutine Statement - HiLink trassyPrcsrSegm PreProc - HiLink trasysIdentifier Identifier - HiLink trasysComment Comment - HiLink trasysHeader Typedef - HiLink trasysMacro Macro - HiLink trasysInteger Number - HiLink trasysFloat Float - HiLink trasysScientific Float +hi def link trasysOptions Special +hi def link trasysSurface Special +hi def link trasysSurfaceType Constant +hi def link trasysSurfaceArgs Constant +hi def link trasysArgs Constant +hi def link trasysOperations Statement +hi def link trasysSubRoutine Statement +hi def link trassyPrcsrSegm PreProc +hi def link trasysIdentifier Identifier +hi def link trasysComment Comment +hi def link trasysHeader Typedef +hi def link trasysMacro Macro +hi def link trasysInteger Number +hi def link trasysFloat Float +hi def link trasysScientific Float - HiLink trasysBlank SpecialChar +hi def link trasysBlank SpecialChar - HiLink trasysEndData Macro +hi def link trasysEndData Macro - HiLink trasysTodo Todo +hi def link trasysTodo Todo - delcommand HiLink -endif let b:current_syntax = "trasys" diff --git a/runtime/syntax/treetop.vim b/runtime/syntax/treetop.vim index 921c5bea1d..60bbf26193 100644 --- a/runtime/syntax/treetop.vim +++ b/runtime/syntax/treetop.vim @@ -1,7 +1,7 @@ " Vim syntax file -" Language: Treetop -" Maintainer: Nikolai Weibull -" Latest Revision: 2011-03-14 +" Language: Treetop +" Previous Maintainer: Nikolai Weibull +" Latest Revision: 2011-03-14 if exists("b:current_syntax") finish diff --git a/runtime/syntax/trustees.vim b/runtime/syntax/trustees.vim index 4bc8874772..6c58d3983d 100644 --- a/runtime/syntax/trustees.vim +++ b/runtime/syntax/trustees.vim @@ -3,9 +3,8 @@ " Maintainer: Nima Talebi " Last Change: 2005-10-12 -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif diff --git a/runtime/syntax/tsalt.vim b/runtime/syntax/tsalt.vim index 887d6b75e7..8dd2a24df9 100644 --- a/runtime/syntax/tsalt.vim +++ b/runtime/syntax/tsalt.vim @@ -4,11 +4,8 @@ " Last Change: 2012 Feb 03 by Thilo Six " Version Info: @(#)tsalt.vim 1.5 97/12/16 08:11:15 -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -171,46 +168,36 @@ syn sync ccomment tsaltComment " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_tsalt_syntax_inits") - if version < 508 - let did_tsalt_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink tsaltFunction Statement - HiLink tsaltSysVar Type - "HiLink tsaltLibFunc UserDefFunc - "HiLink tsaltConstants Type - "HiLink tsaltFuncArg Type - "HiLink tsaltOperator Operator - "HiLink tsaltLabel Label - "HiLink tsaltUserLabel Label - HiLink tsaltConditional Conditional - HiLink tsaltRepeat Repeat - HiLink tsaltCharacter SpecialChar - HiLink tsaltSpecialCharacter SpecialChar - HiLink tsaltNumber Number - HiLink tsaltFloat Float - HiLink tsaltCommentError tsaltError - HiLink tsaltInclude Include - HiLink tsaltPreProc PreProc - HiLink tsaltDefine Macro - HiLink tsaltIncluded tsaltString - HiLink tsaltError Error - HiLink tsaltStatement Statement - HiLink tsaltPreCondit PreCondit - HiLink tsaltType Type - HiLink tsaltString String - HiLink tsaltComment Comment - HiLink tsaltSpecial Special - HiLink tsaltTodo Todo +hi def link tsaltFunction Statement +hi def link tsaltSysVar Type +"hi def link tsaltLibFunc UserDefFunc +"hi def link tsaltConstants Type +"hi def link tsaltFuncArg Type +"hi def link tsaltOperator Operator +"hi def link tsaltLabel Label +"hi def link tsaltUserLabel Label +hi def link tsaltConditional Conditional +hi def link tsaltRepeat Repeat +hi def link tsaltCharacter SpecialChar +hi def link tsaltSpecialCharacter SpecialChar +hi def link tsaltNumber Number +hi def link tsaltFloat Float +hi def link tsaltCommentError tsaltError +hi def link tsaltInclude Include +hi def link tsaltPreProc PreProc +hi def link tsaltDefine Macro +hi def link tsaltIncluded tsaltString +hi def link tsaltError Error +hi def link tsaltStatement Statement +hi def link tsaltPreCondit PreCondit +hi def link tsaltType Type +hi def link tsaltString String +hi def link tsaltComment Comment +hi def link tsaltSpecial Special +hi def link tsaltTodo Todo - delcommand HiLink -endif let b:current_syntax = "tsalt" diff --git a/runtime/syntax/tsscl.vim b/runtime/syntax/tsscl.vim index 3fc18c6847..fd2a5e2ba9 100644 --- a/runtime/syntax/tsscl.vim +++ b/runtime/syntax/tsscl.vim @@ -8,11 +8,8 @@ -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -179,37 +176,27 @@ syn match tssclScientific "-\=\<[0-9]*\.[0-9]*E[-+]\=[0-9]\+\>" " Define the default highlighting -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_tsscl_syntax_inits") - if version < 508 - let did_tsscl_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink tssclCommand Statement - HiLink tssclKeyword Special - HiLink tssclEnd Macro - HiLink tssclUnits Special +hi def link tssclCommand Statement +hi def link tssclKeyword Special +hi def link tssclEnd Macro +hi def link tssclUnits Special - HiLink tssclComment Comment - HiLink tssclDirective Statement - HiLink tssclConditional Conditional - HiLink tssclContChar Macro - HiLink tssclQualifier Typedef - HiLink tssclSymbol Identifier - HiLink tssclSymbol2 Symbol - HiLink tssclString String - HiLink tssclOper Operator +hi def link tssclComment Comment +hi def link tssclDirective Statement +hi def link tssclConditional Conditional +hi def link tssclContChar Macro +hi def link tssclQualifier Typedef +hi def link tssclSymbol Identifier +hi def link tssclSymbol2 Symbol +hi def link tssclString String +hi def link tssclOper Operator - HiLink tssclInteger Number - HiLink tssclFloat Number - HiLink tssclScientific Number +hi def link tssclInteger Number +hi def link tssclFloat Number +hi def link tssclScientific Number - delcommand HiLink -endif let b:current_syntax = "tsscl" diff --git a/runtime/syntax/tssgm.vim b/runtime/syntax/tssgm.vim index b8182d48ea..8ca7962e81 100644 --- a/runtime/syntax/tssgm.vim +++ b/runtime/syntax/tssgm.vim @@ -8,11 +8,8 @@ -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -75,35 +72,25 @@ syn match tssgmScientific "-\=\<[0-9]*\.[0-9]*E[-+]\=[0-9]\+\>" " Define the default highlighting -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_tssgm_syntax_inits") - if version < 508 - let did_tssgm_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink tssgmParam Statement - HiLink tssgmSurfType Type - HiLink tssgmArgs Special - HiLink tssgmDelim Typedef - HiLink tssgmEnd Macro - HiLink tssgmUnits Special +hi def link tssgmParam Statement +hi def link tssgmSurfType Type +hi def link tssgmArgs Special +hi def link tssgmDelim Typedef +hi def link tssgmEnd Macro +hi def link tssgmUnits Special - HiLink tssgmDefault SpecialComment - HiLink tssgmComment Statement - HiLink tssgmCommentString Comment - HiLink tssgmSurfIdent Identifier - HiLink tssgmString Delimiter +hi def link tssgmDefault SpecialComment +hi def link tssgmComment Statement +hi def link tssgmCommentString Comment +hi def link tssgmSurfIdent Identifier +hi def link tssgmString Delimiter - HiLink tssgmInteger Number - HiLink tssgmFloat Float - HiLink tssgmScientific Float +hi def link tssgmInteger Number +hi def link tssgmFloat Float +hi def link tssgmScientific Float - delcommand HiLink -endif let b:current_syntax = "tssgm" diff --git a/runtime/syntax/tssop.vim b/runtime/syntax/tssop.vim index d416df054c..6a775b2358 100644 --- a/runtime/syntax/tssop.vim +++ b/runtime/syntax/tssop.vim @@ -8,11 +8,8 @@ -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -56,30 +53,20 @@ syn match tssopScientific "-\=\<[0-9]*\.[0-9]*E[-+]\=[0-9]\+\>" " Define the default highlighting -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_tssop_syntax_inits") - if version < 508 - let did_tssop_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink tssopParam Statement - HiLink tssopProp Identifier - HiLink tssopArgs Special +hi def link tssopParam Statement +hi def link tssopProp Identifier +hi def link tssopArgs Special - HiLink tssopComment Statement - HiLink tssopCommentString Comment - HiLink tssopPropName Typedef +hi def link tssopComment Statement +hi def link tssopCommentString Comment +hi def link tssopPropName Typedef - HiLink tssopInteger Number - HiLink tssopFloat Float - HiLink tssopScientific Float +hi def link tssopInteger Number +hi def link tssopFloat Float +hi def link tssopScientific Float - delcommand HiLink -endif let b:current_syntax = "tssop" diff --git a/runtime/syntax/tt2.vim b/runtime/syntax/tt2.vim index 5321e277da..6432b85a05 100644 --- a/runtime/syntax/tt2.vim +++ b/runtime/syntax/tt2.vim @@ -3,10 +3,10 @@ " Author: Moriki, Atsushi <4woods+vim@gmail.com> " Homepage: http://github.com/vim-perl/vim-perl " Bugs/requests: http://github.com/vim-perl/vim-perl/issues -" Last Change: 2013-07-21 +" Last Change: 2015-04-25 " -" Instration: -" put tt2.vim and tt2html.vim in to your syntax diretory. +" Installation: +" put tt2.vim and tt2html.vim in to your syntax directory. " " add below in your filetype.vim. " au BufNewFile,BufRead *.tt2 setf tt2 diff --git a/runtime/syntax/tutor.vim b/runtime/syntax/tutor.vim index bce9189660..cb101ee9a7 100644 --- a/runtime/syntax/tutor.vim +++ b/runtime/syntax/tutor.vim @@ -15,7 +15,7 @@ syn match tutorURL /\(https\?\|file\):\/\/[[:graph:]]\+\>\/\?/ syn match tutorEmail /\<[[:graph:]]\+@[[:graph:]]\+\>/ syn match tutorInternalAnchor /\*[[:alnum:]-]\+\*/ contained conceal containedin=tutorSection -syn match tutorSection /^#\{1,6}\s.\+$/ fold +syn match tutorSection /^#\{1,6}\s.\+$/ fold contains=tutorInlineNormal syn match tutorSectionBullet /#/ contained containedin=tutorSection syn match tutorTOC /\ctable of contents:/ @@ -31,24 +31,18 @@ syn keyword tutorMarks TODO NOTE IMPORTANT TIP ATTENTION EXERCISE syn keyword tutorMarks todo note tip attention exercise syn keyword tutorMarks Todo Note Tip Excersise -syn match tutorTextMark /\\\@/ conceal cchar=→ -syn region tutorSampleText start=/^\(--->\)\@=/ end=/$/ keepend contains=@SPELL -syn match tutorSampleTextMark /^--->/ contained containedin=tutorSampleText conceal cchar=→ -syn match tutorSampleTextExpect /\}\@= 508 || !exists("did_uc_syntax_inits") - if version < 508 - let did_uc_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink ucFuncDef Conditional - HiLink ucEventDef Conditional - HiLink ucBraces Function - HiLink ucBranch Conditional - HiLink ucLabel Label - HiLink ucUserLabel Label - HiLink ucConditional Conditional - HiLink ucRepeat Repeat - HiLink ucStorageClass StorageClass - HiLink ucMethodDecl ucStorageClass - HiLink ucClassDecl ucStorageClass - HiLink ucScopeDecl ucStorageClass - HiLink ucBoolean Boolean - HiLink ucSpecial Special - HiLink ucSpecialError Error - HiLink ucSpecialCharError Error - HiLink ucString String - HiLink ucCharacter Character - HiLink ucSpecialChar SpecialChar - HiLink ucNumber Number - HiLink ucError Error - HiLink ucStringError Error - HiLink ucStatement Statement - HiLink ucOperator Operator - HiLink ucOverLoaded Operator - HiLink ucComment Comment - HiLink ucDocComment Comment - HiLink ucLineComment Comment - HiLink ucConstant ucBoolean - HiLink ucTypedef Typedef - HiLink ucTodo Todo +hi def link ucFuncDef Conditional +hi def link ucEventDef Conditional +hi def link ucBraces Function +hi def link ucBranch Conditional +hi def link ucLabel Label +hi def link ucUserLabel Label +hi def link ucConditional Conditional +hi def link ucRepeat Repeat +hi def link ucStorageClass StorageClass +hi def link ucMethodDecl ucStorageClass +hi def link ucClassDecl ucStorageClass +hi def link ucScopeDecl ucStorageClass +hi def link ucBoolean Boolean +hi def link ucSpecial Special +hi def link ucSpecialError Error +hi def link ucSpecialCharError Error +hi def link ucString String +hi def link ucCharacter Character +hi def link ucSpecialChar SpecialChar +hi def link ucNumber Number +hi def link ucError Error +hi def link ucStringError Error +hi def link ucStatement Statement +hi def link ucOperator Operator +hi def link ucOverLoaded Operator +hi def link ucComment Comment +hi def link ucDocComment Comment +hi def link ucLineComment Comment +hi def link ucConstant ucBoolean +hi def link ucTypedef Typedef +hi def link ucTodo Todo - HiLink ucCommentTitle SpecialComment - HiLink ucDocTags Special - HiLink ucDocParam Function - HiLink ucCommentStar ucComment +hi def link ucCommentTitle SpecialComment +hi def link ucDocTags Special +hi def link ucDocParam Function +hi def link ucCommentStar ucComment - HiLink ucType Type - HiLink ucExternal Include +hi def link ucType Type +hi def link ucExternal Include - HiLink ucClassKeys Conditional - HiLink ucClassLabel Conditional +hi def link ucClassKeys Conditional +hi def link ucClassLabel Conditional - HiLink htmlComment Special - HiLink htmlCommentPart Special +hi def link htmlComment Special +hi def link htmlCommentPart Special - delcommand HiLink -endif let b:current_syntax = "uc" diff --git a/runtime/syntax/udevconf.vim b/runtime/syntax/udevconf.vim index a294604906..82fd81daf6 100644 --- a/runtime/syntax/udevconf.vim +++ b/runtime/syntax/udevconf.vim @@ -1,7 +1,7 @@ " Vim syntax file -" Language: udev(8) configuration file -" Maintainer: Nikolai Weibull -" Latest Revision: 2006-04-19 +" Language: udev(8) configuration file +" Previous Maintainer: Nikolai Weibull +" Latest Revision: 2006-04-19 if exists("b:current_syntax") finish diff --git a/runtime/syntax/udevperm.vim b/runtime/syntax/udevperm.vim index 9d3af09d07..abda0b6663 100644 --- a/runtime/syntax/udevperm.vim +++ b/runtime/syntax/udevperm.vim @@ -1,7 +1,7 @@ " Vim syntax file -" Language: udev(8) permissions file -" Maintainer: Nikolai Weibull -" Latest Revision: 2006-04-19 +" Language: udev(8) permissions file +" Previous Maintainer: Nikolai Weibull +" Latest Revision: 2006-04-19 if exists("b:current_syntax") finish diff --git a/runtime/syntax/udevrules.vim b/runtime/syntax/udevrules.vim index b04d728865..ce156ccc13 100644 --- a/runtime/syntax/udevrules.vim +++ b/runtime/syntax/udevrules.vim @@ -1,7 +1,7 @@ " Vim syntax file -" Language: udev(8) rules file -" Maintainer: Nikolai Weibull -" Latest Revision: 2006-12-18 +" Language: udev(8) rules file +" Previous Maintainer: Nikolai Weibull +" Latest Revision: 2006-12-18 if exists("b:current_syntax") finish diff --git a/runtime/syntax/uil.vim b/runtime/syntax/uil.vim index b5421bcfdb..088a0f6c86 100644 --- a/runtime/syntax/uil.vim +++ b/runtime/syntax/uil.vim @@ -1,13 +1,13 @@ " Vim syntax file " Language: Motif UIL (User Interface Language) " Maintainer: Thomas Koehler -" Last Change: 2013 May 23 +" Please be aware: I'm often slow to answer email due to a high +" non-computer related workload (sometimes 4-8 weeks) +" Last Change: 2016 September 6 " URL: http://gott-gehabt.de/800_wer_wir_sind/thomas/Homepage/Computer/vim/syntax/uil.vim -" Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -47,37 +47,27 @@ syn region uilDefine start="^#\s*\(define\>\|undef\>\)" end="$" contains=uilLin syn sync ccomment uilComment " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_uil_syn_inits") - if version < 508 - let did_uil_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - " The default highlighting. - HiLink uilCharacter uilString - HiLink uilSpecialCharacter uilSpecial - HiLink uilNumber uilString - HiLink uilCommentError uilError - HiLink uilInclude uilPreCondit - HiLink uilDefine uilPreCondit - HiLink uilIncluded uilString - HiLink uilSpecialFunction uilRessource - HiLink uilRessource Identifier - HiLink uilSpecialStatement Keyword - HiLink uilError Error - HiLink uilPreCondit PreCondit - HiLink uilType Type - HiLink uilString String - HiLink uilComment Comment - HiLink uilSpecial Special - HiLink uilTodo Todo +" The default highlighting. +hi def link uilCharacter uilString +hi def link uilSpecialCharacter uilSpecial +hi def link uilNumber uilString +hi def link uilCommentError uilError +hi def link uilInclude uilPreCondit +hi def link uilDefine uilPreCondit +hi def link uilIncluded uilString +hi def link uilSpecialFunction uilRessource +hi def link uilRessource Identifier +hi def link uilSpecialStatement Keyword +hi def link uilError Error +hi def link uilPreCondit PreCondit +hi def link uilType Type +hi def link uilString String +hi def link uilComment Comment +hi def link uilSpecial Special +hi def link uilTodo Todo - delcommand HiLink -endif let b:current_syntax = "uil" diff --git a/runtime/syntax/updatedb.vim b/runtime/syntax/updatedb.vim index 7c082d62df..224a7dd2c2 100644 --- a/runtime/syntax/updatedb.vim +++ b/runtime/syntax/updatedb.vim @@ -1,7 +1,7 @@ " Vim syntax file -" Language: updatedb.conf(5) configuration file -" Maintainer: Nikolai Weibull -" Latest Revision: 2009-05-25 +" Language: updatedb.conf(5) configuration file +" Previous Maintainer: Nikolai Weibull +" Latest Revision: 2009-05-25 if exists("b:current_syntax") finish diff --git a/runtime/syntax/upstart.vim b/runtime/syntax/upstart.vim index b3f2b9e637..140cd174e0 100644 --- a/runtime/syntax/upstart.vim +++ b/runtime/syntax/upstart.vim @@ -10,9 +10,8 @@ " It is inspired by the initng syntax file and includes sh.vim to do the " highlighting of script blocks. -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif diff --git a/runtime/syntax/vb.vim b/runtime/syntax/vb.vim index 0c05b35fbd..8ddb1efac3 100644 --- a/runtime/syntax/vb.vim +++ b/runtime/syntax/vb.vim @@ -11,11 +11,8 @@ " VIM and VIM-DEV mailing lists. It is by no means complete. " Send comments, suggestions and requests to the maintainer. -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -338,40 +335,30 @@ syn match vbTypeSpecifier "[a-zA-Z0-9][\$%&!#]"ms=s+1 syn match vbTypeSpecifier "#[a-zA-Z0-9]"me=e-1 " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_vb_syntax_inits") - if version < 508 - let did_vb_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink vbBoolean Boolean - HiLink vbLineNumber Comment - HiLink vbComment Comment - HiLink vbConditional Conditional - HiLink vbConst Constant - HiLink vbDefine Constant - HiLink vbError Error - HiLink vbFunction Identifier - HiLink vbIdentifier Identifier - HiLink vbNumber Number - HiLink vbFloat Float - HiLink vbMethods PreProc - HiLink vbOperator Operator - HiLink vbRepeat Repeat - HiLink vbString String - HiLink vbStatement Statement - HiLink vbKeyword Statement - HiLink vbEvents Special - HiLink vbTodo Todo - HiLink vbTypes Type - HiLink vbTypeSpecifier Type +hi def link vbBoolean Boolean +hi def link vbLineNumber Comment +hi def link vbComment Comment +hi def link vbConditional Conditional +hi def link vbConst Constant +hi def link vbDefine Constant +hi def link vbError Error +hi def link vbFunction Identifier +hi def link vbIdentifier Identifier +hi def link vbNumber Number +hi def link vbFloat Float +hi def link vbMethods PreProc +hi def link vbOperator Operator +hi def link vbRepeat Repeat +hi def link vbString String +hi def link vbStatement Statement +hi def link vbKeyword Statement +hi def link vbEvents Special +hi def link vbTodo Todo +hi def link vbTypes Type +hi def link vbTypeSpecifier Type - delcommand HiLink -endif let b:current_syntax = "vb" diff --git a/runtime/syntax/vera.vim b/runtime/syntax/vera.vim index b8e25cf346..b41c0a6cbf 100644 --- a/runtime/syntax/vera.vim +++ b/runtime/syntax/vera.vim @@ -10,11 +10,8 @@ " (change the value for guibg to any color you like) -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -287,74 +284,64 @@ endif exec "syn sync ccomment veraComment minlines=" . b:vera_minlines " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_vera_syn_inits") - if version < 508 - let did_vera_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink veraClass Identifier - HiLink veraObject Identifier - HiLink veraUserMethod Function - HiLink veraTask Keyword - HiLink veraModifier Tag - HiLink veraDeprecated veraError - HiLink veraMethods Statement - " HiLink veraInterface Label - HiLink veraInterface Function +hi def link veraClass Identifier +hi def link veraObject Identifier +hi def link veraUserMethod Function +hi def link veraTask Keyword +hi def link veraModifier Tag +hi def link veraDeprecated veraError +hi def link veraMethods Statement +" hi def link veraInterface Label +hi def link veraInterface Function - HiLink veraFormat veraSpecial - HiLink veraCppString veraString - HiLink veraCommentL veraComment - HiLink veraCommentStart veraComment - HiLink veraLabel Label - HiLink veraUserLabel Label - HiLink veraConditional Conditional - HiLink veraRepeat Repeat - HiLink veraCharacter Character - HiLink veraSpecialCharacter veraSpecial - HiLink veraNumber Number - HiLink veraOctal Number - HiLink veraOctalZero PreProc " link this to Error if you want - HiLink veraFloat Float - HiLink veraOctalError veraError - HiLink veraParenError veraError - HiLink veraErrInParen veraError - HiLink veraErrInBracket veraError - HiLink veraCommentError veraError - HiLink veraCommentStartError veraError - HiLink veraSpaceError SpaceError - HiLink veraSpecialError veraError - HiLink veraOperator Operator - HiLink veraStructure Structure - HiLink veraInclude Include - HiLink veraPreProc PreProc - HiLink veraDefine Macro - HiLink veraIncluded veraString - HiLink veraError Error - HiLink veraStatement Statement - HiLink veraPreCondit PreCondit - HiLink veraType Type - " HiLink veraConstant Constant - HiLink veraConstant Keyword - HiLink veraUserConstant Constant - HiLink veraCommentString veraString - HiLink veraComment2String veraString - HiLink veraCommentSkip veraComment - HiLink veraString String - HiLink veraComment Comment - HiLink veraSpecial SpecialChar - HiLink veraTodo Todo - HiLink veraCppSkip veraCppOut - HiLink veraCppOut2 veraCppOut - HiLink veraCppOut Comment +hi def link veraFormat veraSpecial +hi def link veraCppString veraString +hi def link veraCommentL veraComment +hi def link veraCommentStart veraComment +hi def link veraLabel Label +hi def link veraUserLabel Label +hi def link veraConditional Conditional +hi def link veraRepeat Repeat +hi def link veraCharacter Character +hi def link veraSpecialCharacter veraSpecial +hi def link veraNumber Number +hi def link veraOctal Number +hi def link veraOctalZero PreProc " link this to Error if you want +hi def link veraFloat Float +hi def link veraOctalError veraError +hi def link veraParenError veraError +hi def link veraErrInParen veraError +hi def link veraErrInBracket veraError +hi def link veraCommentError veraError +hi def link veraCommentStartError veraError +hi def link veraSpaceError SpaceError +hi def link veraSpecialError veraError +hi def link veraOperator Operator +hi def link veraStructure Structure +hi def link veraInclude Include +hi def link veraPreProc PreProc +hi def link veraDefine Macro +hi def link veraIncluded veraString +hi def link veraError Error +hi def link veraStatement Statement +hi def link veraPreCondit PreCondit +hi def link veraType Type +" hi def link veraConstant Constant +hi def link veraConstant Keyword +hi def link veraUserConstant Constant +hi def link veraCommentString veraString +hi def link veraComment2String veraString +hi def link veraCommentSkip veraComment +hi def link veraString String +hi def link veraComment Comment +hi def link veraSpecial SpecialChar +hi def link veraTodo Todo +hi def link veraCppSkip veraCppOut +hi def link veraCppOut2 veraCppOut +hi def link veraCppOut Comment - delcommand HiLink -endif let b:current_syntax = "vera" diff --git a/runtime/syntax/verilog.vim b/runtime/syntax/verilog.vim index f4d21d0739..bbaca491a7 100644 --- a/runtime/syntax/verilog.vim +++ b/runtime/syntax/verilog.vim @@ -3,22 +3,15 @@ " Maintainer: Mun Johl " Last Update: Wed Jul 20 16:04:19 PDT 2011 -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif " Set the local value of the 'iskeyword' option. " NOTE: '?' was added so that verilogNumber would be processed correctly when " '?' is the last character of the number. -if version >= 600 - setlocal iskeyword=@,48-57,63,_,192-255 -else - set iskeyword=@,48-57,63,_,192-255 -endif +setlocal iskeyword=@,48-57,63,_,192-255 " A bunch of useful Verilog keywords @@ -102,34 +95,24 @@ syn region verilogDirective start="//\s*\$s dc_script_begin\>" end="//\s*\$s syn sync minlines=50 " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_verilog_syn_inits") - if version < 508 - let did_verilog_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - " The default highlighting. - HiLink verilogCharacter Character - HiLink verilogConditional Conditional - HiLink verilogRepeat Repeat - HiLink verilogString String - HiLink verilogTodo Todo - HiLink verilogComment Comment - HiLink verilogConstant Constant - HiLink verilogLabel Label - HiLink verilogNumber Number - HiLink verilogOperator Special - HiLink verilogStatement Statement - HiLink verilogGlobal Define - HiLink verilogDirective SpecialComment - HiLink verilogEscape Special +" The default highlighting. +hi def link verilogCharacter Character +hi def link verilogConditional Conditional +hi def link verilogRepeat Repeat +hi def link verilogString String +hi def link verilogTodo Todo +hi def link verilogComment Comment +hi def link verilogConstant Constant +hi def link verilogLabel Label +hi def link verilogNumber Number +hi def link verilogOperator Special +hi def link verilogStatement Statement +hi def link verilogGlobal Define +hi def link verilogDirective SpecialComment +hi def link verilogEscape Special - delcommand HiLink -endif let b:current_syntax = "verilog" diff --git a/runtime/syntax/verilogams.vim b/runtime/syntax/verilogams.vim index d16e4bffb4..7551b681a8 100644 --- a/runtime/syntax/verilogams.vim +++ b/runtime/syntax/verilogams.vim @@ -9,20 +9,13 @@ " Minor reserved keyword updates. " Last Update: Thursday September 15 15:36:03 CST 2005 -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif " Set the local value of the 'iskeyword' option -if version >= 600 - setlocal iskeyword=@,48-57,_,192-255 -else - set iskeyword=@,48-57,_,192-255 -endif +setlocal iskeyword=@,48-57,_,192-255 " Annex B.1 'All keywords' syn keyword verilogamsStatement above abs absdelay acos acosh ac_stim @@ -113,36 +106,26 @@ syn match verilogamsEscape "\\\o\o\=\o\=" contained syn sync lines=50 " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_verilogams_syn_inits") - if version < 508 - let did_verilogams_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - " The default highlighting. - HiLink verilogamsCharacter Character - HiLink verilogamsConditional Conditional - HiLink verilogamsRepeat Repeat - HiLink verilogamsString String - HiLink verilogamsTodo Todo - HiLink verilogamsComment Comment - HiLink verilogamsConstant Constant - HiLink verilogamsLabel Label - HiLink verilogamsNumber Number - HiLink verilogamsOperator Special - HiLink verilogamsStatement Statement - HiLink verilogamsGlobal Define - HiLink verilogamsDirective SpecialComment - HiLink verilogamsEscape Special - HiLink verilogamsType Type - HiLink verilogamsSystask Function +" The default highlighting. +hi def link verilogamsCharacter Character +hi def link verilogamsConditional Conditional +hi def link verilogamsRepeat Repeat +hi def link verilogamsString String +hi def link verilogamsTodo Todo +hi def link verilogamsComment Comment +hi def link verilogamsConstant Constant +hi def link verilogamsLabel Label +hi def link verilogamsNumber Number +hi def link verilogamsOperator Special +hi def link verilogamsStatement Statement +hi def link verilogamsGlobal Define +hi def link verilogamsDirective SpecialComment +hi def link verilogamsEscape Special +hi def link verilogamsType Type +hi def link verilogamsSystask Function - delcommand HiLink -endif let b:current_syntax = "verilogams" diff --git a/runtime/syntax/vhdl.vim b/runtime/syntax/vhdl.vim index 32503823ee..f4b11ff5dd 100644 --- a/runtime/syntax/vhdl.vim +++ b/runtime/syntax/vhdl.vim @@ -5,9 +5,8 @@ " Credits: Stephan Hegel " Last Changed: 2016 Mar 05 by Daniel Kho -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -234,35 +233,25 @@ syn match vhdlPreProc "\(^\|\s\)--\s*synopsys\s\+translate_\(on\|off\)\s*" syn sync minlines=600 " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_vhdl_syntax_inits") - if version < 508 - let did_vhdl_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - - HiLink vhdlSpecial Special - HiLink vhdlStatement Statement - HiLink vhdlCharacter Character - HiLink vhdlString String - HiLink vhdlVector Number - HiLink vhdlBoolean Number - HiLink vhdlTodo Todo - HiLink vhdlFixme Fixme - HiLink vhdlComment Comment - HiLink vhdlNumber Number - HiLink vhdlTime Number - HiLink vhdlType Type - HiLink vhdlOperator Operator - HiLink vhdlError Error - HiLink vhdlAttribute Special - HiLink vhdlPreProc PreProc - - delcommand HiLink -endif +" Only when an item doesn't have highlighting yet + +hi def link vhdlSpecial Special +hi def link vhdlStatement Statement +hi def link vhdlCharacter Character +hi def link vhdlString String +hi def link vhdlVector Number +hi def link vhdlBoolean Number +hi def link vhdlTodo Todo +hi def link vhdlFixme Fixme +hi def link vhdlComment Comment +hi def link vhdlNumber Number +hi def link vhdlTime Number +hi def link vhdlType Type +hi def link vhdlOperator Operator +hi def link vhdlError Error +hi def link vhdlAttribute Special +hi def link vhdlPreProc PreProc + let b:current_syntax = "vhdl" diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index 63618e902e..1551a314a3 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -3,8 +3,8 @@ " ############################################################################# " ############################################################################# " Note: Be careful when merging the upstream version of this file. -" Much of this is generated by scripts/genvimvim.lua (result is installed -" to: $VIMRUNTIME/syntax/vim/generated.vim) +" Much of this is generated by scripts/genvimvim.lua +" (installs to $VIMRUNTIME/syntax/vim/generated.vim) " ############################################################################# " ############################################################################# @@ -21,7 +21,7 @@ syn keyword vimTodo contained COMBAK FIXME TODO XXX syn cluster vimCommentGroup contains=vimTodo,@Spell " Special and plugin vim commands {{{2 -syn match vimCommand contained "\" syn keyword vimOnlyCommand contained fix[del] op[en] sh[ell] P[rint] syn keyword vimStdPlugin contained DiffOrig Man N[ext] S TOhtml XMLent XMLns @@ -53,10 +53,10 @@ syn case ignore syn keyword vimGroup contained Comment Constant String Character Number Boolean Float Identifier Function Statement Conditional Repeat Label Operator Keyword Exception PreProc Include Define Macro PreCondit Type StorageClass Structure Typedef Special SpecialChar Tag Delimiter SpecialComment Debug Underlined Ignore Error Todo " Default highlighting groups {{{2 -syn keyword vimHLGroup contained ColorColumn Cursor CursorColumn CursorIM CursorLine CursorLineNr DiffAdd DiffChange DiffDelete DiffText Directory ErrorMsg FoldColumn Folded IncSearch LineNr MatchParen Menu ModeMsg MoreMsg NonText Normal Pmenu PmenuSbar PmenuSel PmenuThumb Question Scrollbar Search SignColumn SpecialKey SpellBad SpellCap SpellLocal SpellRare StatusLine StatusLineNC TabLine TabLineFill TabLineSel Title Tooltip VertSplit Visual WarningMsg WildMenu +syn keyword vimHLGroup contained ColorColumn Cursor CursorColumn CursorIM CursorLine CursorLineNr DiffAdd DiffChange DiffDelete DiffText Directory EndOfBuffer ErrorMsg FoldColumn Folded IncSearch LineNr MatchParen Menu ModeMsg MoreMsg NonText Normal Pmenu PmenuSbar PmenuSel PmenuThumb Question Scrollbar Search SignColumn SpecialKey SpellBad SpellCap SpellLocal SpellRare StatusLine StatusLineNC TabLine TabLineFill TabLineSel Title Tooltip VertSplit Visual WarningMsg WildMenu syn match vimHLGroup contained "Conceal" syn keyword vimOnlyHLGroup contained VisualNOS -syn keyword nvimHLGroup contained EndOfBuffer Substitute TermCursor TermCursorNC QuickFixLine +syn keyword nvimHLGroup contained Substitute TermCursor TermCursorNC QuickFixLine "}}}2 syn case match " Special Vim Highlighting (not automatic) {{{1 @@ -128,6 +128,13 @@ if exists("g:vimsyntax_noerror") let g:vimsyn_noerror= g:vimsyntax_noerror endif +" Variable options {{{2 +if exists("g:vim_maxlines") + let s:vimsyn_maxlines= g:vim_maxlines +else + let s:vimsyn_maxlines= 60 +endif + " Numbers {{{2 " ======= syn match vimNumber "\<\d\+\%(\.\d\+\%([eE][+-]\=\d\+\)\=\)\=" skipwhite nextgroup=vimGlobal,vimSubst,vimCommand @@ -139,8 +146,8 @@ syn match vimNumber "\%(^\|[^a-zA-Z]\)\zs#\x\{6}" syn match vimCmdSep "[:|]\+" skipwhite nextgroup=vimAddress,vimAutoCmd,vimIsCommand,vimExtCmd,vimFilter,vimLet,vimMap,vimMark,vimSet,vimSyntax,vimUserCmd syn match vimIsCommand "\<\h\w*\>" contains=vimCommand syn match vimVar contained "\<\h[a-zA-Z0-9#_]*\>" -syn match vimVar "\<[bwglsav]:\h[a-zA-Z0-9#_]*\>" -syn match vimFBVar contained "\<[bwglsav]:\h[a-zA-Z0-9#_]*\>" +syn match vimVar "\<[bwglstav]:\h[a-zA-Z0-9#_]*\>" +syn match vimFBVar contained "\<[bwglstav]:\h[a-zA-Z0-9#_]*\>" syn keyword vimCommand contained in " Insertions And Appends: insert append {{{2 @@ -194,7 +201,7 @@ endif " Functions : Tag is provided for those who wish to highlight tagged functions {{{2 " ========= syn cluster vimFuncList contains=vimCommand,vimFunctionError,vimFuncKey,Tag,vimFuncSID -syn cluster vimFuncBodyList contains=vimAbb,vimAddress,vimAugroupKey,vimAutoCmd,vimCmplxRepeat,vimComment,vimComment,vimContinue,vimCtrlChar,vimEcho,vimEchoHL,vimExecute,vimIf,vimIsCommand,vimFBVar,vimFunc,vimFunction,vimFuncVar,vimGlobal,vimHighlight,vimIsCommand,vimLet,vimLineComment,vimMap,vimMark,vimNorm,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegion,vimRegister,vimSet,vimSpecFile,vimString,vimSubst,vimSynLine,vimUnmap,vimUserCommand,nvimUnmap,nvimMap +syn cluster vimFuncBodyList contains=vimAbb,vimAddress,vimAugroupKey,vimAutoCmd,vimCmplxRepeat,vimComment,vimContinue,vimCtrlChar,vimEcho,vimEchoHL,vimExecute,vimIf,vimIsCommand,vimFBVar,vimFunc,vimFunction,vimFuncVar,vimGlobal,vimHighlight,vimIsCommand,vimLet,vimLineComment,vimMap,vimMark,vimNorm,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegion,vimRegister,vimSet,vimSpecFile,vimString,vimSubst,vimSynLine,vimUnmap,vimUserCommand syn match vimFunction "\\|[sSgGbBwWtTlL]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)*\ze\s*(" contains=@vimFuncList nextgroup=vimFuncBody if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'f' @@ -238,7 +245,7 @@ if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_nousercmderror") endif syn case ignore syn keyword vimUserAttrbKey contained bar ban[g] cou[nt] ra[nge] com[plete] n[args] re[gister] -syn keyword vimUserAttrbCmplt contained augroup buffer color command compiler cscope dir environment event expression file file_in_path filetype function help highlight locale mapping menu option shellcmd sign syntax tag tag_listfiles var +syn keyword vimUserAttrbCmplt contained augroup buffer behave color command compiler cscope dir environment event expression file file_in_path filetype function help highlight history locale mapping menu option packadd shellcmd sign syntax syntime tag tag_listfiles user var syn keyword vimUserAttrbCmplt contained custom customlist nextgroup=vimUserAttrbCmpltFunc,vimUserCmdError syn match vimUserAttrbCmpltFunc contained ",\%([sS]:\|<[sS][iI][dD]>\)\=\%(\h\w*\%(#\h\w*\)\+\|\h\w*\)"hs=s+1 nextgroup=vimUserCmdError @@ -267,8 +274,8 @@ syn region vimPatSepZone oneline contained matchgroup=vimPatSepZ start="\\%\ syn region vimPatRegion contained transparent matchgroup=vimPatSepR start="\\[z%]\=(" end="\\)" contains=@vimSubstList oneline syn match vimNotPatSep contained "\\\\" syn cluster vimStringGroup contains=vimEscapeBrace,vimPatSep,vimNotPatSep,vimPatSepErr,vimPatSepZone,@Spell -syn region vimString oneline keepend start=+[^:a-zA-Z>!\\@]"+lc=1 skip=+\\\\\|\\"+ end=+"+ contains=@vimStringGroup -syn region vimString oneline keepend start=+[^:a-zA-Z>!\\@]'+lc=1 end=+'+ +syn region vimString oneline keepend start=+[^a-zA-Z>!\\@]"+lc=1 skip=+\\\\\|\\"+ end=+"+ contains=@vimStringGroup +syn region vimString oneline keepend start=+[^a-zA-Z>!\\@]'+lc=1 end=+'+ syn region vimString oneline start=+=!+lc=1 skip=+\\\\\|\\!+ end=+!+ contains=@vimStringGroup syn region vimString oneline start="=+"lc=1 skip="\\\\\|\\+" end="+" contains=@vimStringGroup syn region vimString oneline start="\s/\s*\A"lc=1 skip="\\\\\|\\+" end="/" contains=@vimStringGroup @@ -390,7 +397,7 @@ syn match vimNotation "\(\\\|\)\=<\([scamd]-\)\{0,4}x\=\(f\d\{1,2}\|[^ \t:]\ syn match vimNotation "\(\\\|\)\=<\([scam2-4]-\)\{0,4}\(right\|left\|middle\)\(mouse\)\=\(drag\|release\)\=>" contains=vimBracket syn match vimNotation "\(\\\|\)\=<\(bslash\|plug\|sid\|space\|bar\|nop\|nul\|lt\)>" contains=vimBracket syn match vimNotation '\(\\\|\)\=[0-9a-z"%#:.\-=]'he=e-1 contains=vimBracket -syn match vimNotation '\(\\\|\)\=<\%(q-\)\=\(line[12]\|count\|bang\|reg\|args\|f-args\|lt\)>' contains=vimBracket +syn match vimNotation '\(\\\|\)\=<\%(q-\)\=\(line[12]\|count\|bang\|reg\|args\|mods\|f-args\|f-mods\|lt\)>' contains=vimBracket syn match vimNotation "\(\\\|\)\=<\([cas]file\|abuf\|amatch\|cword\|cWORD\|client\)>" contains=vimBracket syn match vimBracket contained "[\\<>]" syn case match @@ -470,7 +477,7 @@ syn cluster vimFuncBodyList add=vimSynType syn cluster vimSynMtchGroup contains=vimMtchComment,vimSynContains,vimSynError,vimSynMtchOpt,vimSynNextgroup,vimSynRegPat,vimNotation syn keyword vimSynType contained match skipwhite nextgroup=vimSynMatchRegion syn region vimSynMatchRegion contained keepend matchgroup=vimGroupName start="\h\w*" matchgroup=vimSep end="|\|$" contains=@vimSynMtchGroup -syn match vimSynMtchOpt contained "\<\(conceal\|transparent\|contained\|excludenl\|skipempty\|skipwhite\|display\|extend\|skipnl\|fold\)\>" +syn match vimSynMtchOpt contained "\<\(conceal\|transparent\|contained\|excludenl\|keepend\|skipempty\|skipwhite\|display\|extend\|skipnl\|fold\)\>" if has("conceal") syn match vimSynMtchOpt contained "\\s\+[eE][nN][dD]" @@ -772,171 +776,174 @@ syn sync match vimAugroupSyncA groupthere NONE "\\s\+[eE][nN][dD]" " Highlighting Settings {{{2 " ==================== -if !exists("g:vimsyn_noerror") - hi def link vimBehaveError vimError - hi def link vimCollClassErr vimError - hi def link vimErrSetting vimError - hi def link vimEmbedError vimError - hi def link vimFTError vimError - hi def link vimFunctionError vimError - hi def link vimFunc vimError - hi def link vimHiAttribList vimError - hi def link vimHiCtermError vimError - hi def link vimHiKeyError vimError - hi def link vimKeyCodeError vimError - hi def link vimMapModErr vimError - hi def link vimSubstFlagErr vimError - hi def link vimSynCaseError vimError - hi def link vimBufnrWarn vimWarn -endif +if !exists("skip_vim_syntax_inits") + if !exists("g:vimsyn_noerror") + hi def link vimBehaveError vimError + hi def link vimCollClassErr vimError + hi def link vimErrSetting vimError + hi def link vimEmbedError Normal + hi def link vimFTError vimError + hi def link vimFunctionError vimError + hi def link vimFunc vimError + hi def link vimHiAttribList vimError + hi def link vimHiCtermError vimError + hi def link vimHiKeyError vimError + hi def link vimKeyCodeError vimError + hi def link vimMapModErr vimError + hi def link vimSubstFlagErr vimError + hi def link vimSynCaseError vimError + hi def link vimBufnrWarn vimWarn + endif -hi def link vimAbb vimCommand -hi def link vimAddress vimMark -hi def link vimAugroupError vimError -hi def link vimAugroupKey vimCommand -hi def link vimAuHighlight vimHighlight -hi def link vimAutoCmdOpt vimOption -hi def link vimAutoCmd vimCommand -hi def link vimAutoEvent Type -hi def link nvimAutoEvent vimAutoEvent -hi def link vimAutoSet vimCommand -hi def link vimBehaveModel vimBehave -hi def link vimBehave vimCommand -hi def link vimBracket Delimiter -hi def link vimCmplxRepeat SpecialChar -hi def link vimCommand Statement -hi def link vimComment Comment -hi def link vimCommentString vimString -hi def link vimCommentTitle PreProc -hi def link vimCondHL vimCommand -hi def link vimContinue Special -hi def link vimCtrlChar SpecialChar -hi def link vimEchoHLNone vimGroup -hi def link vimEchoHL vimCommand -hi def link vimElseIfErr Error -hi def link vimElseif vimCondHL -hi def link vimEnvvar PreProc -hi def link vimError Error -hi def link vimFBVar vimVar -hi def link vimFgBgAttrib vimHiAttrib -hi def link vimFold Folded -hi def link vimFTCmd vimCommand -hi def link vimFTOption vimSynType -hi def link vimFuncKey vimCommand -hi def link vimFuncName Function -hi def link vimFuncSID Special -hi def link vimFuncVar Identifier -hi def link vimGroupAdd vimSynOption -hi def link vimGroupName vimGroup -hi def link vimGroupRem vimSynOption -hi def link vimGroupSpecial Special -hi def link vimGroup Type -hi def link vimHiAttrib PreProc -hi def link vimHiClear vimHighlight -hi def link vimHiCtermFgBg vimHiTerm -hi def link vimHiCTerm vimHiTerm -hi def link vimHighlight vimCommand -hi def link vimHiGroup vimGroupName -hi def link vimHiGuiFgBg vimHiTerm -hi def link vimHiGuiFont vimHiTerm -hi def link vimHiGuiRgb vimNumber -hi def link vimHiGui vimHiTerm -hi def link vimHiNmbr Number -hi def link vimHiStartStop vimHiTerm -hi def link vimHiTerm Type -hi def link vimHLGroup vimGroup -hi def link nvimHLGroup vimHLGroup -hi def link vimHLMod PreProc -hi def link vimInsert vimString -hi def link vimIskSep Delimiter -hi def link vimKeyCode vimSpecFile -hi def link vimKeyword Statement -hi def link vimLet vimCommand -hi def link vimLineComment vimComment -hi def link vimMapBang vimCommand -hi def link vimMapModKey vimFuncSID -hi def link vimMapMod vimBracket -hi def link vimMap vimCommand -hi def link nvimMap vimMap -hi def link vimMark Number -hi def link vimMarkNumber vimNumber -hi def link vimMenuMod vimMapMod -hi def link vimMenuNameMore vimMenuName -hi def link vimMenuName PreProc -hi def link vimMtchComment vimComment -hi def link vimNorm vimCommand -hi def link vimNotation Special -hi def link vimNotFunc vimCommand -hi def link vimNotPatSep vimString -hi def link vimNumber Number -hi def link vimOperError Error -hi def link vimOper Operator -hi def link vimOption PreProc -hi def link vimParenSep Delimiter -hi def link vimPatSepErr vimPatSep -hi def link vimPatSepR vimPatSep -hi def link vimPatSep SpecialChar -hi def link vimPatSepZone vimString -hi def link vimPatSepZ vimPatSep -hi def link vimPattern Type -hi def link vimPlainMark vimMark -hi def link vimPlainRegister vimRegister -hi def link vimRegister SpecialChar -hi def link vimScriptDelim Comment -hi def link vimSearchDelim Statement -hi def link vimSearch vimString -hi def link vimSep Delimiter -hi def link vimSetMod vimOption -hi def link vimSetSep Statement -hi def link vimSetString vimString -hi def link vimSpecFile Identifier -hi def link vimSpecFileMod vimSpecFile -hi def link vimSpecial Type -hi def link vimStatement Statement -hi def link vimStringCont vimString -hi def link vimString String -hi def link vimSubst1 vimSubst -hi def link vimSubstDelim Delimiter -hi def link vimSubstFlags Special -hi def link vimSubstSubstr SpecialChar -hi def link vimSubstTwoBS vimString -hi def link vimSubst vimCommand -hi def link vimSynCaseError Error -hi def link vimSynCase Type -hi def link vimSyncC Type -hi def link vimSyncError Error -hi def link vimSyncGroupName vimGroupName -hi def link vimSyncGroup vimGroupName -hi def link vimSyncKey Type -hi def link vimSyncNone Type -hi def link vimSynContains vimSynOption -hi def link vimSynError Error -hi def link vimSynKeyContainedin vimSynContains -hi def link vimSynKeyOpt vimSynOption -hi def link vimSynMtchGrp vimSynOption -hi def link vimSynMtchOpt vimSynOption -hi def link vimSynNextgroup vimSynOption -hi def link vimSynNotPatRange vimSynRegPat -hi def link vimSynOption Special -hi def link vimSynPatRange vimString -hi def link vimSynRegOpt vimSynOption -hi def link vimSynRegPat vimString -hi def link vimSynReg Type -hi def link vimSyntax vimCommand -hi def link vimSynType vimSpecial -hi def link vimTodo Todo -hi def link vimUnmap vimMap -hi def link nvimUnmap vimMap -hi def link vimUserAttrbCmpltFunc Special -hi def link vimUserAttrbCmplt vimSpecial -hi def link vimUserAttrbKey vimOption -hi def link vimUserAttrb vimSpecial -hi def link vimUserAttrbError Error -hi def link vimUserCmdError Error -hi def link vimUserCommand vimCommand -hi def link vimUserFunc Normal -hi def link vimVar Identifier -hi def link vimWarn WarningMsg + hi def link vimAbb vimCommand + hi def link vimAddress vimMark + hi def link vimAugroupError vimError + hi def link vimAugroupKey vimCommand + hi def link vimAuHighlight vimHighlight + hi def link vimAutoCmdOpt vimOption + hi def link vimAutoCmd vimCommand + hi def link vimAutoEvent Type + hi def link vimAutoSet vimCommand + hi def link vimBehaveModel vimBehave + hi def link vimBehave vimCommand + hi def link vimBracket Delimiter + hi def link vimCmplxRepeat SpecialChar + hi def link vimCommand Statement + hi def link vimComment Comment + hi def link vimCommentString vimString + hi def link vimCommentTitle PreProc + hi def link vimCondHL vimCommand + hi def link vimContinue Special + hi def link vimCtrlChar SpecialChar + hi def link vimEchoHLNone vimGroup + hi def link vimEchoHL vimCommand + hi def link vimElseIfErr Error + hi def link vimElseif vimCondHL + hi def link vimEnvvar PreProc + hi def link vimError Error + hi def link vimFBVar vimVar + hi def link vimFgBgAttrib vimHiAttrib + hi def link vimFold Folded + hi def link vimFTCmd vimCommand + hi def link vimFTOption vimSynType + hi def link vimFuncKey vimCommand + hi def link vimFuncName Function + hi def link vimFuncSID Special + hi def link vimFuncVar Identifier + hi def link vimGroupAdd vimSynOption + hi def link vimGroupName vimGroup + hi def link vimGroupRem vimSynOption + hi def link vimGroupSpecial Special + hi def link vimGroup Type + hi def link vimHiAttrib PreProc + hi def link vimHiClear vimHighlight + hi def link vimHiCtermFgBg vimHiTerm + hi def link vimHiCTerm vimHiTerm + hi def link vimHighlight vimCommand + hi def link vimHiGroup vimGroupName + hi def link vimHiGuiFgBg vimHiTerm + hi def link vimHiGuiFont vimHiTerm + hi def link vimHiGuiRgb vimNumber + hi def link vimHiGui vimHiTerm + hi def link vimHiNmbr Number + hi def link vimHiStartStop vimHiTerm + hi def link vimHiTerm Type + hi def link vimHLGroup vimGroup + hi def link vimHLMod PreProc + hi def link vimInsert vimString + hi def link vimIskSep Delimiter + hi def link vimKeyCode vimSpecFile + hi def link vimKeyword Statement + hi def link vimLet vimCommand + hi def link vimLineComment vimComment + hi def link vimMapBang vimCommand + hi def link vimMapModKey vimFuncSID + hi def link vimMapMod vimBracket + hi def link vimMap vimCommand + hi def link vimMark Number + hi def link vimMarkNumber vimNumber + hi def link vimMenuMod vimMapMod + hi def link vimMenuNameMore vimMenuName + hi def link vimMenuName PreProc + hi def link vimMtchComment vimComment + hi def link vimNorm vimCommand + hi def link vimNotation Special + hi def link vimNotFunc vimCommand + hi def link vimNotPatSep vimString + hi def link vimNumber Number + hi def link vimOperError Error + hi def link vimOper Operator + hi def link vimOption PreProc + hi def link vimParenSep Delimiter + hi def link vimPatSepErr vimPatSep + hi def link vimPatSepR vimPatSep + hi def link vimPatSep SpecialChar + hi def link vimPatSepZone vimString + hi def link vimPatSepZ vimPatSep + hi def link vimPattern Type + hi def link vimPlainMark vimMark + hi def link vimPlainRegister vimRegister + hi def link vimRegister SpecialChar + hi def link vimScriptDelim Comment + hi def link vimSearchDelim Statement + hi def link vimSearch vimString + hi def link vimSep Delimiter + hi def link vimSetMod vimOption + hi def link vimSetSep Statement + hi def link vimSetString vimString + hi def link vimSpecFile Identifier + hi def link vimSpecFileMod vimSpecFile + hi def link vimSpecial Type + hi def link vimStatement Statement + hi def link vimStringCont vimString + hi def link vimString String + hi def link vimSubst1 vimSubst + hi def link vimSubstDelim Delimiter + hi def link vimSubstFlags Special + hi def link vimSubstSubstr SpecialChar + hi def link vimSubstTwoBS vimString + hi def link vimSubst vimCommand + hi def link vimSynCaseError Error + hi def link vimSynCase Type + hi def link vimSyncC Type + hi def link vimSyncError Error + hi def link vimSyncGroupName vimGroupName + hi def link vimSyncGroup vimGroupName + hi def link vimSyncKey Type + hi def link vimSyncNone Type + hi def link vimSynContains vimSynOption + hi def link vimSynError Error + hi def link vimSynKeyContainedin vimSynContains + hi def link vimSynKeyOpt vimSynOption + hi def link vimSynMtchGrp vimSynOption + hi def link vimSynMtchOpt vimSynOption + hi def link vimSynNextgroup vimSynOption + hi def link vimSynNotPatRange vimSynRegPat + hi def link vimSynOption Special + hi def link vimSynPatRange vimString + hi def link vimSynRegOpt vimSynOption + hi def link vimSynRegPat vimString + hi def link vimSynReg Type + hi def link vimSyntax vimCommand + hi def link vimSynType vimSpecial + hi def link vimTodo Todo + hi def link vimUnmap vimMap + hi def link vimUserAttrbCmpltFunc Special + hi def link vimUserAttrbCmplt vimSpecial + hi def link vimUserAttrbKey vimOption + hi def link vimUserAttrb vimSpecial + hi def link vimUserAttrbError Error + hi def link vimUserCmdError Error + hi def link vimUserCommand vimCommand + hi def link vimUserFunc Normal + hi def link vimVar Identifier + hi def link vimWarn WarningMsg + + hi def link nvimAutoEvent vimAutoEvent + hi def link nvimHLGroup vimHLGroup + hi def link nvimMap vimMap + hi def link nvimUnmap vimUnmap +endif " Current Syntax Variable: {{{2 let b:current_syntax = "vim" diff --git a/runtime/syntax/virata.vim b/runtime/syntax/virata.vim index e597b8e31c..0ed54fa899 100644 --- a/runtime/syntax/virata.vim +++ b/runtime/syntax/virata.vim @@ -13,10 +13,8 @@ " Setup Syntax: -if version < 600 - " Clear old syntax settings - syn clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif " Virata syntax is case insensitive (mostly) @@ -156,63 +154,53 @@ syn sync minlines=50 "for multiple region nesting " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later : only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_virata_syntax_inits") - if version < 508 - let did_virata_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - " Sub Links: - HiLink virataDefSubstError virataPreProcError - HiLink virataDefSubst virataPreProc - HiLink virataInAlter virataOperator - HiLink virataInExec virataOperator - HiLink virataInExport virataOperator - HiLink virataInImport virataOperator - HiLink virataInInstance virataOperator - HiLink virataInMake virataOperator - HiLink virataInModule virataOperator - HiLink virataInProcess virataOperator - HiLink virataInMacAddr virataHexNumber +" Sub Links: +hi def link virataDefSubstError virataPreProcError +hi def link virataDefSubst virataPreProc +hi def link virataInAlter virataOperator +hi def link virataInExec virataOperator +hi def link virataInExport virataOperator +hi def link virataInImport virataOperator +hi def link virataInInstance virataOperator +hi def link virataInMake virataOperator +hi def link virataInModule virataOperator +hi def link virataInProcess virataOperator +hi def link virataInMacAddr virataHexNumber - " Comment Group: - HiLink virataComment Comment - HiLink virataSpclComment SpecialComment - HiLink virataInCommentTodo Todo +" Comment Group: +hi def link virataComment Comment +hi def link virataSpclComment SpecialComment +hi def link virataInCommentTodo Todo - " Constant Group: - HiLink virataString String - HiLink virataStringError Error - HiLink virataCharacter Character - HiLink virataSpclChar Special - HiLink virataDecNumber Number - HiLink virataHexNumber Number - HiLink virataSizeNumber Number - HiLink virataNumberError Error +" Constant Group: +hi def link virataString String +hi def link virataStringError Error +hi def link virataCharacter Character +hi def link virataSpclChar Special +hi def link virataDecNumber Number +hi def link virataHexNumber Number +hi def link virataSizeNumber Number +hi def link virataNumberError Error - " Identifier Group: - HiLink virataIdentError Error +" Identifier Group: +hi def link virataIdentError Error - " PreProc Group: - HiLink virataPreProc PreProc - HiLink virataDefine Define - HiLink virataInclude Include - HiLink virataPreCondit PreCondit - HiLink virataPreProcError Error - HiLink virataPreProcWarn Todo +" PreProc Group: +hi def link virataPreProc PreProc +hi def link virataDefine Define +hi def link virataInclude Include +hi def link virataPreCondit PreCondit +hi def link virataPreProcError Error +hi def link virataPreProcWarn Todo - " Directive Group: - HiLink virataStatement Statement - HiLink virataCfgStatement Statement - HiLink virataOperator Operator - HiLink virataDirective Keyword +" Directive Group: +hi def link virataStatement Statement +hi def link virataCfgStatement Statement +hi def link virataOperator Operator +hi def link virataDirective Keyword - delcommand HiLink -endif let b:current_syntax = "virata" diff --git a/runtime/syntax/vmasm.vim b/runtime/syntax/vmasm.vim index 85d0441258..c5cbb1e3a2 100644 --- a/runtime/syntax/vmasm.vim +++ b/runtime/syntax/vmasm.vim @@ -6,11 +6,8 @@ " This is incomplete. Feel free to contribute... " -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -196,55 +193,45 @@ syn match vmasmDirective "\.\(signed_\)\=word\>" syn case match " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_macro_syntax_inits") - if version < 508 - let did_macro_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - " The default methods for highlighting. Can be overridden later - " Comment Constant Error Identifier PreProc Special Statement Todo Type - " - " Constant Boolean Character Number String - " Identifier Function - " PreProc Define Include Macro PreCondit - " Special Debug Delimiter SpecialChar SpecialComment Tag - " Statement Conditional Exception Keyword Label Operator Repeat - " Type StorageClass Structure Typedef +" The default methods for highlighting. Can be overridden later +" Comment Constant Error Identifier PreProc Special Statement Todo Type +" +" Constant Boolean Character Number String +" Identifier Function +" PreProc Define Include Macro PreCondit +" Special Debug Delimiter SpecialChar SpecialComment Tag +" Statement Conditional Exception Keyword Label Operator Repeat +" Type StorageClass Structure Typedef - HiLink vmasmComment Comment - HiLink vmasmTodo Todo +hi def link vmasmComment Comment +hi def link vmasmTodo Todo - HiLink vmasmhexNumber Number " Constant - HiLink vmasmoctNumber Number " Constant - HiLink vmasmbinNumber Number " Constant - HiLink vmasmdecNumber Number " Constant - HiLink vmasmfloatNumber Number " Constant +hi def link vmasmhexNumber Number " Constant +hi def link vmasmoctNumber Number " Constant +hi def link vmasmbinNumber Number " Constant +hi def link vmasmdecNumber Number " Constant +hi def link vmasmfloatNumber Number " Constant -" HiLink vmasmString String " Constant +" hi def link vmasmString String " Constant - HiLink vmasmReg Identifier - HiLink vmasmOperator Identifier +hi def link vmasmReg Identifier +hi def link vmasmOperator Identifier - HiLink vmasmInclude Include " PreProc - HiLink vmasmMacro Macro " PreProc - " HiLink vmasmMacroParam Keyword " Statement +hi def link vmasmInclude Include " PreProc +hi def link vmasmMacro Macro " PreProc +" hi def link vmasmMacroParam Keyword " Statement - HiLink vmasmDirective Special - HiLink vmasmPreCond Special +hi def link vmasmDirective Special +hi def link vmasmPreCond Special - HiLink vmasmOpcode Statement - HiLink vmasmCond Conditional " Statement - HiLink vmasmRepeat Repeat " Statement +hi def link vmasmOpcode Statement +hi def link vmasmCond Conditional " Statement +hi def link vmasmRepeat Repeat " Statement - HiLink vmasmLabel Type - delcommand HiLink -endif +hi def link vmasmLabel Type let b:current_syntax = "vmasm" diff --git a/runtime/syntax/vrml.vim b/runtime/syntax/vrml.vim index 44814aad86..2474493c94 100644 --- a/runtime/syntax/vrml.vim +++ b/runtime/syntax/vrml.vim @@ -5,11 +5,8 @@ " Former Maintainer: Gregory Seidman " Last change: 2006 May 03 -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -168,11 +165,9 @@ syn keyword VRMLProtos contained EXTERNPROTO PROTO IS syn keyword VRMLRoutes contained ROUTE TO -if version >= 502 "containment! - syn include @jscript $VIMRUNTIME/syntax/javascript.vim - syn region VRMLjScriptString contained start=+"\(\(javascript\)\|\(vrmlscript\)\|\(ecmascript\)\):+ms=e+1 skip=+\\\\\|\\"+ end=+"+me=e-1 contains=@jscript -endif +syn include @jscript $VIMRUNTIME/syntax/javascript.vim +syn region VRMLjScriptString contained start=+"\(\(javascript\)\|\(vrmlscript\)\|\(ecmascript\)\):+ms=e+1 skip=+\\\\\|\\"+ end=+"+me=e-1 contains=@jscript " match definitions. syn match VRMLSpecial contained "\\[0-9][0-9][0-9]\|\\." @@ -192,47 +187,35 @@ syn region VRMLInstName start="USE\>"hs=e+1 skip="USE\(,\|\s\)*" end="[A-Za-z syn keyword VRMLInstances contained DEF USE syn sync minlines=1 -if version >= 600 "FOLDS! - syn sync fromstart - "setlocal foldmethod=syntax - syn region braceFold start="{" end="}" transparent fold contains=TOP - syn region bracketFold start="\[" end="]" transparent fold contains=TOP - syn region VRMLString start=+"+ skip=+\\\\\|\\"+ end=+"+ fold contains=VRMLSpecial,VRMLjScriptString -endif +syn sync fromstart +"setlocal foldmethod=syntax +syn region braceFold start="{" end="}" transparent fold contains=TOP +syn region bracketFold start="\[" end="]" transparent fold contains=TOP +syn region VRMLString start=+"+ skip=+\\\\\|\\"+ end=+"+ fold contains=VRMLSpecial,VRMLjScriptString " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_VRML_syntax_inits") - if version < 508 - let did_VRML_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink VRMLCharacter VRMLString - HiLink VRMLSpecialCharacter VRMLSpecial - HiLink VRMLNumber VRMLString - HiLink VRMLValues VRMLString - HiLink VRMLString String - HiLink VRMLSpecial Special - HiLink VRMLComment Comment - HiLink VRMLNodes Statement - HiLink VRMLFields Type - HiLink VRMLEvents Type - HiLink VRMLfTypes LineNr +hi def link VRMLCharacter VRMLString +hi def link VRMLSpecialCharacter VRMLSpecial +hi def link VRMLNumber VRMLString +hi def link VRMLValues VRMLString +hi def link VRMLString String +hi def link VRMLSpecial Special +hi def link VRMLComment Comment +hi def link VRMLNodes Statement +hi def link VRMLFields Type +hi def link VRMLEvents Type +hi def link VRMLfTypes LineNr " hi VRMLfTypes ctermfg=6 guifg=Brown - HiLink VRMLInstances PreCondit - HiLink VRMLRoutes PreCondit - HiLink VRMLProtos PreProc - HiLink VRMLRouteNode Identifier - HiLink VRMLInstName Identifier - HiLink VRMLTypes Identifier +hi def link VRMLInstances PreCondit +hi def link VRMLRoutes PreCondit +hi def link VRMLProtos PreProc +hi def link VRMLRouteNode Identifier +hi def link VRMLInstName Identifier +hi def link VRMLTypes Identifier - delcommand HiLink -endif let b:current_syntax = "vrml" diff --git a/runtime/syntax/vroom.vim b/runtime/syntax/vroom.vim index 0cd6ccce1d..0509e30b17 100644 --- a/runtime/syntax/vroom.vim +++ b/runtime/syntax/vroom.vim @@ -3,11 +3,8 @@ " Maintainer: David Barnett (https://github.com/google/vim-ft-vroom) " Last Change: 2014 Jul 23 -" For version 5.x: Clear all syntax items. -" For version 6.x and later: Quit when a syntax file was already loaded. -if v:version < 600 - syntax clear -elseif exists('b:current_syntax') +" quit when a syntax file was already loaded +if exists('b:current_syntax') finish endif diff --git a/runtime/syntax/vsejcl.vim b/runtime/syntax/vsejcl.vim index f4f00c65ea..f329836236 100644 --- a/runtime/syntax/vsejcl.vim +++ b/runtime/syntax/vsejcl.vim @@ -4,11 +4,8 @@ " URL: " Last change: 2001 May 10 -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -23,26 +20,16 @@ syn match vsejclString /'.\{-}'/ syn match vsejclParms /(.\{-})/ contained " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_vsejcl_syntax") - if version < 508 - let did_vsejcl_syntax = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink vsejclComment Comment - HiLink vsejclField Type - HiLink vsejclKeyword Statement - HiLink vsejclObject Constant - HiLink vsejclString Constant - HiLink vsejclMisc Special - HiLink vsejclParms Constant +hi def link vsejclComment Comment +hi def link vsejclField Type +hi def link vsejclKeyword Statement +hi def link vsejclObject Constant +hi def link vsejclString Constant +hi def link vsejclMisc Special +hi def link vsejclParms Constant - delcommand HiLink -endif let b:current_syntax = "vsejcl" diff --git a/runtime/syntax/wdiff.vim b/runtime/syntax/wdiff.vim index 9cd0611819..d0afadff2f 100644 --- a/runtime/syntax/wdiff.vim +++ b/runtime/syntax/wdiff.vim @@ -9,11 +9,8 @@ " SPAM is _NOT_ welcome - be ready to be reported! -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syn clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -23,21 +20,10 @@ syn region wdiffNew start="{+" end="+}" " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_wdiff_syn_inits") - let did_wdiff_syn_inits = 1 - if version < 508 - let did_wdiff_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink wdiffOld Special - HiLink wdiffNew Identifier +hi def link wdiffOld Special +hi def link wdiffNew Identifier - delcommand HiLink -endif let b:current_syntax = "wdiff" diff --git a/runtime/syntax/web.vim b/runtime/syntax/web.vim index f7a7fdfdc2..54eebda399 100644 --- a/runtime/syntax/web.vim +++ b/runtime/syntax/web.vim @@ -8,11 +8,8 @@ " the standard WEB distribution, available for anonymous ftp at " ftp://labrea.stanford.edu/pub/tex/web/. -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -20,12 +17,8 @@ endif " we base this syntax file on the modern superset, CWEB. Note: This shortcut " may introduce some illegal constructs, e.g., CWEB's "@c" does _not_ start a " code section in WEB. Anyway, I'm not a WEB programmer. -if version < 600 - source :p:h/cweb.vim -else - runtime! syntax/cweb.vim - unlet b:current_syntax -endif +runtime! syntax/cweb.vim +unlet b:current_syntax " Replace C/C++ syntax by Pascal syntax. syntax include @webIncludedC :p:h/pascal.vim diff --git a/runtime/syntax/webmacro.vim b/runtime/syntax/webmacro.vim index 3b863f7c37..fb1fff6d3d 100644 --- a/runtime/syntax/webmacro.vim +++ b/runtime/syntax/webmacro.vim @@ -11,21 +11,16 @@ " For version 5.x: Clear all syntax items " For version 6.x: Quit when a syntax file was already loaded if !exists("main_syntax") - if version < 600 - syntax clear - elseif exists("b:current_syntax") + " quit when a syntax file was already loaded + if exists("b:current_syntax") finish endif let main_syntax = 'webmacro' endif -if version < 600 - source :p:h/html.vim -else - runtime! syntax/html.vim - unlet b:current_syntax -endif +runtime! syntax/html.vim +unlet b:current_syntax syn cluster htmlPreProc add=webmacroIf,webmacroUse,webmacroBraces,webmacroParse,webmacroInclude,webmacroSet,webmacroForeach,webmacroComment @@ -49,31 +44,21 @@ syn match webmacroComment "##.*$" syn match webmacroHash "[#{}\$]" contained " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_webmacro_syn_inits") - if version < 508 - let did_webmacro_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink webmacroComment CommentTitle - HiLink webmacroVariable PreProc - HiLink webmacroIf webmacroStatement - HiLink webmacroForeach webmacroStatement - HiLink webmacroSet webmacroStatement - HiLink webmacroInclude webmacroStatement - HiLink webmacroParse webmacroStatement - HiLink webmacroStatement Function - HiLink webmacroNumber Number - HiLink webmacroBoolean Boolean - HiLink webmacroSpecial Special - HiLink webmacroString String - HiLink webmacroBracesError Error - delcommand HiLink -endif +hi def link webmacroComment CommentTitle +hi def link webmacroVariable PreProc +hi def link webmacroIf webmacroStatement +hi def link webmacroForeach webmacroStatement +hi def link webmacroSet webmacroStatement +hi def link webmacroInclude webmacroStatement +hi def link webmacroParse webmacroStatement +hi def link webmacroStatement Function +hi def link webmacroNumber Number +hi def link webmacroBoolean Boolean +hi def link webmacroSpecial Special +hi def link webmacroString String +hi def link webmacroBracesError Error let b:current_syntax = "webmacro" diff --git a/runtime/syntax/winbatch.vim b/runtime/syntax/winbatch.vim index aea2cdebcb..15ea0fc77b 100644 --- a/runtime/syntax/winbatch.vim +++ b/runtime/syntax/winbatch.vim @@ -4,11 +4,8 @@ " URL: http://www.mggen.com/vim/syntax/winbatch.zip " Last change: 2001 May 10 -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -158,29 +155,19 @@ syn keyword winbatchImplicit xgetchildhwnd xgetelapsed xhex xmemcompact xmessage syn keyword winbatchImplicit xsendmessage xverifyccard yield " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_winbatch_syntax_inits") - if version < 508 - let did_winbatch_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink winbatchLabel PreProc - HiLink winbatchCtl Operator - HiLink winbatchStatement Statement - HiLink winbatchTodo Todo - HiLink winbatchString String - HiLink winbatchVar Type - HiLink winbatchComment Comment - HiLink winbatchImplicit Special - HiLink winbatchNumber Number - HiLink winbatchConstant StorageClass +hi def link winbatchLabel PreProc +hi def link winbatchCtl Operator +hi def link winbatchStatement Statement +hi def link winbatchTodo Todo +hi def link winbatchString String +hi def link winbatchVar Type +hi def link winbatchComment Comment +hi def link winbatchImplicit Special +hi def link winbatchNumber Number +hi def link winbatchConstant StorageClass - delcommand HiLink -endif let b:current_syntax = "winbatch" diff --git a/runtime/syntax/wml.vim b/runtime/syntax/wml.vim index 5957930c8e..73bf822e40 100644 --- a/runtime/syntax/wml.vim +++ b/runtime/syntax/wml.vim @@ -16,21 +16,14 @@ " vim-package around your corner :) -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syn clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif " A lot of the web stuff looks like HTML so we load that first -if version < 600 - so :p:h/html.vim -else - runtime! syntax/html.vim -endif +runtime! syntax/html.vim unlet b:current_syntax if !exists("main_syntax") @@ -108,11 +101,7 @@ syn region htmlTagName start="\<\(define-tag\|define-region\)" end="\>" cont " The perl include stuff if main_syntax != 'perl' " Perl script - if version < 600 - syn include @wmlPerlScript :p:h/perl.vim - else - syn include @wmlPerlScript syntax/perl.vim - endif + syn include @wmlPerlScript syntax/perl.vim unlet b:current_syntax syn region perlScript start=++ keepend end=++ contains=@wmlPerlScript,wmlPerlTag @@ -140,33 +129,22 @@ if main_syntax == "html" endif " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_wml_syn_inits") - let did_wml_syn_inits = 1 - if version < 508 - let did_wml_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink wmlNextLine Special - HiLink wmlUse Include - HiLink wmlUsed String - HiLink wmlBody Special - HiLink wmlDiverted Label - HiLink wmlDivert Delimiter - HiLink wmlDivertEnd Delimiter - HiLink wmlLocationId Label - HiLink wmlLocation Delimiter -" HiLink wmlLocationed Delimiter - HiLink wmlDefineName String - HiLink wmlComment Comment - HiLink wmlInclude Include - HiLink wmlSharpBang PreProc +hi def link wmlNextLine Special +hi def link wmlUse Include +hi def link wmlUsed String +hi def link wmlBody Special +hi def link wmlDiverted Label +hi def link wmlDivert Delimiter +hi def link wmlDivertEnd Delimiter +hi def link wmlLocationId Label +hi def link wmlLocation Delimiter +" hi def link wmlLocationed Delimiter +hi def link wmlDefineName String +hi def link wmlComment Comment +hi def link wmlInclude Include +hi def link wmlSharpBang PreProc - delcommand HiLink -endif let b:current_syntax = "wml" diff --git a/runtime/syntax/wsml.vim b/runtime/syntax/wsml.vim index 2a92a0d548..d01294caac 100644 --- a/runtime/syntax/wsml.vim +++ b/runtime/syntax/wsml.vim @@ -4,10 +4,8 @@ " URL: none " Last Change: 2006 Apr 30 -" Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -78,47 +76,37 @@ syn match wsmlSpecial "\\u\d\{4\}" syn cluster wsmlTop add=wsmlString,wsmlCharacter,wsmlNumber,wsmlSpecial,wsmlStringError " Define the default highlighting. -" " For version 5.7 and earlier: only when not done already -" " For version 5.8 and later: only when an item doesn't have highlighting yet - if version >= 508 || !exists("did_wsml_syn_inits") - if version < 508 - let did_wsml_syn_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - HiLink wsmlHeader TypeDef - HiLink wsmlNamespace TypeDef - HiLink wsmlOntology Statement - HiLink wsmlAxiom TypeDef - HiLink wsmlService TypeDef - HiLink wsmlNFP TypeDef - HiLink wsmlTopLevel TypeDef - HiLink wsmlMediation TypeDef - HiLink wsmlBehavioral TypeDef - HiLink wsmlChoreographyPri TypeDef - HiLink wsmlChoreographySec Operator - HiLink wsmlChoreographyTer Special - HiLink wsmlString String - HiLink wsmlIdentifier Normal - HiLink wsmlSqName Normal - HiLink wsmlVariable Define - HiLink wsmlKeywordsInsideLEs Operator - HiLink wsmlOperator Operator - HiLink wsmlBrace Operator - HiLink wsmlCharacter Character - HiLink wsmlNumber Number - HiLink wsmlDataTypes Special - HiLink wsmlComment Comment - HiLink wsmlDocComment Comment - HiLink wsmlLineComment Comment - HiLink wsmlTodo Todo - HiLink wsmlFixMe Error - HiLink wsmlCommentTitle SpecialComment - HiLink wsmlCommentStar wsmlComment - endif +" Only when an item doesn't have highlighting yet +hi def link wsmlHeader TypeDef +hi def link wsmlNamespace TypeDef +hi def link wsmlOntology Statement +hi def link wsmlAxiom TypeDef +hi def link wsmlService TypeDef +hi def link wsmlNFP TypeDef +hi def link wsmlTopLevel TypeDef +hi def link wsmlMediation TypeDef +hi def link wsmlBehavioral TypeDef +hi def link wsmlChoreographyPri TypeDef +hi def link wsmlChoreographySec Operator +hi def link wsmlChoreographyTer Special +hi def link wsmlString String +hi def link wsmlIdentifier Normal +hi def link wsmlSqName Normal +hi def link wsmlVariable Define +hi def link wsmlKeywordsInsideLEs Operator +hi def link wsmlOperator Operator +hi def link wsmlBrace Operator +hi def link wsmlCharacter Character +hi def link wsmlNumber Number +hi def link wsmlDataTypes Special +hi def link wsmlComment Comment +hi def link wsmlDocComment Comment +hi def link wsmlLineComment Comment +hi def link wsmlTodo Todo +hi def link wsmlFixMe Error +hi def link wsmlCommentTitle SpecialComment +hi def link wsmlCommentStar wsmlComment -delcommand HiLink let b:current_syntax = "wsml" let b:spell_options="contained" diff --git a/runtime/syntax/xdefaults.vim b/runtime/syntax/xdefaults.vim index 5e38952a75..7da5969cde 100644 --- a/runtime/syntax/xdefaults.vim +++ b/runtime/syntax/xdefaults.vim @@ -10,11 +10,8 @@ " xrdb manual page " xrdb source: ftp://ftp.x.org/pub/R6.4/xc/programs/xrdb/xrdb.c -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -109,36 +106,26 @@ syn keyword xdefaultsSymbol contained X_RESOLUTION syn keyword xdefaultsSymbol contained Y_RESOLUTION " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_xdefaults_syntax_inits") - if version < 508 - let did_xdefaults_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - HiLink xdefaultsLabel Type - HiLink xdefaultsValue Constant - HiLink xdefaultsComment Comment - HiLink xdefaultsCommentH xdefaultsComment - HiLink xdefaultsPreProc PreProc - HiLink xdefaultsInclude xdefaultsPreProc - HiLink xdefaultsCppSkip xdefaultsCppOut - HiLink xdefaultsCppOut2 xdefaultsCppOut - HiLink xdefaultsCppOut Comment - HiLink xdefaultsIncluded String - HiLink xdefaultsDefine Macro - HiLink xdefaultsSymbol Statement - HiLink xdefaultsSpecial Statement - HiLink xdefaultsErrorLine Error - HiLink xdefaultsCommentError Error - HiLink xdefaultsPunct Normal - HiLink xdefaultsLineEnd Special - HiLink xdefaultsTodo Todo +" Only when an item doesn't have highlighting yet +hi def link xdefaultsLabel Type +hi def link xdefaultsValue Constant +hi def link xdefaultsComment Comment +hi def link xdefaultsCommentH xdefaultsComment +hi def link xdefaultsPreProc PreProc +hi def link xdefaultsInclude xdefaultsPreProc +hi def link xdefaultsCppSkip xdefaultsCppOut +hi def link xdefaultsCppOut2 xdefaultsCppOut +hi def link xdefaultsCppOut Comment +hi def link xdefaultsIncluded String +hi def link xdefaultsDefine Macro +hi def link xdefaultsSymbol Statement +hi def link xdefaultsSpecial Statement +hi def link xdefaultsErrorLine Error +hi def link xdefaultsCommentError Error +hi def link xdefaultsPunct Normal +hi def link xdefaultsLineEnd Special +hi def link xdefaultsTodo Todo - delcommand HiLink -endif let b:current_syntax = "xdefaults" diff --git a/runtime/syntax/xf86conf.vim b/runtime/syntax/xf86conf.vim index 62784d2285..545eda7db0 100644 --- a/runtime/syntax/xf86conf.vim +++ b/runtime/syntax/xf86conf.vim @@ -10,12 +10,8 @@ " to force XFree86 3.x or 4.x XF86Config syntax " Setup -if version >= 600 - if exists("b:current_syntax") - finish - endif -else - echo "Sorry, but this syntax file relies on Vim 6 features. Either upgrade Vim or usea version of " . expand(":t:r") . " syntax file appropriate for Vim " . version/100 . "." . version %100 . "." +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif diff --git a/runtime/syntax/xinetd.vim b/runtime/syntax/xinetd.vim index 9010a48a1d..fab3a916ea 100644 --- a/runtime/syntax/xinetd.vim +++ b/runtime/syntax/xinetd.vim @@ -1,7 +1,7 @@ " Vim syntax file -" Language: xinetd.conf(5) configuration file -" Maintainer: Nikolai Weibull -" Latest Revision: 2006-04-19 +" Language: xinetd.conf(5) configuration file +" Previous Maintainer: Nikolai Weibull +" Latest Revision: 2006-04-19 if exists("b:current_syntax") finish diff --git a/runtime/syntax/xkb.vim b/runtime/syntax/xkb.vim index ff9bfd0dae..59fc497e62 100644 --- a/runtime/syntax/xkb.vim +++ b/runtime/syntax/xkb.vim @@ -6,12 +6,9 @@ " URL: http://trific.ath.cx/Ftp/vim/syntax/xkb.vim " Setup -if version >= 600 - if exists("b:current_syntax") - finish - endif -else - syntax clear +" quit when a syntax file was already loaded +if exists("b:current_syntax") + finish endif syn case match @@ -50,42 +47,33 @@ syn keyword xkbTModif default hidden partial virtual syn keyword xkbSect alphanumeric_keys alternate_group function_keys keypad_keys modifier_keys xkb_compatibility xkb_geometry xkb_keycodes xkb_keymap xkb_semantics xkb_symbols xkb_types " Define the default highlighting -if version >= 508 || !exists("did_xkb_syntax_inits") - if version < 508 - let did_xkb_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - HiLink xkbModif xkbPreproc - HiLink xkbTModif xkbPreproc - HiLink xkbPreproc Preproc +hi def link xkbModif xkbPreproc +hi def link xkbTModif xkbPreproc +hi def link xkbPreproc Preproc - HiLink xkbIdentifier Keyword - HiLink xkbFunction Function - HiLink xkbSect Type - HiLink xkbPhysicalKey Identifier - HiLink xkbKeyword Keyword +hi def link xkbIdentifier Keyword +hi def link xkbFunction Function +hi def link xkbSect Type +hi def link xkbPhysicalKey Identifier +hi def link xkbKeyword Keyword - HiLink xkbComment Comment - HiLink xkbTodo Todo +hi def link xkbComment Comment +hi def link xkbTodo Todo - HiLink xkbConstant Constant - HiLink xkbString String +hi def link xkbConstant Constant +hi def link xkbString String - HiLink xkbSpecialChar xkbSpecial - HiLink xkbSpecial Special +hi def link xkbSpecialChar xkbSpecial +hi def link xkbSpecial Special - HiLink xkbParenError xkbBalancingError - HiLink xkbBraceError xkbBalancingError - HiLink xkbBraketError xkbBalancingError - HiLink xkbBalancingError xkbError - HiLink xkbCommentStartError xkbCommentError - HiLink xkbCommentError xkbError - HiLink xkbError Error +hi def link xkbParenError xkbBalancingError +hi def link xkbBraceError xkbBalancingError +hi def link xkbBraketError xkbBalancingError +hi def link xkbBalancingError xkbError +hi def link xkbCommentStartError xkbCommentError +hi def link xkbCommentError xkbError +hi def link xkbError Error - delcommand HiLink -endif let b:current_syntax = "xkb" diff --git a/runtime/syntax/xmath.vim b/runtime/syntax/xmath.vim index 5434f928c7..22b3e85dae 100644 --- a/runtime/syntax/xmath.vim +++ b/runtime/syntax/xmath.vim @@ -1,15 +1,13 @@ " Vim syntax file " Language: xmath (a simulation tool) " Maintainer: Charles E. Campbell -" Last Change: Sep 11, 2006 -" Version: 7 +" Last Change: Aug 31, 2016 +" Version: 9 " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_XMATH " For version 5.x: Clear all syntax items " For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +if exists("b:current_syntax") finish endif @@ -194,41 +192,32 @@ syn sync match xmathSyncComment grouphere xmathCommentBlock "#{" syn sync match xmathSyncComment groupthere NONE "}#" " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_xmath_syntax_inits") - if version < 508 - let did_xmath_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +if !exists("skip_xmath_syntax_inits") - HiLink xmathBraceError xmathError - HiLink xmathCmd xmathStatement - HiLink xmathCommentBlock xmathComment - HiLink xmathCurlyError xmathError - HiLink xmathFuncCmd xmathStatement - HiLink xmathParenError xmathError + hi def link xmathBraceError xmathError + hi def link xmathCmd xmathStatement + hi def link xmathCommentBlock xmathComment + hi def link xmathCurlyError xmathError + hi def link xmathFuncCmd xmathStatement + hi def link xmathParenError xmathError " The default methods for highlighting. Can be overridden later - HiLink xmathCharacter Character - HiLink xmathComma Delimiter - HiLink xmathComment Comment - HiLink xmathCommentBlock Comment - HiLink xmathConditional Conditional - HiLink xmathError Error - HiLink xmathFunc Function - HiLink xmathLabel PreProc - HiLink xmathNumber Number - HiLink xmathRepeat Repeat - HiLink xmathSpecial Type - HiLink xmathSpecialChar SpecialChar - HiLink xmathStatement Statement - HiLink xmathString String - HiLink xmathTodo Todo + hi def link xmathCharacter Character + hi def link xmathComma Delimiter + hi def link xmathComment Comment + hi def link xmathCommentBlock Comment + hi def link xmathConditional Conditional + hi def link xmathError Error + hi def link xmathFunc Function + hi def link xmathLabel PreProc + hi def link xmathNumber Number + hi def link xmathRepeat Repeat + hi def link xmathSpecial Type + hi def link xmathSpecialChar SpecialChar + hi def link xmathStatement Statement + hi def link xmathString String + hi def link xmathTodo Todo - delcommand HiLink endif let b:current_syntax = "xmath" diff --git a/runtime/syntax/xmodmap.vim b/runtime/syntax/xmodmap.vim index 69c70c563d..28cae3eb71 100644 --- a/runtime/syntax/xmodmap.vim +++ b/runtime/syntax/xmodmap.vim @@ -1,7 +1,7 @@ " Vim syntax file -" Language: xmodmap(1) definition file -" Maintainer: Nikolai Weibull -" Latest Revision: 2006-04-19 +" Language: xmodmap(1) definition file +" Previous Maintainer: Nikolai Weibull +" Latest Revision: 2006-04-19 if exists("b:current_syntax") finish diff --git a/runtime/syntax/xpm.vim b/runtime/syntax/xpm.vim index 3cbc1b54fd..0667ca28ad 100644 --- a/runtime/syntax/xpm.vim +++ b/runtime/syntax/xpm.vim @@ -1,14 +1,12 @@ " Vim syntax file " Language: X Pixmap " Maintainer: Ronald Schild -" Last Change: 2008 May 28 +" Last Change: 2017 Feb 01 " Version: 5.4n.1 +" Jemma Nelson added termguicolors support -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -18,7 +16,7 @@ syn keyword xpmTodo TODO FIXME XXX contained syn region xpmComment start="/\*" end="\*/" contains=xpmTodo syn region xpmPixelString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=@xpmColors -if has("gui_running") +if has("gui_running") || has("termguicolors") && &termguicolors let color = "" let chars = "" @@ -123,27 +121,17 @@ endwhile unlet color chars colors cpp n i s -endif " has("gui_running") +endif " has("gui_running") || has("termguicolors") && &termguicolors " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_xpm_syntax_inits") - if version < 508 - let did_xpm_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink xpmType Type - HiLink xpmStorageClass StorageClass - HiLink xpmTodo Todo - HiLink xpmComment Comment - HiLink xpmPixelString String +hi def link xpmType Type +hi def link xpmStorageClass StorageClass +hi def link xpmTodo Todo +hi def link xpmComment Comment +hi def link xpmPixelString String - delcommand HiLink -endif let b:current_syntax = "xpm" diff --git a/runtime/syntax/xpm2.vim b/runtime/syntax/xpm2.vim index 74b3c66af2..dfa6945a31 100644 --- a/runtime/syntax/xpm2.vim +++ b/runtime/syntax/xpm2.vim @@ -1,17 +1,15 @@ " Vim syntax file " Language: X Pixmap v2 " Maintainer: Steve Wall (hitched97@velnet.com) -" Last Change: 2012 Jun 01 +" Last Change: 2017 Feb 01 " (Dominique Pelle added @Spell) " Version: 5.8 +" Jemma Nelson added termguicolors support " " Made from xpm.vim by Ronald Schild -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -23,15 +21,9 @@ syn keyword xpm2Todo TODO FIXME XXX contained syn match xpm2Comment "\!.*$" contains=@Spell,xpm2Todo -if version < 508 - command -nargs=+ HiLink hi link - command -nargs=+ Hi hi -else - command -nargs=+ HiLink hi def link - command -nargs=+ Hi hi def -endif +command -nargs=+ Hi hi def -if has("gui_running") +if has("gui_running") || has("termguicolors") && &termguicolors let color = "" let chars = "" @@ -63,7 +55,7 @@ if has("gui_running") if s !~ '/' exe 'syn match xpm2Values /' . s . '/' endif - HiLink xpm2Values Statement + hi def link xpm2Values Statement let n = 1 " n = color index @@ -112,11 +104,11 @@ if has("gui_running") " now create syntax items " highlight the color string as normal string (no pixel string) exe 'syn match xpm2Col'.n.'Def /'.s.'/ contains=xpm2Col'.n.'inDef' - exe 'HiLink xpm2Col'.n.'Def Constant' + exe 'hi def link xpm2Col'.n.'Def Constant' " but highlight the first whitespace after chars in its color exe 'syn match xpm2Col'.n.'inDef /^'.chars.'/hs=s+'.(cpp).' contained' - exe 'HiLink xpm2Col'.n.'inDef xpm2Color'.n + exe 'hi def link xpm2Col'.n.'inDef xpm2Color'.n " remove the following whitespace from chars let chars = substitute(chars, '\\s\\+$', '', '') @@ -141,24 +133,17 @@ if has("gui_running") unlet color chars colors cpp n i s -endif " has("gui_running") +endif " has("gui_running") || has("termguicolors") && &termguicolors " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_xpm2_syntax_inits") - if version < 508 - let did_xpm2_syntax_inits = 1 - endif +" Only when an item doesn't have highlighting yet +" The default highlighting. +hi def link xpm2Type Type +hi def link xpm2StorageClass StorageClass +hi def link xpm2Todo Todo +hi def link xpm2Comment Comment +hi def link xpm2PixelString String - " The default highlighting. - HiLink xpm2Type Type - HiLink xpm2StorageClass StorageClass - HiLink xpm2Todo Todo - HiLink xpm2Comment Comment - HiLink xpm2PixelString String -endif -delcommand HiLink delcommand Hi let b:current_syntax = "xpm2" diff --git a/runtime/syntax/xs.vim b/runtime/syntax/xs.vim index 6fd0a468f9..3e658b4a83 100644 --- a/runtime/syntax/xs.vim +++ b/runtime/syntax/xs.vim @@ -3,27 +3,19 @@ " Author: Autogenerated from perl headers, on an original basis of Michael W. Dodge " Maintainer: vim-perl " Previous: Vincent Pit -" Last Change: 2013-05-12 +" Last Change: 2017-09-12 -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +if exists("b:current_syntax") finish endif -" Read the C syntax to start with -if version < 600 - source :p:h/c.vim -else - runtime! syntax/c.vim -endif +runtime! syntax/c.vim -let xs_superseded = 1 " mark C functions superseded by Perl replacements -let xs_not_core = 1 " mark private core functions +" Configuration: +" let xs_superseded = 0 " mark C functions superseded by Perl replacements (ex. memcpy vs Copy) +" let xs_not_core = 0 " mark private core functions -if exists("xs_superseded") && xs_superseded +if get(g:, 'xs_superseded', 0) syn keyword xsSuperseded atof atol calloc clearerr exit fclose feof ferror syn keyword xsSuperseded fflush fgetc fgetpos fgets fopen fprintf fputc fputs syn keyword xsSuperseded fread free freopen fseek fsetpos fwrite getc getenv @@ -35,45 +27,78 @@ syn keyword xsSuperseded strcat strcmp strcpy strdup strlen strncat strncmp syn keyword xsSuperseded strncpy strstr strtod strtol strtoul system tolower syn keyword xsSuperseded toupper ungetc endif -if exists("xs_not_core") && xs_not_core +if get(g:, 'xs_not_core', 0) syn keyword xsPrivate F0convert Perl__add_range_to_invlist -syn keyword xsPrivate Perl__core_swash_init Perl__invlist_contents +syn keyword xsPrivate Perl__core_swash_init Perl__get_encoding +syn keyword xsPrivate Perl__get_swash_invlist Perl__invlist_contents +syn keyword xsPrivate Perl__invlist_dump syn keyword xsPrivate Perl__invlist_intersection_maybe_complement_2nd -syn keyword xsPrivate Perl__invlist_invert Perl__invlist_invert_prop -syn keyword xsPrivate Perl__invlist_populate_swatch +syn keyword xsPrivate Perl__invlist_invert Perl__invlist_populate_swatch +syn keyword xsPrivate Perl__invlist_search syn keyword xsPrivate Perl__invlist_union_maybe_complement_2nd -syn keyword xsPrivate Perl__is_utf8__perl_idstart Perl__new_invlist -syn keyword xsPrivate Perl__swash_inversion_hash Perl__swash_to_invlist -syn keyword xsPrivate Perl__to_fold_latin1 Perl_av_reify Perl_emulate_cop_io -syn keyword xsPrivate Perl_find_rundefsvoffset Perl_get_re_arg -syn keyword xsPrivate Perl_is_utf8_X_L Perl_is_utf8_X_LV Perl_is_utf8_X_LVT -syn keyword xsPrivate Perl_is_utf8_X_LV_LVT_V Perl_is_utf8_X_T -syn keyword xsPrivate Perl_is_utf8_X_V Perl_is_utf8_X_begin -syn keyword xsPrivate Perl_is_utf8_X_extend Perl_is_utf8_X_non_hangul -syn keyword xsPrivate Perl_is_utf8_X_prepend Perl_is_utf8_char -syn keyword xsPrivate Perl_new_warnings_bitfield Perl_op_clear -syn keyword xsPrivate Perl_ptr_table_clear Perl_qerror Perl_reg_named_buff -syn keyword xsPrivate Perl_reg_named_buff_iter Perl_reg_numbered_buff_fetch +syn keyword xsPrivate Perl__load_PL_utf8_foldclosures Perl__new_invlist +syn keyword xsPrivate Perl__setup_canned_invlist Perl__swash_inversion_hash +syn keyword xsPrivate Perl__swash_to_invlist Perl__to_fold_latin1 +syn keyword xsPrivate Perl__warn_problematic_locale Perl_av_reify +syn keyword xsPrivate Perl_current_re_engine Perl_cv_ckproto_len_flags +syn keyword xsPrivate Perl_emulate_cop_io Perl_find_rundefsvoffset +syn keyword xsPrivate Perl_get_re_arg Perl_grok_atoUV Perl_isALNUM_lazy +syn keyword xsPrivate Perl_isIDFIRST_lazy Perl_is_uni_alnum +syn keyword xsPrivate Perl_is_uni_alnum_lc Perl_is_uni_alnumc +syn keyword xsPrivate Perl_is_uni_alnumc_lc Perl_is_uni_alpha +syn keyword xsPrivate Perl_is_uni_alpha_lc Perl_is_uni_ascii +syn keyword xsPrivate Perl_is_uni_ascii_lc Perl_is_uni_blank +syn keyword xsPrivate Perl_is_uni_blank_lc Perl_is_uni_cntrl +syn keyword xsPrivate Perl_is_uni_cntrl_lc Perl_is_uni_digit +syn keyword xsPrivate Perl_is_uni_digit_lc Perl_is_uni_graph +syn keyword xsPrivate Perl_is_uni_graph_lc Perl_is_uni_idfirst +syn keyword xsPrivate Perl_is_uni_idfirst_lc Perl_is_uni_lower +syn keyword xsPrivate Perl_is_uni_lower_lc Perl_is_uni_print +syn keyword xsPrivate Perl_is_uni_print_lc Perl_is_uni_punct +syn keyword xsPrivate Perl_is_uni_punct_lc Perl_is_uni_space +syn keyword xsPrivate Perl_is_uni_space_lc Perl_is_uni_upper +syn keyword xsPrivate Perl_is_uni_upper_lc Perl_is_uni_xdigit +syn keyword xsPrivate Perl_is_uni_xdigit_lc Perl_is_utf8_alnum +syn keyword xsPrivate Perl_is_utf8_alnumc Perl_is_utf8_alpha +syn keyword xsPrivate Perl_is_utf8_ascii Perl_is_utf8_blank Perl_is_utf8_char +syn keyword xsPrivate Perl_is_utf8_cntrl Perl_is_utf8_digit +syn keyword xsPrivate Perl_is_utf8_graph Perl_is_utf8_idcont +syn keyword xsPrivate Perl_is_utf8_idfirst Perl_is_utf8_lower +syn keyword xsPrivate Perl_is_utf8_mark Perl_is_utf8_perl_space +syn keyword xsPrivate Perl_is_utf8_perl_word Perl_is_utf8_posix_digit +syn keyword xsPrivate Perl_is_utf8_print Perl_is_utf8_punct +syn keyword xsPrivate Perl_is_utf8_space Perl_is_utf8_upper +syn keyword xsPrivate Perl_is_utf8_xdigit Perl_is_utf8_xidcont +syn keyword xsPrivate Perl_is_utf8_xidfirst Perl_mg_find_mglob Perl_mg_length +syn keyword xsPrivate Perl_multideref_stringify Perl_new_warnings_bitfield +syn keyword xsPrivate Perl_op_clear Perl_ptr_table_clear Perl_qerror +syn keyword xsPrivate Perl_reg_named_buff Perl_reg_named_buff_iter +syn keyword xsPrivate Perl_reg_numbered_buff_fetch syn keyword xsPrivate Perl_reg_numbered_buff_length syn keyword xsPrivate Perl_reg_numbered_buff_store Perl_reg_qr_package syn keyword xsPrivate Perl_reg_temp_copy Perl_regprop Perl_report_uninit -syn keyword xsPrivate Perl_sv_compile_2op Perl_sv_setsv_cow -syn keyword xsPrivate Perl_try_amagic_bin Perl_try_amagic_un -syn keyword xsPrivate Perl_utf8_to_uvchr Perl_utf8_to_uvuni -syn keyword xsPrivate Perl_vivify_defelem Perl_yylex S_F0convert S_Slab_to_rw -syn keyword xsPrivate S__append_range_to_invlist S__new_invlist_C_array -syn keyword xsPrivate S_add_alternate S_add_data S_add_utf16_textfilter -syn keyword xsPrivate S_adjust_stack_on_leave S_amagic_cmp +syn keyword xsPrivate Perl_sv_magicext_mglob Perl_sv_setsv_cow +syn keyword xsPrivate Perl_to_uni_lower_lc Perl_to_uni_title_lc +syn keyword xsPrivate Perl_to_uni_upper_lc Perl_try_amagic_bin +syn keyword xsPrivate Perl_try_amagic_un Perl_utf8_to_uvchr +syn keyword xsPrivate Perl_utf8_to_uvuni Perl_utf8_to_uvuni_buf +syn keyword xsPrivate Perl_valid_utf8_to_uvuni Perl_validate_proto +syn keyword xsPrivate Perl_vivify_defelem Perl_yylex S_F0convert +syn keyword xsPrivate S__append_range_to_invlist S__make_exactf_invlist +syn keyword xsPrivate S_add_above_Latin1_folds S_add_data S_add_multi_match +syn keyword xsPrivate S_add_utf16_textfilter S_adjust_size_and_find_bucket +syn keyword xsPrivate S_advance_one_SB S_advance_one_WB S_amagic_cmp syn keyword xsPrivate S_amagic_cmp_locale S_amagic_i_ncmp S_amagic_ncmp syn keyword xsPrivate S_anonymise_cv_maybe S_ao S_apply_attrs syn keyword xsPrivate S_apply_attrs_my S_assert_uft8_cache_coherent -syn keyword xsPrivate S_bad_type_pv S_bad_type_sv S_bytes_to_uni +syn keyword xsPrivate S_assignment_type S_backup_one_SB S_backup_one_WB +syn keyword xsPrivate S_bad_type_gv S_bad_type_pv syn keyword xsPrivate S_check_locale_boundary_crossing S_check_type_and_open -syn keyword xsPrivate S_check_uni S_checkcomma S_checkposixcc S_ckwarn_common -syn keyword xsPrivate S_cl_and S_cl_anything S_cl_init S_cl_is_anything -syn keyword xsPrivate S_cl_or S_clear_placeholders S_closest_cop S_cop_free -syn keyword xsPrivate S_core_regclass_swash S_cr_textfilter S_curmad S_curse -syn keyword xsPrivate S_cv_dump S_deb_curcv S_deb_stack_n S_debprof +syn keyword xsPrivate S_check_uni S_checkcomma S_ckwarn_common +syn keyword xsPrivate S_clear_placeholders S_clear_special_blocks +syn keyword xsPrivate S_cntrl_to_mnemonic S_construct_ahocorasick_from_trie +syn keyword xsPrivate S_cop_free S_could_it_be_a_POSIX_class S_cr_textfilter +syn keyword xsPrivate S_curse S_cv_dump S_deb_curcv S_deb_stack_n S_debprof syn keyword xsPrivate S_debug_start_match S_del_sv syn keyword xsPrivate S_deprecate_commaless_var_list S_destroy_matcher syn keyword xsPrivate S_div128 S_do_chomp S_do_delete_local S_do_oddball @@ -89,103 +114,116 @@ syn keyword xsPrivate S_dump_trie_interim_table S_dumpuntil S_dup_attrlist syn keyword xsPrivate S_exec_failed S_expect_number S_filter_gets syn keyword xsPrivate S_finalize_op S_find_and_forget_pmops syn keyword xsPrivate S_find_array_subscript S_find_beginning S_find_byclass -syn keyword xsPrivate S_find_hash_subscript S_find_in_my_stash -syn keyword xsPrivate S_find_uninit_var S_first_symbol S_fold_constants -syn keyword xsPrivate S_forbid_setid S_force_ident S_force_list S_force_next -syn keyword xsPrivate S_force_strict_version S_force_version S_force_word -syn keyword xsPrivate S_forget_pmop S_gen_constant_list S_get_aux_mg -syn keyword xsPrivate S_get_num S_glob_2number S_glob_assign_glob -syn keyword xsPrivate S_glob_assign_ref S_grok_bslash_c S_grok_bslash_o -syn keyword xsPrivate S_group_end S_gv_ename S_gv_get_super_pkg -syn keyword xsPrivate S_gv_init_svtype S_gv_magicalize_isa -syn keyword xsPrivate S_gv_magicalize_overload S_hfreeentries S_hsplit -syn keyword xsPrivate S_hv_auxinit S_hv_delete_common S_hv_free_ent_ret -syn keyword xsPrivate S_hv_magic_check S_hv_notallowed S_incline S_incpush -syn keyword xsPrivate S_incpush_if_exists S_incpush_use_sep S_ingroup -syn keyword xsPrivate S_init_ids S_init_interp S_init_main_stash -syn keyword xsPrivate S_init_perllib S_init_postdump_symbols -syn keyword xsPrivate S_init_predump_symbols S_inplace_aassign -syn keyword xsPrivate S_intuit_method S_intuit_more S_invlist_extend -syn keyword xsPrivate S_invlist_iternext S_invlist_search -syn keyword xsPrivate S_invoke_exception_hook S_is_an_int -syn keyword xsPrivate S_is_handle_constructor S_is_list_assignment -syn keyword xsPrivate S_is_utf8_char_slow S_is_utf8_common S_isa_lookup -syn keyword xsPrivate S_join_exact S_listkids S_looks_like_bool -syn keyword xsPrivate S_magic_methcall1 S_make_matcher S_make_trie -syn keyword xsPrivate S_make_trie_failtable S_matcher_matches_sv +syn keyword xsPrivate S_find_default_stash S_find_hash_subscript +syn keyword xsPrivate S_find_in_my_stash S_find_uninit_var S_first_symbol +syn keyword xsPrivate S_fixup_errno_string S_fold_constants S_forbid_setid +syn keyword xsPrivate S_force_ident S_force_ident_maybe_lex S_force_list +syn keyword xsPrivate S_force_next S_force_strict_version S_force_version +syn keyword xsPrivate S_force_word S_forget_pmop S_form_short_octal_warning +syn keyword xsPrivate S_gen_constant_list S_get_ANYOF_cp_list_for_ssc +syn keyword xsPrivate S_get_aux_mg S_get_num S_glob_2number +syn keyword xsPrivate S_glob_assign_glob S_grok_bslash_N S_grok_bslash_c +syn keyword xsPrivate S_grok_bslash_o S_group_end S_gv_init_svtype +syn keyword xsPrivate S_gv_is_in_main S_gv_magicalize S_gv_magicalize_isa +syn keyword xsPrivate S_handle_regex_sets S_hfreeentries S_hsplit +syn keyword xsPrivate S_hv_auxinit S_hv_auxinit_internal S_hv_delete_common +syn keyword xsPrivate S_hv_free_ent_ret S_hv_magic_check S_hv_notallowed +syn keyword xsPrivate S_incline S_incpush S_incpush_if_exists +syn keyword xsPrivate S_incpush_use_sep S_ingroup S_init_ids S_init_interp +syn keyword xsPrivate S_init_main_stash S_init_perllib +syn keyword xsPrivate S_init_postdump_symbols S_init_predump_symbols +syn keyword xsPrivate S_inplace_aassign S_intuit_method S_intuit_more +syn keyword xsPrivate S_invlist_extend S_invlist_iternext +syn keyword xsPrivate S_invoke_exception_hook S_isFOO_lc S_isFOO_utf8_lc +syn keyword xsPrivate S_isGCB S_isSB S_isWB S_is_an_int +syn keyword xsPrivate S_is_handle_constructor S_is_ssc_worth_it S_isa_lookup +syn keyword xsPrivate S_join_exact S_leave_common S_listkids +syn keyword xsPrivate S_looks_like_bool S_magic_methcall1 S_make_matcher +syn keyword xsPrivate S_make_trie S_matcher_matches_sv S_maybe_multimagic_gv syn keyword xsPrivate S_mayberelocate S_measure_struct S_mem_log_common -syn keyword xsPrivate S_mess_alloc S_method_common S_minus_v S_missingterm -syn keyword xsPrivate S_modkids S_more_sv S_mro_clean_isarev +syn keyword xsPrivate S_mess_alloc S_minus_v S_missingterm S_modkids +syn keyword xsPrivate S_more_sv S_move_proto_attr S_mro_clean_isarev syn keyword xsPrivate S_mro_gather_and_rename S_mro_get_linear_isa_dfs -syn keyword xsPrivate S_mul128 S_mulexp10 S_my_exit_jump S_my_kid S_need_utf8 -syn keyword xsPrivate S_newDEFSVOP S_newGIVWHENOP S_new_constant S_new_he -syn keyword xsPrivate S_new_logop S_next_symbol S_nextchar +syn keyword xsPrivate S_mul128 S_mulexp10 S_my_bytes_to_utf8 S_my_exit_jump +syn keyword xsPrivate S_my_kid S_need_utf8 S_newGIVWHENOP S_new_constant +syn keyword xsPrivate S_new_he S_new_logop S_next_symbol S_nextchar syn keyword xsPrivate S_no_bareword_allowed S_no_fh_allowed S_no_op -syn keyword xsPrivate S_not_a_number S_nuke_stacks S_num_overflow -syn keyword xsPrivate S_open_script S_opt_scalarhv S_pack_rec -syn keyword xsPrivate S_pad_alloc_name S_pad_check_dup S_pad_findlex -syn keyword xsPrivate S_pad_reset S_parse_body S_path_is_absolute S_pidgone -syn keyword xsPrivate S_pm_description S_pmtrans S_printbuf -syn keyword xsPrivate S_process_special_blocks S_ptr_table_find S_put_byte -syn keyword xsPrivate S_qsortsvu S_re_croak2 S_readpipe_override -syn keyword xsPrivate S_ref_array_or_hash S_refcounted_he_value S_refkids -syn keyword xsPrivate S_refto S_reg S_reg_check_named_buff_matched -syn keyword xsPrivate S_reg_namedseq S_reg_node S_reg_recode S_reg_scan_name -syn keyword xsPrivate S_reg_skipcomment S_reganode S_regatom S_regbranch -syn keyword xsPrivate S_regclass S_regcppop S_regcppush S_regdump_extflags -syn keyword xsPrivate S_reghop3 S_reghop4 S_reghopmaybe3 S_reginclass -syn keyword xsPrivate S_reginsert S_regmatch S_regpiece S_regpposixcc -syn keyword xsPrivate S_regrepeat S_regtail S_regtail_study S_regtry S_reguni -syn keyword xsPrivate S_regwhite S_require_tie_mod S_restore_magic S_run_body -syn keyword xsPrivate S_run_user_filter S_rxres_free S_rxres_restore -syn keyword xsPrivate S_save_hek_flags S_save_lines S_save_magic -syn keyword xsPrivate S_save_pushptri32ptr S_save_scalar_at S_scalar_mod_type -syn keyword xsPrivate S_scalarboolean S_scalarkids S_scalarseq S_scan_commit -syn keyword xsPrivate S_scan_const S_scan_formline S_scan_heredoc -syn keyword xsPrivate S_scan_ident S_scan_inputsymbol S_scan_pat S_scan_str -syn keyword xsPrivate S_scan_subst S_scan_trans S_scan_word S_search_const -syn keyword xsPrivate S_sequence_num S_set_regclass_bit_fold -syn keyword xsPrivate S_share_hek_flags S_simplify_sort S_skipspace -syn keyword xsPrivate S_skipspace0 S_skipspace1 S_skipspace2 S_sortcv -syn keyword xsPrivate S_sortcv_stacked S_sortcv_xsub -syn keyword xsPrivate S_space_join_names_mortal S_start_force S_stdize_locale -syn keyword xsPrivate S_strip_return S_study_chunk S_sublex_done -syn keyword xsPrivate S_sublex_push S_sublex_start S_sv_2iuv_common -syn keyword xsPrivate S_sv_2iuv_non_preserve S_sv_add_arena S_sv_dup_common +syn keyword xsPrivate S_not_a_number S_not_incrementable S_nuke_stacks +syn keyword xsPrivate S_num_overflow S_open_script S_openn_cleanup +syn keyword xsPrivate S_openn_setup S_pack_rec S_pad_alloc_name +syn keyword xsPrivate S_pad_check_dup S_pad_findlex S_pad_reset S_parse_body +syn keyword xsPrivate S_parse_gv_stash_name S_parse_ident +syn keyword xsPrivate S_parse_lparen_question_flags S_pending_ident S_pidgone +syn keyword xsPrivate S_pm_description S_pmtrans +syn keyword xsPrivate S_populate_ANYOF_from_invlist S_printbuf +syn keyword xsPrivate S_process_special_blocks S_ptr_table_find +syn keyword xsPrivate S_put_charclass_bitmap_innards S_put_code_point +syn keyword xsPrivate S_put_range S_qsortsvu S_re_croak2 S_ref_array_or_hash +syn keyword xsPrivate S_refcounted_he_value S_refkids S_refto S_reg +syn keyword xsPrivate S_reg2Lanode S_reg_check_named_buff_matched S_reg_node +syn keyword xsPrivate S_reg_recode S_reg_scan_name S_reganode S_regatom +syn keyword xsPrivate S_regbranch S_regclass S_regcppop S_regcppush +syn keyword xsPrivate S_regdump_extflags S_regdump_intflags +syn keyword xsPrivate S_regex_set_precedence S_reghop3 S_reghop4 +syn keyword xsPrivate S_reghopmaybe3 S_reginclass S_reginsert S_regmatch +syn keyword xsPrivate S_regnode_guts S_regpatws S_regpiece S_regrepeat +syn keyword xsPrivate S_regtail S_regtail_study S_regtry S_require_tie_mod +syn keyword xsPrivate S_restore_magic S_run_body S_run_user_filter +syn keyword xsPrivate S_rxres_free S_rxres_restore S_save_hek_flags +syn keyword xsPrivate S_save_lines S_save_magic_flags S_save_pushptri32ptr +syn keyword xsPrivate S_save_scalar_at S_scalar_mod_type S_scalarboolean +syn keyword xsPrivate S_scalarkids S_scalarseq S_scan_commit S_scan_const +syn keyword xsPrivate S_scan_formline S_scan_heredoc S_scan_ident +syn keyword xsPrivate S_scan_inputsymbol S_scan_pat S_scan_str S_scan_subst +syn keyword xsPrivate S_scan_trans S_scan_word S_search_const S_sequence_num +syn keyword xsPrivate S_set_ANYOF_arg S_share_hek_flags S_simplify_sort +syn keyword xsPrivate S_skipspace_flags S_sortcv S_sortcv_stacked +syn keyword xsPrivate S_sortcv_xsub S_space_join_names_mortal S_ssc_and +syn keyword xsPrivate S_ssc_anything S_ssc_finalize S_ssc_init +syn keyword xsPrivate S_ssc_is_anything S_ssc_is_cp_posixl_init S_ssc_or +syn keyword xsPrivate S_stdize_locale S_strip_return S_study_chunk +syn keyword xsPrivate S_sublex_done S_sublex_push S_sublex_start +syn keyword xsPrivate S_sv_2iuv_common S_sv_2iuv_non_preserve S_sv_add_arena +syn keyword xsPrivate S_sv_buf_to_rw S_sv_display S_sv_dup_common syn keyword xsPrivate S_sv_dup_inc_multiple S_sv_exp_grow S_sv_i_ncmp syn keyword xsPrivate S_sv_ncmp S_sv_pos_b2u_midway S_sv_pos_u2b_cached syn keyword xsPrivate S_sv_pos_u2b_forwards S_sv_pos_u2b_midway -syn keyword xsPrivate S_sv_release_COW S_swallow_bom S_swatch_get -syn keyword xsPrivate S_to_byte_substr S_to_lower_latin1 S_to_utf8_substr -syn keyword xsPrivate S_tokenize_use S_tokeq S_tokereport -syn keyword xsPrivate S_too_few_arguments_pv S_too_few_arguments_sv -syn keyword xsPrivate S_too_many_arguments_pv S_too_many_arguments_sv +syn keyword xsPrivate S_sv_release_COW S_swallow_bom S_swash_scan_list_line +syn keyword xsPrivate S_swatch_get S_to_byte_substr S_to_lower_latin1 +syn keyword xsPrivate S_to_utf8_substr S_tokenize_use S_tokeq S_tokereport +syn keyword xsPrivate S_too_few_arguments_pv S_too_many_arguments_pv syn keyword xsPrivate S_uiv_2buf S_unpack_rec S_unreferenced_to_tmp_stack syn keyword xsPrivate S_unshare_hek_or_pvn S_unwind_handler_stack syn keyword xsPrivate S_update_debugger_info S_usage S_utf16_textfilter syn keyword xsPrivate S_utf8_mg_len_cache_update S_utf8_mg_pos_cache_update syn keyword xsPrivate S_validate_suid S_visit S_with_queued_errors -syn keyword xsPrivate S_write_no_mem S_xmldump_attr S_yywarn Slab_to_rw -syn keyword xsPrivate _add_range_to_invlist _append_range_to_invlist -syn keyword xsPrivate _core_swash_init _invlist_array_init _invlist_contents +syn keyword xsPrivate S_xs_version_bootcheck S_yywarn _add_range_to_invlist +syn keyword xsPrivate _append_range_to_invlist _core_swash_init _get_encoding +syn keyword xsPrivate _get_swash_invlist _invlist_array_init +syn keyword xsPrivate _invlist_contains_cp _invlist_contents _invlist_dump syn keyword xsPrivate _invlist_intersection syn keyword xsPrivate _invlist_intersection_maybe_complement_2nd -syn keyword xsPrivate _invlist_invert _invlist_invert_prop -syn keyword xsPrivate _invlist_populate_swatch _invlist_subtract -syn keyword xsPrivate _invlist_union _invlist_union_maybe_complement_2nd -syn keyword xsPrivate _is_utf8__perl_idstart _new_invlist -syn keyword xsPrivate _new_invlist_C_array _swash_inversion_hash -syn keyword xsPrivate _swash_to_invlist _to_fold_latin1 add_alternate -syn keyword xsPrivate add_cp_to_invlist add_data add_utf16_textfilter -syn keyword xsPrivate adjust_stack_on_leave amagic_cmp amagic_cmp_locale +syn keyword xsPrivate _invlist_invert _invlist_len _invlist_populate_swatch +syn keyword xsPrivate _invlist_search _invlist_subtract _invlist_union +syn keyword xsPrivate _invlist_union_maybe_complement_2nd +syn keyword xsPrivate _load_PL_utf8_foldclosures _make_exactf_invlist +syn keyword xsPrivate _new_invlist _setup_canned_invlist +syn keyword xsPrivate _swash_inversion_hash _swash_to_invlist _to_fold_latin1 +syn keyword xsPrivate _warn_problematic_locale add_above_Latin1_folds +syn keyword xsPrivate add_cp_to_invlist add_data add_multi_match +syn keyword xsPrivate add_utf16_textfilter adjust_size_and_find_bucket +syn keyword xsPrivate advance_one_SB advance_one_WB +syn keyword xsPrivate alloc_maybe_populate_EXACT amagic_cmp amagic_cmp_locale syn keyword xsPrivate amagic_i_ncmp amagic_ncmp anonymise_cv_maybe ao syn keyword xsPrivate apply_attrs apply_attrs_my assert_uft8_cache_coherent -syn keyword xsPrivate av_reify bad_type_pv bad_type_sv bytes_to_uni -syn keyword xsPrivate check_locale_boundary_crossing check_type_and_open -syn keyword xsPrivate check_uni checkcomma checkposixcc ckwarn_common cl_and -syn keyword xsPrivate cl_anything cl_init cl_is_anything cl_or -syn keyword xsPrivate clear_placeholders closest_cop cop_free -syn keyword xsPrivate core_regclass_swash cr_textfilter curmad curse cv_dump +syn keyword xsPrivate assignment_type av_reify backup_one_SB backup_one_WB +syn keyword xsPrivate bad_type_gv bad_type_pv check_locale_boundary_crossing +syn keyword xsPrivate check_type_and_open check_uni checkcomma ckwarn_common +syn keyword xsPrivate clear_placeholders clear_special_blocks +syn keyword xsPrivate cntrl_to_mnemonic compute_EXACTish +syn keyword xsPrivate construct_ahocorasick_from_trie cop_free +syn keyword xsPrivate could_it_be_a_POSIX_class cr_textfilter +syn keyword xsPrivate current_re_engine curse cv_ckproto_len_flags cv_dump syn keyword xsPrivate deb_curcv deb_stack_n debprof debug_start_match del_sv syn keyword xsPrivate deprecate_commaless_var_list destroy_matcher div128 syn keyword xsPrivate do_aexec do_chomp do_delete_local do_exec do_oddball @@ -199,274 +237,342 @@ syn keyword xsPrivate dump_trie_interim_list dump_trie_interim_table syn keyword xsPrivate dumpuntil dup_attrlist exec_failed expect_number syn keyword xsPrivate filter_gets finalize_op find_and_forget_pmops syn keyword xsPrivate find_array_subscript find_beginning find_byclass -syn keyword xsPrivate find_hash_subscript find_in_my_stash +syn keyword xsPrivate find_default_stash find_hash_subscript find_in_my_stash syn keyword xsPrivate find_rundefsvoffset find_uninit_var first_symbol -syn keyword xsPrivate fold_constants forbid_setid force_ident force_list -syn keyword xsPrivate force_next force_strict_version force_version -syn keyword xsPrivate force_word gen_constant_list get_aux_mg -syn keyword xsPrivate get_invlist_iter_addr get_invlist_len_addr -syn keyword xsPrivate get_invlist_version_id_addr get_invlist_zero_addr -syn keyword xsPrivate get_num glob_2number glob_assign_glob glob_assign_ref -syn keyword xsPrivate grok_bslash_c grok_bslash_o group_end gv_ename -syn keyword xsPrivate gv_get_super_pkg gv_init_svtype gv_magicalize_isa -syn keyword xsPrivate gv_magicalize_overload hfreeentries hsplit hv_auxinit -syn keyword xsPrivate hv_delete_common hv_free_ent_ret hv_magic_check -syn keyword xsPrivate hv_notallowed incline incpush incpush_if_exists -syn keyword xsPrivate incpush_use_sep ingroup init_ids init_interp -syn keyword xsPrivate init_main_stash init_perllib init_postdump_symbols -syn keyword xsPrivate init_predump_symbols inplace_aassign intuit_method -syn keyword xsPrivate intuit_more invlist_array invlist_clone invlist_extend -syn keyword xsPrivate invlist_iterinit invlist_iternext invlist_len -syn keyword xsPrivate invlist_max invlist_search invlist_set_len invlist_trim -syn keyword xsPrivate invoke_exception_hook is_an_int is_handle_constructor -syn keyword xsPrivate is_list_assignment is_utf8_X_L is_utf8_X_LV -syn keyword xsPrivate is_utf8_X_LVT is_utf8_X_LV_LVT_V is_utf8_X_T -syn keyword xsPrivate is_utf8_X_V is_utf8_X_begin is_utf8_X_extend -syn keyword xsPrivate is_utf8_X_non_hangul is_utf8_X_prepend is_utf8_char -syn keyword xsPrivate is_utf8_char_slow is_utf8_common isa_lookup join_exact -syn keyword xsPrivate listkids looks_like_bool magic_methcall1 make_matcher -syn keyword xsPrivate make_trie make_trie_failtable matcher_matches_sv -syn keyword xsPrivate mayberelocate measure_struct mem_log_common mess_alloc -syn keyword xsPrivate method_common minus_v missingterm modkids more_sv -syn keyword xsPrivate mro_clean_isarev mro_gather_and_rename -syn keyword xsPrivate mro_get_linear_isa_dfs mul128 mulexp10 my_exit_jump -syn keyword xsPrivate my_kid need_utf8 newDEFSVOP newGIVWHENOP new_he -syn keyword xsPrivate new_logop next_symbol nextchar no_bareword_allowed -syn keyword xsPrivate no_fh_allowed no_op not_a_number nuke_stacks -syn keyword xsPrivate num_overflow op_clear open_script opt_scalarhv pack_rec -syn keyword xsPrivate pad_alloc_name pad_check_dup pad_findlex pad_reset -syn keyword xsPrivate parse_body path_is_absolute pidgone pm_description -syn keyword xsPrivate pmtrans printbuf process_special_blocks ptr_table_clear -syn keyword xsPrivate ptr_table_find put_byte qerror qsortsvu re_croak2 -syn keyword xsPrivate readpipe_override ref_array_or_hash refcounted_he_value -syn keyword xsPrivate refkids refto reg reg_check_named_buff_matched -syn keyword xsPrivate reg_named_buff reg_named_buff_iter reg_namedseq -syn keyword xsPrivate reg_node reg_numbered_buff_fetch +syn keyword xsPrivate fixup_errno_string fold_constants forbid_setid +syn keyword xsPrivate force_ident force_ident_maybe_lex force_list force_next +syn keyword xsPrivate force_strict_version force_version force_word +syn keyword xsPrivate forget_pmop form_short_octal_warning free_c_backtrace +syn keyword xsPrivate gen_constant_list get_ANYOF_cp_list_for_ssc get_aux_mg +syn keyword xsPrivate get_invlist_iter_addr get_invlist_offset_addr +syn keyword xsPrivate get_invlist_previous_index_addr get_num glob_2number +syn keyword xsPrivate glob_assign_glob grok_atoUV grok_bslash_N grok_bslash_c +syn keyword xsPrivate grok_bslash_o grok_bslash_x group_end gv_init_svtype +syn keyword xsPrivate gv_is_in_main gv_magicalize gv_magicalize_isa +syn keyword xsPrivate handle_regex_sets hfreeentries hsplit hv_auxinit +syn keyword xsPrivate hv_auxinit_internal hv_delete_common hv_free_ent_ret +syn keyword xsPrivate hv_magic_check hv_notallowed incline incpush +syn keyword xsPrivate incpush_if_exists incpush_use_sep ingroup init_ids +syn keyword xsPrivate init_interp init_main_stash init_perllib +syn keyword xsPrivate init_postdump_symbols init_predump_symbols +syn keyword xsPrivate inplace_aassign intuit_method intuit_more invlist_array +syn keyword xsPrivate invlist_clone invlist_extend invlist_highest +syn keyword xsPrivate invlist_is_iterating invlist_iterfinish +syn keyword xsPrivate invlist_iterinit invlist_iternext invlist_max +syn keyword xsPrivate invlist_previous_index invlist_set_len +syn keyword xsPrivate invlist_set_previous_index invlist_trim +syn keyword xsPrivate invoke_exception_hook isALNUM_lazy isFOO_lc +syn keyword xsPrivate isFOO_utf8_lc isGCB isIDFIRST_lazy isSB isWB is_an_int +syn keyword xsPrivate is_handle_constructor is_ssc_worth_it is_uni_alnum +syn keyword xsPrivate is_uni_alnum_lc is_uni_alnumc is_uni_alnumc_lc +syn keyword xsPrivate is_uni_alpha is_uni_alpha_lc is_uni_ascii +syn keyword xsPrivate is_uni_ascii_lc is_uni_blank is_uni_blank_lc +syn keyword xsPrivate is_uni_cntrl is_uni_cntrl_lc is_uni_digit +syn keyword xsPrivate is_uni_digit_lc is_uni_graph is_uni_graph_lc +syn keyword xsPrivate is_uni_idfirst is_uni_idfirst_lc is_uni_lower +syn keyword xsPrivate is_uni_lower_lc is_uni_print is_uni_print_lc +syn keyword xsPrivate is_uni_punct is_uni_punct_lc is_uni_space +syn keyword xsPrivate is_uni_space_lc is_uni_upper is_uni_upper_lc +syn keyword xsPrivate is_uni_xdigit is_uni_xdigit_lc is_utf8_alnum +syn keyword xsPrivate is_utf8_alnumc is_utf8_alpha is_utf8_ascii +syn keyword xsPrivate is_utf8_blank is_utf8_char is_utf8_cntrl is_utf8_digit +syn keyword xsPrivate is_utf8_graph is_utf8_idcont is_utf8_idfirst +syn keyword xsPrivate is_utf8_lower is_utf8_mark is_utf8_perl_space +syn keyword xsPrivate is_utf8_perl_word is_utf8_posix_digit is_utf8_print +syn keyword xsPrivate is_utf8_punct is_utf8_space is_utf8_upper +syn keyword xsPrivate is_utf8_xdigit is_utf8_xidcont is_utf8_xidfirst +syn keyword xsPrivate isa_lookup join_exact leave_common listkids +syn keyword xsPrivate looks_like_bool magic_methcall1 make_matcher make_trie +syn keyword xsPrivate matcher_matches_sv maybe_multimagic_gv mayberelocate +syn keyword xsPrivate measure_struct mem_log_common mess_alloc mg_find_mglob +syn keyword xsPrivate mg_length minus_v missingterm modkids more_sv +syn keyword xsPrivate move_proto_attr mro_clean_isarev mro_gather_and_rename +syn keyword xsPrivate mro_get_linear_isa_dfs mul128 mulexp10 +syn keyword xsPrivate multideref_stringify my_bytes_to_utf8 my_exit_jump +syn keyword xsPrivate my_kid need_utf8 newGIVWHENOP new_he new_logop +syn keyword xsPrivate next_symbol nextchar no_bareword_allowed no_fh_allowed +syn keyword xsPrivate no_op not_a_number not_incrementable nuke_stacks +syn keyword xsPrivate num_overflow op_clear open_script openn_cleanup +syn keyword xsPrivate openn_setup pack_rec pad_alloc_name pad_check_dup +syn keyword xsPrivate pad_findlex pad_reset parse_body parse_gv_stash_name +syn keyword xsPrivate parse_ident parse_lparen_question_flags pending_ident +syn keyword xsPrivate pidgone pm_description pmtrans +syn keyword xsPrivate populate_ANYOF_from_invlist printbuf +syn keyword xsPrivate process_special_blocks ptr_table_clear ptr_table_find +syn keyword xsPrivate put_charclass_bitmap_innards put_code_point put_range +syn keyword xsPrivate qerror qsortsvu re_croak2 ref_array_or_hash +syn keyword xsPrivate refcounted_he_value refkids refto reg reg2Lanode +syn keyword xsPrivate reg_check_named_buff_matched reg_named_buff +syn keyword xsPrivate reg_named_buff_iter reg_node reg_numbered_buff_fetch syn keyword xsPrivate reg_numbered_buff_length reg_numbered_buff_store syn keyword xsPrivate reg_qr_package reg_recode reg_scan_name reg_skipcomment syn keyword xsPrivate reg_temp_copy reganode regatom regbranch regclass -syn keyword xsPrivate regcppop regcppush regcurly regdump_extflags reghop3 -syn keyword xsPrivate reghop4 reghopmaybe3 reginclass reginsert regmatch -syn keyword xsPrivate regpiece regpposixcc regprop regrepeat regtail -syn keyword xsPrivate regtail_study regtry reguni regwhite report_uninit -syn keyword xsPrivate require_tie_mod restore_magic run_body run_user_filter -syn keyword xsPrivate rxres_free rxres_restore save_hek_flags save_lines -syn keyword xsPrivate save_magic save_pushptri32ptr save_scalar_at +syn keyword xsPrivate regcppop regcppush regcurly regdump_extflags +syn keyword xsPrivate regdump_intflags regex_set_precedence reghop3 reghop4 +syn keyword xsPrivate reghopmaybe3 reginclass reginsert regmatch regnode_guts +syn keyword xsPrivate regpatws regpiece regpposixcc regprop regrepeat regtail +syn keyword xsPrivate regtail_study regtry report_uninit require_tie_mod +syn keyword xsPrivate restore_magic run_body run_user_filter rxres_free +syn keyword xsPrivate rxres_restore save_hek_flags save_lines +syn keyword xsPrivate save_magic_flags save_pushptri32ptr save_scalar_at syn keyword xsPrivate scalar_mod_type scalarboolean scalarkids scalarseq syn keyword xsPrivate scan_commit scan_const scan_formline scan_heredoc syn keyword xsPrivate scan_ident scan_inputsymbol scan_pat scan_str syn keyword xsPrivate scan_subst scan_trans scan_word search_const -syn keyword xsPrivate sequence_num set_regclass_bit set_regclass_bit_fold -syn keyword xsPrivate share_hek_flags simplify_sort skipspace skipspace0 -syn keyword xsPrivate skipspace1 skipspace2 sortcv sortcv_stacked sortcv_xsub -syn keyword xsPrivate space_join_names_mortal start_force stdize_locale +syn keyword xsPrivate sequence_num set_ANYOF_arg share_hek_flags +syn keyword xsPrivate simplify_sort skipspace_flags sortcv sortcv_stacked +syn keyword xsPrivate sortcv_xsub space_join_names_mortal ssc_add_range +syn keyword xsPrivate ssc_and ssc_anything ssc_clear_locale ssc_cp_and +syn keyword xsPrivate ssc_finalize ssc_init ssc_intersection ssc_is_anything +syn keyword xsPrivate ssc_is_cp_posixl_init ssc_or ssc_union stdize_locale syn keyword xsPrivate strip_return study_chunk sublex_done sublex_push syn keyword xsPrivate sublex_start sv_2iuv_common sv_2iuv_non_preserve -syn keyword xsPrivate sv_add_arena sv_compile_2op sv_dup_common -syn keyword xsPrivate sv_dup_inc_multiple sv_exp_grow sv_i_ncmp sv_ncmp -syn keyword xsPrivate sv_pos_b2u_midway sv_pos_u2b_cached sv_pos_u2b_forwards -syn keyword xsPrivate sv_pos_u2b_midway sv_release_COW sv_setsv_cow -syn keyword xsPrivate swallow_bom swatch_get to_byte_substr to_lower_latin1 +syn keyword xsPrivate sv_add_arena sv_buf_to_rw sv_copypv sv_display +syn keyword xsPrivate sv_dup_common sv_dup_inc_multiple sv_exp_grow sv_i_ncmp +syn keyword xsPrivate sv_magicext_mglob sv_ncmp sv_only_taint_gmagic +syn keyword xsPrivate sv_or_pv_pos_u2b sv_pos_b2u_midway sv_pos_u2b_cached +syn keyword xsPrivate sv_pos_u2b_forwards sv_pos_u2b_midway sv_release_COW +syn keyword xsPrivate sv_setsv_cow swallow_bom swash_scan_list_line +syn keyword xsPrivate swatch_get to_byte_substr to_lower_latin1 +syn keyword xsPrivate to_uni_lower_lc to_uni_title_lc to_uni_upper_lc syn keyword xsPrivate to_utf8_substr tokenize_use tokeq tokereport -syn keyword xsPrivate too_few_arguments_pv too_few_arguments_sv -syn keyword xsPrivate too_many_arguments_pv too_many_arguments_sv uiv_2buf +syn keyword xsPrivate too_few_arguments_pv too_many_arguments_pv uiv_2buf syn keyword xsPrivate unpack_rec unreferenced_to_tmp_stack unshare_hek_or_pvn syn keyword xsPrivate unwind_handler_stack update_debugger_info usage syn keyword xsPrivate utf16_textfilter utf8_mg_len_cache_update syn keyword xsPrivate utf8_mg_pos_cache_update utf8_to_uvchr utf8_to_uvuni -syn keyword xsPrivate visit vivify_defelem with_queued_errors write_no_mem -syn keyword xsPrivate xmldump_attr yylex yywarn +syn keyword xsPrivate utf8_to_uvuni_buf valid_utf8_to_uvuni validate_proto +syn keyword xsPrivate visit vivify_defelem with_queued_errors yylex yywarn endif syn keyword xsType AMT AMTS ANY AV BHK BINOP BLOCK CHECKPOINT CLONE_PARAMS syn keyword xsType COP COPHH CV DB_Hash_t DB_Prefix_t DEBUG_t Direntry_t -syn keyword xsType Fpos_t Free_t GP GV Gid_t Groups_t HE HEK HV I16 I32 I64 -syn keyword xsType I8 IO IV Int64 JMPENV LISTOP LOGOP LOOP MADPROP MAGIC MGS -syn keyword xsType MGVTBL Malloc_t Mmap_t Mode_t NEXTTOKE NV Netdb_hlen_t -syn keyword xsType Netdb_host_t Netdb_name_t Netdb_net_t OP OPCODE OP_4tree -syn keyword xsType Off_t Optype PAD PADLIST PADOFFSET PADOP PERL_CONTEXT -syn keyword xsType PERL_SI PMOP PTR_TBL_ENT_t PTR_TBL_t PVOP PerlIO -syn keyword xsType PerlIO_funcs PerlIO_list_s PerlIO_list_t PerlIOl -syn keyword xsType PerlInterpreter Pid_t Quad_t REGEXP Rand_seed_t SSize_t -syn keyword xsType STRLEN STRUCT_SV SUBLEXINFO SV SVOP Select_fd_set_t -syn keyword xsType Shmat_t Signal_t Sigsave_t Size_t Sock_size_t Stat_t TM64 -syn keyword xsType TOKEN Time64_T Time_t U16 U32 U64 U8 UNOP UV Uid_t Uquad_t -syn keyword xsType XOP XPV XPVAV XPVBM XPVCV XPVFM XPVGV XPVHV XPVIO XPVIV -syn keyword xsType XPVLV XPVMG XPVNV XPVUV Year _PerlIO _PerlIO_funcs -syn keyword xsType _pMY_CXT _pTHX _reg_ac_data _reg_trie_data _reg_trie_state -syn keyword xsType _reg_trie_trans _reg_trie_trans_list_elem _sublex_info -syn keyword xsType _xhvnameu _xivu _xmgu _xnvu am_table am_table_short -syn keyword xsType block_eval block_format block_givwhen block_hooks -syn keyword xsType block_loop block_sub bool clone_params custom_op -syn keyword xsType cv_flags_t expectation gccbug_semun line_t madprop magic -syn keyword xsType mem_log_type mgvtbl mro_alg mro_meta my_cxt_t opcode p5rx -syn keyword xsType pMY_CXT pMY_CXT_ pTHX pTHX_ padtidy_type perl_cond -syn keyword xsType perl_debug_pad perl_key perl_memory_debug_header -syn keyword xsType perl_mstats perl_mstats_t perl_mutex perl_os_thread -syn keyword xsType perl_phase perl_vars perl_wait_queue pthread_addr_t -syn keyword xsType ptr_tbl ptr_tbl_ent re_save_state refcounted_he -syn keyword xsType reg_ac_data reg_data reg_substr_data reg_substr_datum -syn keyword xsType reg_trie_data reg_trie_state reg_trie_trans -syn keyword xsType reg_trie_trans_le regex_charset regnode regnode_1 -syn keyword xsType regnode_2 regnode_2L regnode_charclass -syn keyword xsType regnode_charclass_class regnode_string semun shared_he -syn keyword xsType svtype thread_intern ufuncs xpv xpvav xpvcv xpvfm xpvgv -syn keyword xsType xpvhv xpvhv_aux xpvio xpviv xpvlv xpvmg xpvnv xpvuv +syn keyword xsType Fpos_t Free_t GCB_enum GP GV Gid_t Groups_t HE HEK HV I16 +syn keyword xsType I32 I64 I8 IO IV Int64 JMPENV LISTOP LOGOP LOOP MAGIC +syn keyword xsType METHOP MGS MGVTBL Malloc_t Mmap_t Mode_t NV Netdb_hlen_t +syn keyword xsType Netdb_host_t Netdb_name_t Netdb_net_t OP OPCODE OPSLAB +syn keyword xsType OPSLOT Off_t Optype PAD PADLIST PADNAME PADNAMELIST +syn keyword xsType PADOFFSET PADOP PERL_CONTEXT PERL_DRAND48_T PERL_SI PMOP +syn keyword xsType PTR_TBL_ENT_t PTR_TBL_t PVOP PerlHandShakeInterpreter +syn keyword xsType PerlIO PerlIO_funcs PerlIO_list_s PerlIO_list_t PerlIOl +syn keyword xsType PerlInterpreter Pid_t Quad_t REGEXP RExC_state_t +syn keyword xsType Rand_seed_t SB_enum SSize_t STRLEN STRUCT_SV SUBLEXINFO SV +syn keyword xsType SVOP Select_fd_set_t Shmat_t Signal_t Sigsave_t Size_t +syn keyword xsType Sock_size_t Stat_t TM64 Time64_T Time_t U16 U32 U64 U8 +syn keyword xsType UNOP UNOP_AUX UV Uid_t Uquad_t WB_enum XINVLIST XOP XPV +syn keyword xsType XPVAV XPVBM XPVCV XPVFM XPVGV XPVHV XPVIO XPVIV XPVLV +syn keyword xsType XPVMG XPVNV XPVUV Year _PerlIO _PerlIO_funcs +syn keyword xsType _char_class_number _pMY_CXT _pTHX _reg_ac_data +syn keyword xsType _reg_trie_data _reg_trie_state _reg_trie_trans +syn keyword xsType _reg_trie_trans_list_elem _sublex_info _xhvnameu _xivu +syn keyword xsType _xmgu _xnvu am_table am_table_short block_eval +syn keyword xsType block_format block_givwhen block_hooks block_loop +syn keyword xsType block_sub bound_type clone_params custom_op cv_flags_t +syn keyword xsType expectation gccbug_semun line_t magic mem_log_type methop +syn keyword xsType mgvtbl mro_alg mro_meta my_cxt_t opcode opslab opslot p5rx +syn keyword xsType pMY_CXT pMY_CXT_ pTHX pTHX_ padlist padname +syn keyword xsType padname_with_str padnamelist padtidy_type perl_cond +syn keyword xsType perl_debug_pad perl_drand48_t perl_key +syn keyword xsType perl_memory_debug_header perl_mstats perl_mstats_t +syn keyword xsType perl_mutex perl_os_thread perl_phase perl_vars +syn keyword xsType pthread_addr_t ptr_tbl ptr_tbl_ent refcounted_he +syn keyword xsType reg_ac_data reg_code_block reg_data reg_substr_data +syn keyword xsType reg_substr_datum reg_trie_data reg_trie_state +syn keyword xsType reg_trie_trans reg_trie_trans_le regex_charset regnode +syn keyword xsType regnode_1 regnode_2 regnode_2L regnode_charclass +syn keyword xsType regnode_charclass_class regnode_charclass_posixl +syn keyword xsType regnode_ssc regnode_string semun shared_he svtype ufuncs +syn keyword xsType unop_aux xop_flags_enum xpv xpvav xpvcv xpvfm xpvgv xpvhv +syn keyword xsType xpvhv_aux xpvinvlist xpvio xpviv xpvlv xpvmg xpvnv xpvuv syn keyword xsType yytokentype syn keyword xsString IVdf NVef NVff NVgf SVf SVf256 SVf32 SVf_ UVof UVuf UVxf syn keyword xsConstant CXt_BLOCK CXt_EVAL CXt_FORMAT CXt_GIVEN CXt_LOOP_FOR syn keyword xsConstant CXt_LOOP_LAZYIV CXt_LOOP_LAZYSV CXt_LOOP_PLAIN -syn keyword xsConstant CXt_NULL CXt_SUB CXt_SUBST CXt_WHEN FALSE G_ARRAY -syn keyword xsConstant G_DISCARD G_EVAL G_FAKINGEVAL G_KEEPERR G_METHOD -syn keyword xsConstant G_NOARGS G_NODEBUG G_SCALAR G_UNDEF_FILL G_VOID G_WANT -syn keyword xsConstant G_WARN_ALL_MASK G_WARN_ALL_OFF G_WARN_ALL_ON -syn keyword xsConstant G_WARN_OFF G_WARN_ON G_WARN_ONCE G_WRITING_TO_STDERR -syn keyword xsConstant OA_AVREF OA_BASEOP OA_BASEOP_OR_UNOP OA_BINOP -syn keyword xsConstant OA_CLASS_MASK OA_COP OA_CVREF OA_DANGEROUS OA_DEFGV -syn keyword xsConstant OA_FILEREF OA_FILESTATOP OA_FOLDCONST OA_HVREF OA_LIST -syn keyword xsConstant OA_LISTOP OA_LOGOP OA_LOOP OA_LOOPEXOP OA_MARK +syn keyword xsConstant CXt_NULL CXt_SUB CXt_SUBST CXt_WHEN GCB_BOUND GCB_CR +syn keyword xsConstant GCB_Control GCB_EDGE GCB_Extend GCB_L GCB_LF GCB_LV +syn keyword xsConstant GCB_LVT GCB_Other GCB_Prepend GCB_Regional_Indicator +syn keyword xsConstant GCB_SpacingMark GCB_T GCB_V G_ARRAY G_DISCARD G_EVAL +syn keyword xsConstant G_FAKINGEVAL G_KEEPERR G_METHOD G_METHOD_NAMED +syn keyword xsConstant G_NOARGS G_NODEBUG G_RE_REPARSING G_SCALAR +syn keyword xsConstant G_UNDEF_FILL G_VOID G_WANT G_WARN_ALL_MASK +syn keyword xsConstant G_WARN_ALL_OFF G_WARN_ALL_ON G_WARN_OFF G_WARN_ON +syn keyword xsConstant G_WARN_ONCE G_WRITING_TO_STDERR OA_AVREF OA_BASEOP +syn keyword xsConstant OA_BASEOP_OR_UNOP OA_BINOP OA_CLASS_MASK OA_COP +syn keyword xsConstant OA_CVREF OA_DANGEROUS OA_DEFGV OA_FILEREF +syn keyword xsConstant OA_FILESTATOP OA_FOLDCONST OA_HVREF OA_LIST OA_LISTOP +syn keyword xsConstant OA_LOGOP OA_LOOP OA_LOOPEXOP OA_MARK OA_METHOP syn keyword xsConstant OA_OPTIONAL OA_OTHERINT OA_PADOP OA_PMOP syn keyword xsConstant OA_PVOP_OR_SVOP OA_RETSCALAR OA_SCALAR OA_SCALARREF -syn keyword xsConstant OA_SVOP OA_TARGET OA_TARGLEX OA_UNOP OP_AASSIGN OP_ABS -syn keyword xsConstant OP_ACCEPT OP_ADD OP_AEACH OP_AELEM OP_AELEMFAST -syn keyword xsConstant OP_AELEMFAST_LEX OP_AKEYS OP_ALARM OP_AND OP_ANDASSIGN -syn keyword xsConstant OP_ANONCODE OP_ANONHASH OP_ANONLIST OP_ASLICE OP_ATAN2 -syn keyword xsConstant OP_AV2ARYLEN OP_AVALUES OP_BACKTICK OP_BIND OP_BINMODE -syn keyword xsConstant OP_BIT_AND OP_BIT_OR OP_BIT_XOR OP_BLESS OP_BOOLKEYS -syn keyword xsConstant OP_BREAK OP_CALLER OP_CHDIR OP_CHMOD OP_CHOMP OP_CHOP -syn keyword xsConstant OP_CHOWN OP_CHR OP_CHROOT OP_CLOSE OP_CLOSEDIR -syn keyword xsConstant OP_COMPLEMENT OP_CONCAT OP_COND_EXPR OP_CONNECT -syn keyword xsConstant OP_CONST OP_CONTINUE OP_COREARGS OP_COS OP_CRYPT -syn keyword xsConstant OP_CUSTOM OP_DBMCLOSE OP_DBMOPEN OP_DBSTATE OP_DEFINED -syn keyword xsConstant OP_DELETE OP_DIE OP_DIVIDE OP_DOFILE OP_DOR -syn keyword xsConstant OP_DORASSIGN OP_DUMP OP_EACH OP_EGRENT OP_EHOSTENT -syn keyword xsConstant OP_ENETENT OP_ENTER OP_ENTEREVAL OP_ENTERGIVEN -syn keyword xsConstant OP_ENTERITER OP_ENTERLOOP OP_ENTERSUB OP_ENTERTRY -syn keyword xsConstant OP_ENTERWHEN OP_ENTERWRITE OP_EOF OP_EPROTOENT -syn keyword xsConstant OP_EPWENT OP_EQ OP_ESERVENT OP_EXEC OP_EXISTS OP_EXIT -syn keyword xsConstant OP_EXP OP_FC OP_FCNTL OP_FILENO OP_FLIP OP_FLOCK -syn keyword xsConstant OP_FLOP OP_FORK OP_FORMLINE OP_FTATIME OP_FTBINARY -syn keyword xsConstant OP_FTBLK OP_FTCHR OP_FTCTIME OP_FTDIR OP_FTEEXEC -syn keyword xsConstant OP_FTEOWNED OP_FTEREAD OP_FTEWRITE OP_FTFILE OP_FTIS -syn keyword xsConstant OP_FTLINK OP_FTMTIME OP_FTPIPE OP_FTREXEC OP_FTROWNED -syn keyword xsConstant OP_FTRREAD OP_FTRWRITE OP_FTSGID OP_FTSIZE OP_FTSOCK -syn keyword xsConstant OP_FTSUID OP_FTSVTX OP_FTTEXT OP_FTTTY OP_FTZERO OP_GE -syn keyword xsConstant OP_GELEM OP_GETC OP_GETLOGIN OP_GETPEERNAME OP_GETPGRP -syn keyword xsConstant OP_GETPPID OP_GETPRIORITY OP_GETSOCKNAME OP_GGRENT -syn keyword xsConstant OP_GGRGID OP_GGRNAM OP_GHBYADDR OP_GHBYNAME -syn keyword xsConstant OP_GHOSTENT OP_GLOB OP_GMTIME OP_GNBYADDR OP_GNBYNAME -syn keyword xsConstant OP_GNETENT OP_GOTO OP_GPBYNAME OP_GPBYNUMBER -syn keyword xsConstant OP_GPROTOENT OP_GPWENT OP_GPWNAM OP_GPWUID -syn keyword xsConstant OP_GREPSTART OP_GREPWHILE OP_GSBYNAME OP_GSBYPORT -syn keyword xsConstant OP_GSERVENT OP_GSOCKOPT OP_GT OP_GV OP_GVSV OP_HELEM -syn keyword xsConstant OP_HEX OP_HINTSEVAL OP_HSLICE OP_INDEX OP_INT OP_IOCTL -syn keyword xsConstant OP_ITER OP_I_ADD OP_I_DIVIDE OP_I_EQ OP_I_GE OP_I_GT -syn keyword xsConstant OP_I_LE OP_I_LT OP_I_MODULO OP_I_MULTIPLY OP_I_NCMP -syn keyword xsConstant OP_I_NE OP_I_NEGATE OP_I_POSTDEC OP_I_POSTINC -syn keyword xsConstant OP_I_PREDEC OP_I_PREINC OP_I_SUBTRACT OP_JOIN OP_KEYS -syn keyword xsConstant OP_KILL OP_LAST OP_LC OP_LCFIRST OP_LE OP_LEAVE -syn keyword xsConstant OP_LEAVEEVAL OP_LEAVEGIVEN OP_LEAVELOOP OP_LEAVESUB -syn keyword xsConstant OP_LEAVESUBLV OP_LEAVETRY OP_LEAVEWHEN OP_LEAVEWRITE -syn keyword xsConstant OP_LEFT_SHIFT OP_LENGTH OP_LINESEQ OP_LINK OP_LIST -syn keyword xsConstant OP_LISTEN OP_LOCALTIME OP_LOCK OP_LOG OP_LSLICE -syn keyword xsConstant OP_LSTAT OP_LT OP_MAPSTART OP_MAPWHILE OP_MATCH -syn keyword xsConstant OP_METHOD OP_METHOD_NAMED OP_MKDIR OP_MODULO OP_MSGCTL -syn keyword xsConstant OP_MSGGET OP_MSGRCV OP_MSGSND OP_MULTIPLY OP_NCMP -syn keyword xsConstant OP_NE OP_NEGATE OP_NEXT OP_NEXTSTATE OP_NOT OP_NULL -syn keyword xsConstant OP_OCT OP_ONCE OP_OPEN OP_OPEN_DIR OP_OR OP_ORASSIGN -syn keyword xsConstant OP_ORD OP_PACK OP_PADANY OP_PADAV OP_PADHV OP_PADSV -syn keyword xsConstant OP_PIPE_OP OP_POP OP_POS OP_POSTDEC OP_POSTINC OP_POW -syn keyword xsConstant OP_PREDEC OP_PREINC OP_PRINT OP_PROTOTYPE OP_PRTF -syn keyword xsConstant OP_PUSH OP_PUSHMARK OP_PUSHRE OP_QR OP_QUOTEMETA -syn keyword xsConstant OP_RAND OP_RANGE OP_RCATLINE OP_REACH OP_READ -syn keyword xsConstant OP_READDIR OP_READLINE OP_READLINK OP_RECV OP_REDO -syn keyword xsConstant OP_REF OP_REFGEN OP_REGCMAYBE OP_REGCOMP OP_REGCRESET -syn keyword xsConstant OP_RENAME OP_REPEAT OP_REQUIRE OP_RESET OP_RETURN -syn keyword xsConstant OP_REVERSE OP_REWINDDIR OP_RIGHT_SHIFT OP_RINDEX -syn keyword xsConstant OP_RKEYS OP_RMDIR OP_RUNCV OP_RV2AV OP_RV2CV OP_RV2GV -syn keyword xsConstant OP_RV2HV OP_RV2SV OP_RVALUES OP_SASSIGN OP_SAY -syn keyword xsConstant OP_SCALAR OP_SCHOMP OP_SCHOP OP_SCMP OP_SCOPE OP_SEEK -syn keyword xsConstant OP_SEEKDIR OP_SELECT OP_SEMCTL OP_SEMGET OP_SEMOP -syn keyword xsConstant OP_SEND OP_SEQ OP_SETPGRP OP_SETPRIORITY OP_SGE -syn keyword xsConstant OP_SGRENT OP_SGT OP_SHIFT OP_SHMCTL OP_SHMGET -syn keyword xsConstant OP_SHMREAD OP_SHMWRITE OP_SHOSTENT OP_SHUTDOWN OP_SIN -syn keyword xsConstant OP_SLE OP_SLEEP OP_SLT OP_SMARTMATCH OP_SNE OP_SNETENT -syn keyword xsConstant OP_SOCKET OP_SOCKPAIR OP_SORT OP_SPLICE OP_SPLIT -syn keyword xsConstant OP_SPRINTF OP_SPROTOENT OP_SPWENT OP_SQRT OP_SRAND -syn keyword xsConstant OP_SREFGEN OP_SSELECT OP_SSERVENT OP_SSOCKOPT OP_STAT -syn keyword xsConstant OP_STRINGIFY OP_STUB OP_STUDY OP_SUBST OP_SUBSTCONT -syn keyword xsConstant OP_SUBSTR OP_SUBTRACT OP_SYMLINK OP_SYSCALL OP_SYSOPEN -syn keyword xsConstant OP_SYSREAD OP_SYSSEEK OP_SYSTEM OP_SYSWRITE OP_TELL -syn keyword xsConstant OP_TELLDIR OP_TIE OP_TIED OP_TIME OP_TMS OP_TRANS -syn keyword xsConstant OP_TRANSR OP_TRUNCATE OP_UC OP_UCFIRST OP_UMASK -syn keyword xsConstant OP_UNDEF OP_UNLINK OP_UNPACK OP_UNSHIFT OP_UNSTACK -syn keyword xsConstant OP_UNTIE OP_UTIME OP_VALUES OP_VEC OP_WAIT OP_WAITPID -syn keyword xsConstant OP_WANTARRAY OP_WARN OP_XOR OP_max OPf_KIDS OPf_KNOW -syn keyword xsConstant OPf_LIST OPf_MOD OPf_PARENS OPf_REF OPf_SPECIAL -syn keyword xsConstant OPf_STACKED OPf_WANT OPf_WANT_LIST OPf_WANT_SCALAR -syn keyword xsConstant OPf_WANT_VOID OPpALLOW_FAKE OPpASSIGN_BACKWARDS -syn keyword xsConstant OPpASSIGN_COMMON OPpASSIGN_CV_TO_GV OPpCONST_BARE -syn keyword xsConstant OPpCONST_ENTERED OPpCONST_NOVER OPpCONST_SHORTCIRCUIT -syn keyword xsConstant OPpCONST_STRICT OPpCONST_WARNING OPpCOREARGS_DEREF1 -syn keyword xsConstant OPpCOREARGS_DEREF2 OPpCOREARGS_PUSHMARK -syn keyword xsConstant OPpCOREARGS_SCALARMOD OPpDEREF OPpDEREF_AV OPpDEREF_HV -syn keyword xsConstant OPpDEREF_SV OPpDONT_INIT_GV OPpEARLY_CV -syn keyword xsConstant OPpENTERSUB_AMPER OPpENTERSUB_DB OPpENTERSUB_HASTARG -syn keyword xsConstant OPpENTERSUB_INARGS OPpENTERSUB_LVAL_MASK -syn keyword xsConstant OPpENTERSUB_NOPAREN OPpEVAL_BYTES OPpEVAL_COPHH -syn keyword xsConstant OPpEVAL_HAS_HH OPpEVAL_UNICODE OPpEXISTS_SUB -syn keyword xsConstant OPpEXIT_VMSISH OPpFLIP_LINENUM OPpFT_ACCESS -syn keyword xsConstant OPpFT_AFTER_t OPpFT_STACKED OPpFT_STACKING OPpGREP_LEX -syn keyword xsConstant OPpHUSH_VMSISH OPpITER_DEF OPpITER_REVERSED -syn keyword xsConstant OPpLIST_GUESSED OPpLVAL_DEFER OPpLVAL_INTRO -syn keyword xsConstant OPpMAYBE_LVSUB OPpMAY_RETURN_CONSTANT OPpOFFBYONE -syn keyword xsConstant OPpOPEN_IN_CRLF OPpOPEN_IN_RAW OPpOPEN_OUT_CRLF -syn keyword xsConstant OPpOPEN_OUT_RAW OPpOUR_INTRO OPpPAD_STATE -syn keyword xsConstant OPpPV_IS_UTF8 OPpREFCOUNTED OPpREPEAT_DOLIST -syn keyword xsConstant OPpREVERSE_INPLACE OPpRUNTIME OPpSLICE OPpSORT_DESCEND +syn keyword xsConstant OA_SVOP OA_TARGET OA_TARGLEX OA_UNOP OA_UNOP_AUX +syn keyword xsConstant OP_AASSIGN OP_ABS OP_ACCEPT OP_ADD OP_AEACH OP_AELEM +syn keyword xsConstant OP_AELEMFAST OP_AELEMFAST_LEX OP_AKEYS OP_ALARM OP_AND +syn keyword xsConstant OP_ANDASSIGN OP_ANONCODE OP_ANONCONST OP_ANONHASH +syn keyword xsConstant OP_ANONLIST OP_ASLICE OP_ATAN2 OP_AV2ARYLEN OP_AVALUES +syn keyword xsConstant OP_BACKTICK OP_BIND OP_BINMODE OP_BIT_AND OP_BIT_OR +syn keyword xsConstant OP_BIT_XOR OP_BLESS OP_BREAK OP_CALLER OP_CHDIR +syn keyword xsConstant OP_CHMOD OP_CHOMP OP_CHOP OP_CHOWN OP_CHR OP_CHROOT +syn keyword xsConstant OP_CLONECV OP_CLOSE OP_CLOSEDIR OP_COMPLEMENT +syn keyword xsConstant OP_CONCAT OP_COND_EXPR OP_CONNECT OP_CONST OP_CONTINUE +syn keyword xsConstant OP_COREARGS OP_COS OP_CRYPT OP_CUSTOM OP_DBMCLOSE +syn keyword xsConstant OP_DBMOPEN OP_DBSTATE OP_DEFINED OP_DELETE OP_DIE +syn keyword xsConstant OP_DIVIDE OP_DOFILE OP_DOR OP_DORASSIGN OP_DUMP +syn keyword xsConstant OP_EACH OP_EGRENT OP_EHOSTENT OP_ENETENT OP_ENTER +syn keyword xsConstant OP_ENTEREVAL OP_ENTERGIVEN OP_ENTERITER OP_ENTERLOOP +syn keyword xsConstant OP_ENTERSUB OP_ENTERTRY OP_ENTERWHEN OP_ENTERWRITE +syn keyword xsConstant OP_EOF OP_EPROTOENT OP_EPWENT OP_EQ OP_ESERVENT +syn keyword xsConstant OP_EXEC OP_EXISTS OP_EXIT OP_EXP OP_FC OP_FCNTL +syn keyword xsConstant OP_FILENO OP_FLIP OP_FLOCK OP_FLOP OP_FORK OP_FORMLINE +syn keyword xsConstant OP_FTATIME OP_FTBINARY OP_FTBLK OP_FTCHR OP_FTCTIME +syn keyword xsConstant OP_FTDIR OP_FTEEXEC OP_FTEOWNED OP_FTEREAD OP_FTEWRITE +syn keyword xsConstant OP_FTFILE OP_FTIS OP_FTLINK OP_FTMTIME OP_FTPIPE +syn keyword xsConstant OP_FTREXEC OP_FTROWNED OP_FTRREAD OP_FTRWRITE +syn keyword xsConstant OP_FTSGID OP_FTSIZE OP_FTSOCK OP_FTSUID OP_FTSVTX +syn keyword xsConstant OP_FTTEXT OP_FTTTY OP_FTZERO OP_GE OP_GELEM OP_GETC +syn keyword xsConstant OP_GETLOGIN OP_GETPEERNAME OP_GETPGRP OP_GETPPID +syn keyword xsConstant OP_GETPRIORITY OP_GETSOCKNAME OP_GGRENT OP_GGRGID +syn keyword xsConstant OP_GGRNAM OP_GHBYADDR OP_GHBYNAME OP_GHOSTENT OP_GLOB +syn keyword xsConstant OP_GMTIME OP_GNBYADDR OP_GNBYNAME OP_GNETENT OP_GOTO +syn keyword xsConstant OP_GPBYNAME OP_GPBYNUMBER OP_GPROTOENT OP_GPWENT +syn keyword xsConstant OP_GPWNAM OP_GPWUID OP_GREPSTART OP_GREPWHILE +syn keyword xsConstant OP_GSBYNAME OP_GSBYPORT OP_GSERVENT OP_GSOCKOPT OP_GT +syn keyword xsConstant OP_GV OP_GVSV OP_HELEM OP_HEX OP_HINTSEVAL OP_HSLICE +syn keyword xsConstant OP_INDEX OP_INT OP_INTROCV OP_IOCTL OP_ITER OP_I_ADD +syn keyword xsConstant OP_I_DIVIDE OP_I_EQ OP_I_GE OP_I_GT OP_I_LE OP_I_LT +syn keyword xsConstant OP_I_MODULO OP_I_MULTIPLY OP_I_NCMP OP_I_NE +syn keyword xsConstant OP_I_NEGATE OP_I_POSTDEC OP_I_POSTINC OP_I_PREDEC +syn keyword xsConstant OP_I_PREINC OP_I_SUBTRACT OP_JOIN OP_KEYS OP_KILL +syn keyword xsConstant OP_KVASLICE OP_KVHSLICE OP_LAST OP_LC OP_LCFIRST OP_LE +syn keyword xsConstant OP_LEAVE OP_LEAVEEVAL OP_LEAVEGIVEN OP_LEAVELOOP +syn keyword xsConstant OP_LEAVESUB OP_LEAVESUBLV OP_LEAVETRY OP_LEAVEWHEN +syn keyword xsConstant OP_LEAVEWRITE OP_LEFT_SHIFT OP_LENGTH OP_LINESEQ +syn keyword xsConstant OP_LINK OP_LIST OP_LISTEN OP_LOCALTIME OP_LOCK OP_LOG +syn keyword xsConstant OP_LSLICE OP_LSTAT OP_LT OP_LVAVREF OP_LVREF +syn keyword xsConstant OP_LVREFSLICE OP_MAPSTART OP_MAPWHILE OP_MATCH +syn keyword xsConstant OP_METHOD OP_METHOD_NAMED OP_METHOD_REDIR +syn keyword xsConstant OP_METHOD_REDIR_SUPER OP_METHOD_SUPER OP_MKDIR +syn keyword xsConstant OP_MODULO OP_MSGCTL OP_MSGGET OP_MSGRCV OP_MSGSND +syn keyword xsConstant OP_MULTIDEREF OP_MULTIPLY OP_NBIT_AND OP_NBIT_OR +syn keyword xsConstant OP_NBIT_XOR OP_NCMP OP_NCOMPLEMENT OP_NE OP_NEGATE +syn keyword xsConstant OP_NEXT OP_NEXTSTATE OP_NOT OP_NULL OP_OCT OP_ONCE +syn keyword xsConstant OP_OPEN OP_OPEN_DIR OP_OR OP_ORASSIGN OP_ORD OP_PACK +syn keyword xsConstant OP_PADANY OP_PADAV OP_PADCV OP_PADHV OP_PADRANGE +syn keyword xsConstant OP_PADSV OP_PIPE_OP OP_POP OP_POS OP_POSTDEC +syn keyword xsConstant OP_POSTINC OP_POW OP_PREDEC OP_PREINC OP_PRINT +syn keyword xsConstant OP_PROTOTYPE OP_PRTF OP_PUSH OP_PUSHMARK OP_PUSHRE +syn keyword xsConstant OP_QR OP_QUOTEMETA OP_RAND OP_RANGE OP_RCATLINE +syn keyword xsConstant OP_REACH OP_READ OP_READDIR OP_READLINE OP_READLINK +syn keyword xsConstant OP_RECV OP_REDO OP_REF OP_REFASSIGN OP_REFGEN +syn keyword xsConstant OP_REGCMAYBE OP_REGCOMP OP_REGCRESET OP_RENAME +syn keyword xsConstant OP_REPEAT OP_REQUIRE OP_RESET OP_RETURN OP_REVERSE +syn keyword xsConstant OP_REWINDDIR OP_RIGHT_SHIFT OP_RINDEX OP_RKEYS +syn keyword xsConstant OP_RMDIR OP_RUNCV OP_RV2AV OP_RV2CV OP_RV2GV OP_RV2HV +syn keyword xsConstant OP_RV2SV OP_RVALUES OP_SASSIGN OP_SAY OP_SBIT_AND +syn keyword xsConstant OP_SBIT_OR OP_SBIT_XOR OP_SCALAR OP_SCHOMP OP_SCHOP +syn keyword xsConstant OP_SCMP OP_SCOMPLEMENT OP_SCOPE OP_SEEK OP_SEEKDIR +syn keyword xsConstant OP_SELECT OP_SEMCTL OP_SEMGET OP_SEMOP OP_SEND OP_SEQ +syn keyword xsConstant OP_SETPGRP OP_SETPRIORITY OP_SGE OP_SGRENT OP_SGT +syn keyword xsConstant OP_SHIFT OP_SHMCTL OP_SHMGET OP_SHMREAD OP_SHMWRITE +syn keyword xsConstant OP_SHOSTENT OP_SHUTDOWN OP_SIN OP_SLE OP_SLEEP OP_SLT +syn keyword xsConstant OP_SMARTMATCH OP_SNE OP_SNETENT OP_SOCKET OP_SOCKPAIR +syn keyword xsConstant OP_SORT OP_SPLICE OP_SPLIT OP_SPRINTF OP_SPROTOENT +syn keyword xsConstant OP_SPWENT OP_SQRT OP_SRAND OP_SREFGEN OP_SSELECT +syn keyword xsConstant OP_SSERVENT OP_SSOCKOPT OP_STAT OP_STRINGIFY OP_STUB +syn keyword xsConstant OP_STUDY OP_SUBST OP_SUBSTCONT OP_SUBSTR OP_SUBTRACT +syn keyword xsConstant OP_SYMLINK OP_SYSCALL OP_SYSOPEN OP_SYSREAD OP_SYSSEEK +syn keyword xsConstant OP_SYSTEM OP_SYSWRITE OP_TELL OP_TELLDIR OP_TIE +syn keyword xsConstant OP_TIED OP_TIME OP_TMS OP_TRANS OP_TRANSR OP_TRUNCATE +syn keyword xsConstant OP_UC OP_UCFIRST OP_UMASK OP_UNDEF OP_UNLINK OP_UNPACK +syn keyword xsConstant OP_UNSHIFT OP_UNSTACK OP_UNTIE OP_UTIME OP_VALUES +syn keyword xsConstant OP_VEC OP_WAIT OP_WAITPID OP_WANTARRAY OP_WARN OP_XOR +syn keyword xsConstant OP_max OPf_FOLDED OPf_KIDS OPf_KNOW OPf_LIST OPf_MOD +syn keyword xsConstant OPf_PARENS OPf_REF OPf_SPECIAL OPf_STACKED OPf_WANT +syn keyword xsConstant OPf_WANT_LIST OPf_WANT_SCALAR OPf_WANT_VOID +syn keyword xsConstant OPpALLOW_FAKE OPpARG1_MASK OPpARG2_MASK OPpARG3_MASK +syn keyword xsConstant OPpARG4_MASK OPpASSIGN_BACKWARDS OPpASSIGN_COMMON +syn keyword xsConstant OPpASSIGN_CV_TO_GV OPpCONST_BARE OPpCONST_ENTERED +syn keyword xsConstant OPpCONST_NOVER OPpCONST_SHORTCIRCUIT OPpCONST_STRICT +syn keyword xsConstant OPpCOREARGS_DEREF1 OPpCOREARGS_DEREF2 +syn keyword xsConstant OPpCOREARGS_PUSHMARK OPpCOREARGS_SCALARMOD OPpDEREF +syn keyword xsConstant OPpDEREF_AV OPpDEREF_HV OPpDEREF_SV OPpDONT_INIT_GV +syn keyword xsConstant OPpEARLY_CV OPpENTERSUB_AMPER OPpENTERSUB_DB +syn keyword xsConstant OPpENTERSUB_HASTARG OPpENTERSUB_INARGS +syn keyword xsConstant OPpENTERSUB_LVAL_MASK OPpENTERSUB_NOPAREN +syn keyword xsConstant OPpEVAL_BYTES OPpEVAL_COPHH OPpEVAL_HAS_HH +syn keyword xsConstant OPpEVAL_RE_REPARSING OPpEVAL_UNICODE OPpEXISTS_SUB +syn keyword xsConstant OPpFLIP_LINENUM OPpFT_ACCESS OPpFT_AFTER_t +syn keyword xsConstant OPpFT_STACKED OPpFT_STACKING OPpGREP_LEX +syn keyword xsConstant OPpHINT_STRICT_REFS OPpHUSH_VMSISH OPpITER_DEF +syn keyword xsConstant OPpITER_REVERSED OPpLIST_GUESSED OPpLVALUE +syn keyword xsConstant OPpLVAL_DEFER OPpLVAL_INTRO OPpLVREF_AV OPpLVREF_CV +syn keyword xsConstant OPpLVREF_ELEM OPpLVREF_HV OPpLVREF_ITER OPpLVREF_SV +syn keyword xsConstant OPpLVREF_TYPE OPpMAYBE_LVSUB OPpMAYBE_TRUEBOOL +syn keyword xsConstant OPpMAY_RETURN_CONSTANT OPpMULTIDEREF_DELETE +syn keyword xsConstant OPpMULTIDEREF_EXISTS OPpOFFBYONE OPpOPEN_IN_CRLF +syn keyword xsConstant OPpOPEN_IN_RAW OPpOPEN_OUT_CRLF OPpOPEN_OUT_RAW +syn keyword xsConstant OPpOUR_INTRO OPpPADRANGE_COUNTMASK +syn keyword xsConstant OPpPADRANGE_COUNTSHIFT OPpPAD_STATE OPpPV_IS_UTF8 +syn keyword xsConstant OPpREFCOUNTED OPpREPEAT_DOLIST OPpREVERSE_INPLACE +syn keyword xsConstant OPpRUNTIME OPpSLICE OPpSLICEWARNING OPpSORT_DESCEND syn keyword xsConstant OPpSORT_INPLACE OPpSORT_INTEGER OPpSORT_NUMERIC syn keyword xsConstant OPpSORT_QSORT OPpSORT_REVERSE OPpSORT_STABLE -syn keyword xsConstant OPpSUBSTR_REPL_FIRST OPpTARGET_MY OPpTRANS_ALL -syn keyword xsConstant OPpTRANS_COMPLEMENT OPpTRANS_DELETE OPpTRANS_FROM_UTF -syn keyword xsConstant OPpTRANS_GROWS OPpTRANS_IDENTICAL OPpTRANS_SQUASH -syn keyword xsConstant OPpTRANS_TO_UTF PERL_MAGIC_READONLY_ACCEPTABLE +syn keyword xsConstant OPpSPLIT_IMPLIM OPpSUBSTR_REPL_FIRST OPpTARGET_MY +syn keyword xsConstant OPpTRANS_ALL OPpTRANS_COMPLEMENT OPpTRANS_DELETE +syn keyword xsConstant OPpTRANS_FROM_UTF OPpTRANS_GROWS OPpTRANS_IDENTICAL +syn keyword xsConstant OPpTRANS_SQUASH OPpTRANS_TO_UTF OPpTRUEBOOL +syn keyword xsConstant PERL_MAGIC_READONLY_ACCEPTABLE syn keyword xsConstant PERL_MAGIC_TYPE_IS_VALUE_MAGIC syn keyword xsConstant PERL_MAGIC_TYPE_READONLY_ACCEPTABLE syn keyword xsConstant PERL_MAGIC_UTF8_CACHESIZE PERL_MAGIC_VALUE_MAGIC syn keyword xsConstant PERL_MAGIC_VTABLE_MASK PERL_MAGIC_arylen syn keyword xsConstant PERL_MAGIC_arylen_p PERL_MAGIC_backref PERL_MAGIC_bm syn keyword xsConstant PERL_MAGIC_checkcall PERL_MAGIC_collxfrm -syn keyword xsConstant PERL_MAGIC_dbfile PERL_MAGIC_dbline PERL_MAGIC_defelem -syn keyword xsConstant PERL_MAGIC_env PERL_MAGIC_envelem PERL_MAGIC_ext -syn keyword xsConstant PERL_MAGIC_fm PERL_MAGIC_hints PERL_MAGIC_hintselem -syn keyword xsConstant PERL_MAGIC_isa PERL_MAGIC_isaelem PERL_MAGIC_nkeys -syn keyword xsConstant PERL_MAGIC_overload PERL_MAGIC_overload_elem +syn keyword xsConstant PERL_MAGIC_dbfile PERL_MAGIC_dbline +syn keyword xsConstant PERL_MAGIC_debugvar PERL_MAGIC_defelem PERL_MAGIC_env +syn keyword xsConstant PERL_MAGIC_envelem PERL_MAGIC_ext PERL_MAGIC_fm +syn keyword xsConstant PERL_MAGIC_hints PERL_MAGIC_hintselem PERL_MAGIC_isa +syn keyword xsConstant PERL_MAGIC_isaelem PERL_MAGIC_lvref PERL_MAGIC_nkeys syn keyword xsConstant PERL_MAGIC_overload_table PERL_MAGIC_pos PERL_MAGIC_qr syn keyword xsConstant PERL_MAGIC_regdata PERL_MAGIC_regdatum syn keyword xsConstant PERL_MAGIC_regex_global PERL_MAGIC_rhash syn keyword xsConstant PERL_MAGIC_shared PERL_MAGIC_shared_scalar -syn keyword xsConstant PERL_MAGIC_sig PERL_MAGIC_sigelem PERL_MAGIC_study -syn keyword xsConstant PERL_MAGIC_substr PERL_MAGIC_sv PERL_MAGIC_symtab -syn keyword xsConstant PERL_MAGIC_taint PERL_MAGIC_tied PERL_MAGIC_tiedelem +syn keyword xsConstant PERL_MAGIC_sig PERL_MAGIC_sigelem PERL_MAGIC_substr +syn keyword xsConstant PERL_MAGIC_sv PERL_MAGIC_symtab PERL_MAGIC_taint +syn keyword xsConstant PERL_MAGIC_tied PERL_MAGIC_tiedelem syn keyword xsConstant PERL_MAGIC_tiedscalar PERL_MAGIC_utf8 PERL_MAGIC_uvar syn keyword xsConstant PERL_MAGIC_uvar_elem PERL_MAGIC_vec PERL_MAGIC_vstring syn keyword xsConstant REGEX_ASCII_MORE_RESTRICTED_CHARSET syn keyword xsConstant REGEX_ASCII_RESTRICTED_CHARSET REGEX_DEPENDS_CHARSET -syn keyword xsConstant REGEX_LOCALE_CHARSET REGEX_UNICODE_CHARSET SVfARG +syn keyword xsConstant REGEX_LOCALE_CHARSET REGEX_UNICODE_CHARSET SB_ATerm +syn keyword xsConstant SB_BOUND SB_CR SB_Close SB_EDGE SB_Extend SB_Format +syn keyword xsConstant SB_LF SB_Lower SB_Numeric SB_OLetter SB_Other +syn keyword xsConstant SB_SContinue SB_STerm SB_Sep SB_Sp SB_Upper SVfARG syn keyword xsConstant SVf_AMAGIC SVf_BREAK SVf_FAKE SVf_IOK SVf_IVisUV -syn keyword xsConstant SVf_NOK SVf_OK SVf_OOK SVf_POK SVf_READONLY SVf_ROK -syn keyword xsConstant SVf_THINKFIRST SVf_UTF8 SVp_IOK SVp_NOK SVp_POK -syn keyword xsConstant SVp_SCREAM SVpad_NAME SVpad_OUR SVpad_STATE +syn keyword xsConstant SVf_IsCOW SVf_NOK SVf_OK SVf_OOK SVf_POK SVf_PROTECT +syn keyword xsConstant SVf_READONLY SVf_ROK SVf_THINKFIRST SVf_UTF8 SVp_IOK +syn keyword xsConstant SVp_NOK SVp_POK SVp_SCREAM SVpad_OUR SVpad_STATE syn keyword xsConstant SVpad_TYPED SVpav_REAL SVpav_REIFY SVpbm_TAIL syn keyword xsConstant SVpbm_VALID SVpgv_GP SVphv_CLONEABLE SVphv_HASKFLAGS -syn keyword xsConstant SVphv_LAZYDEL SVphv_REHASH SVphv_SHAREKEYS -syn keyword xsConstant SVprv_PCS_IMPORTED SVprv_WEAKREF SVs_GMG SVs_OBJECT -syn keyword xsConstant SVs_PADMY SVs_PADSTALE SVs_PADTMP SVs_RMG SVs_SMG -syn keyword xsConstant SVs_TEMP SVt_BIND SVt_IV SVt_LAST SVt_NULL SVt_NV -syn keyword xsConstant SVt_PV SVt_PVAV SVt_PVBM SVt_PVCV SVt_PVFM SVt_PVGV -syn keyword xsConstant SVt_PVHV SVt_PVIO SVt_PVIV SVt_PVLV SVt_PVMG SVt_PVNV -syn keyword xsConstant SVt_REGEXP SVt_RV TRUE XATTRBLOCK XATTRTERM XBLOCK -syn keyword xsConstant XOPERATOR XREF XSTATE XTERM XTERMBLOCK XTERMORDORDOR -syn keyword xsConstant padtidy_FORMAT padtidy_SUB padtidy_SUBCLONE +syn keyword xsConstant SVphv_LAZYDEL SVphv_SHAREKEYS SVprv_PCS_IMPORTED +syn keyword xsConstant SVprv_WEAKREF SVs_GMG SVs_OBJECT SVs_PADMY +syn keyword xsConstant SVs_PADSTALE SVs_PADTMP SVs_RMG SVs_SMG SVs_TEMP +syn keyword xsConstant SVt_INVLIST SVt_IV SVt_LAST SVt_NULL SVt_NV SVt_PV +syn keyword xsConstant SVt_PVAV SVt_PVBM SVt_PVCV SVt_PVFM SVt_PVGV SVt_PVHV +syn keyword xsConstant SVt_PVIO SVt_PVIV SVt_PVLV SVt_PVMG SVt_PVNV +syn keyword xsConstant SVt_REGEXP SVt_RV TRADITIONAL_BOUND WB_ALetter +syn keyword xsConstant WB_BOUND WB_CR WB_Double_Quote WB_EDGE WB_Extend +syn keyword xsConstant WB_ExtendNumLet WB_Format WB_Hebrew_Letter WB_Katakana +syn keyword xsConstant WB_LF WB_MidLetter WB_MidNum WB_MidNumLet WB_Newline +syn keyword xsConstant WB_Numeric WB_Other WB_Regional_Indicator +syn keyword xsConstant WB_Single_Quote WB_UNKNOWN XATTRBLOCK XATTRTERM XBLOCK +syn keyword xsConstant XBLOCKTERM XOPERATOR XOPe_xop_class XOPe_xop_desc +syn keyword xsConstant XOPe_xop_name XOPe_xop_peep XOPe_xop_ptr XPOSTDEREF +syn keyword xsConstant XREF XSTATE XTERM XTERMBLOCK XTERMORDORDOR +syn keyword xsConstant _CC_ENUM_ALPHA _CC_ENUM_ALPHANUMERIC _CC_ENUM_ASCII +syn keyword xsConstant _CC_ENUM_BLANK _CC_ENUM_CASED _CC_ENUM_CNTRL +syn keyword xsConstant _CC_ENUM_DIGIT _CC_ENUM_GRAPH _CC_ENUM_LOWER +syn keyword xsConstant _CC_ENUM_PRINT _CC_ENUM_PUNCT _CC_ENUM_SPACE +syn keyword xsConstant _CC_ENUM_UPPER _CC_ENUM_VERTSPACE _CC_ENUM_WORDCHAR +syn keyword xsConstant _CC_ENUM_XDIGIT padtidy_FORMAT padtidy_SUB +syn keyword xsConstant padtidy_SUBCLONE syn keyword xsException XCPT_CATCH XCPT_RETHROW XCPT_TRY_END XCPT_TRY_START syn keyword xsException dXCPT syn keyword xsKeyword ALIAS: BOOT: CASE: CLEANUP: CODE: C_ARGS: DISABLE @@ -492,11 +598,19 @@ syn keyword xsFunction Perl_PerlIO_read Perl_PerlIO_seek Perl_PerlIO_set_cnt syn keyword xsFunction Perl_PerlIO_set_ptrcnt Perl_PerlIO_setlinebuf syn keyword xsFunction Perl_PerlIO_stderr Perl_PerlIO_stdin syn keyword xsFunction Perl_PerlIO_stdout Perl_PerlIO_tell Perl_PerlIO_unread -syn keyword xsFunction Perl_PerlIO_write Perl_Slab_Alloc Perl_Slab_Free -syn keyword xsFunction Perl__is_utf8_quotemeta Perl__to_uni_fold_flags +syn keyword xsFunction Perl_PerlIO_write Perl__get_regclass_nonbitmap_data +syn keyword xsFunction Perl__is_cur_LC_category_utf8 +syn keyword xsFunction Perl__is_in_locale_category Perl__is_uni_FOO +syn keyword xsFunction Perl__is_uni_perl_idcont Perl__is_uni_perl_idstart +syn keyword xsFunction Perl__is_utf8_FOO Perl__is_utf8_idcont +syn keyword xsFunction Perl__is_utf8_idstart Perl__is_utf8_mark +syn keyword xsFunction Perl__is_utf8_perl_idcont Perl__is_utf8_perl_idstart +syn keyword xsFunction Perl__is_utf8_xidcont Perl__is_utf8_xidstart +syn keyword xsFunction Perl__new_invlist_C_array Perl__to_uni_fold_flags syn keyword xsFunction Perl__to_utf8_fold_flags Perl__to_utf8_lower_flags syn keyword xsFunction Perl__to_utf8_title_flags Perl__to_utf8_upper_flags -syn keyword xsFunction Perl_amagic_call Perl_amagic_deref_call Perl_any_dup +syn keyword xsFunction Perl_alloccopstash Perl_amagic_call +syn keyword xsFunction Perl_amagic_deref_call Perl_any_dup syn keyword xsFunction Perl_apply_attrs_string Perl_atfork_lock syn keyword xsFunction Perl_atfork_unlock Perl_av_arylen_p Perl_av_clear syn keyword xsFunction Perl_av_create_and_push Perl_av_create_and_unshift_one @@ -504,13 +618,14 @@ syn keyword xsFunction Perl_av_delete Perl_av_exists Perl_av_extend syn keyword xsFunction Perl_av_fetch Perl_av_fill Perl_av_iter_p Perl_av_len syn keyword xsFunction Perl_av_make Perl_av_pop Perl_av_push Perl_av_shift syn keyword xsFunction Perl_av_store Perl_av_undef Perl_av_unshift -syn keyword xsFunction Perl_block_gimme Perl_blockhook_register -syn keyword xsFunction Perl_bytes_cmp_utf8 Perl_bytes_from_utf8 -syn keyword xsFunction Perl_bytes_to_utf8 Perl_call_argv Perl_call_atexit -syn keyword xsFunction Perl_call_list Perl_call_method Perl_call_pv -syn keyword xsFunction Perl_call_sv Perl_caller_cx Perl_calloc Perl_cast_i32 -syn keyword xsFunction Perl_cast_iv Perl_cast_ulong Perl_cast_uv -syn keyword xsFunction Perl_ck_entersub_args_list Perl_ck_entersub_args_proto +syn keyword xsFunction Perl_block_end Perl_block_gimme Perl_block_start +syn keyword xsFunction Perl_blockhook_register Perl_bytes_cmp_utf8 +syn keyword xsFunction Perl_bytes_from_utf8 Perl_bytes_to_utf8 Perl_call_argv +syn keyword xsFunction Perl_call_atexit Perl_call_list Perl_call_method +syn keyword xsFunction Perl_call_pv Perl_call_sv Perl_caller_cx Perl_calloc +syn keyword xsFunction Perl_cast_i32 Perl_cast_iv Perl_cast_ulong +syn keyword xsFunction Perl_cast_uv Perl_ck_entersub_args_list +syn keyword xsFunction Perl_ck_entersub_args_proto syn keyword xsFunction Perl_ck_entersub_args_proto_or_list Perl_ck_warner syn keyword xsFunction Perl_ck_warner_d Perl_ckwarn Perl_ckwarn_d syn keyword xsFunction Perl_clone_params_del Perl_clone_params_new @@ -518,38 +633,39 @@ syn keyword xsFunction Perl_cop_fetch_label Perl_cop_store_label Perl_croak syn keyword xsFunction Perl_croak_no_modify Perl_croak_nocontext syn keyword xsFunction Perl_croak_sv Perl_croak_xs_usage Perl_csighandler syn keyword xsFunction Perl_custom_op_desc Perl_custom_op_name -syn keyword xsFunction Perl_custom_op_register Perl_custom_op_xop -syn keyword xsFunction Perl_cv_clone Perl_cv_const_sv -syn keyword xsFunction Perl_cv_get_call_checker Perl_cv_set_call_checker -syn keyword xsFunction Perl_cv_undef Perl_cx_dump Perl_cx_dup Perl_cxinc -syn keyword xsFunction Perl_deb Perl_deb_nocontext Perl_debop -syn keyword xsFunction Perl_debprofdump Perl_debstack Perl_debstackptrs -syn keyword xsFunction Perl_delimcpy Perl_despatch_signals Perl_die -syn keyword xsFunction Perl_die_nocontext Perl_die_sv Perl_dirp_dup -syn keyword xsFunction Perl_do_aspawn Perl_do_binmode Perl_do_close -syn keyword xsFunction Perl_do_gv_dump Perl_do_gvgv_dump Perl_do_hv_dump -syn keyword xsFunction Perl_do_join Perl_do_magic_dump Perl_do_op_dump -syn keyword xsFunction Perl_do_open9 Perl_do_openn Perl_do_pmop_dump -syn keyword xsFunction Perl_do_spawn Perl_do_spawn_nowait Perl_do_sprintf -syn keyword xsFunction Perl_do_sv_dump Perl_doing_taint Perl_doref -syn keyword xsFunction Perl_dounwind Perl_dowantarray Perl_dump_all -syn keyword xsFunction Perl_dump_eval Perl_dump_fds Perl_dump_form -syn keyword xsFunction Perl_dump_indent Perl_dump_mstats Perl_dump_packsubs -syn keyword xsFunction Perl_dump_sub Perl_dump_vindent Perl_eval_pv -syn keyword xsFunction Perl_eval_sv Perl_fbm_compile Perl_fbm_instr -syn keyword xsFunction Perl_filter_add Perl_filter_del Perl_filter_read -syn keyword xsFunction Perl_find_runcv Perl_find_rundefsv Perl_foldEQ -syn keyword xsFunction Perl_foldEQ_latin1 Perl_foldEQ_locale -syn keyword xsFunction Perl_foldEQ_utf8_flags Perl_form Perl_form_nocontext -syn keyword xsFunction Perl_fp_dup Perl_fprintf_nocontext +syn keyword xsFunction Perl_custom_op_register Perl_cv_clone Perl_cv_const_sv +syn keyword xsFunction Perl_cv_get_call_checker Perl_cv_name +syn keyword xsFunction Perl_cv_set_call_checker +syn keyword xsFunction Perl_cv_set_call_checker_flags Perl_cv_undef +syn keyword xsFunction Perl_cx_dump Perl_cx_dup Perl_cxinc Perl_deb +syn keyword xsFunction Perl_deb_nocontext Perl_debop Perl_debprofdump +syn keyword xsFunction Perl_debstack Perl_debstackptrs Perl_delimcpy +syn keyword xsFunction Perl_despatch_signals Perl_die Perl_die_nocontext +syn keyword xsFunction Perl_die_sv Perl_dirp_dup Perl_do_aspawn +syn keyword xsFunction Perl_do_binmode Perl_do_close Perl_do_gv_dump +syn keyword xsFunction Perl_do_gvgv_dump Perl_do_hv_dump Perl_do_join +syn keyword xsFunction Perl_do_magic_dump Perl_do_op_dump Perl_do_open9 +syn keyword xsFunction Perl_do_openn Perl_do_pmop_dump Perl_do_spawn +syn keyword xsFunction Perl_do_spawn_nowait Perl_do_sprintf Perl_do_sv_dump +syn keyword xsFunction Perl_doing_taint Perl_doref Perl_dounwind +syn keyword xsFunction Perl_dowantarray Perl_dump_all Perl_dump_c_backtrace +syn keyword xsFunction Perl_dump_eval Perl_dump_form Perl_dump_indent +syn keyword xsFunction Perl_dump_mstats Perl_dump_packsubs Perl_dump_sub +syn keyword xsFunction Perl_dump_vindent Perl_eval_pv Perl_eval_sv +syn keyword xsFunction Perl_fbm_compile Perl_fbm_instr Perl_filter_add +syn keyword xsFunction Perl_filter_del Perl_filter_read Perl_find_runcv +syn keyword xsFunction Perl_find_rundefsv Perl_foldEQ Perl_foldEQ_latin1 +syn keyword xsFunction Perl_foldEQ_locale Perl_foldEQ_utf8_flags Perl_form +syn keyword xsFunction Perl_form_nocontext Perl_fp_dup Perl_fprintf_nocontext syn keyword xsFunction Perl_free_global_struct Perl_free_tmps Perl_get_av -syn keyword xsFunction Perl_get_context Perl_get_cv Perl_get_cvn_flags -syn keyword xsFunction Perl_get_hv Perl_get_mstats Perl_get_op_descs -syn keyword xsFunction Perl_get_op_names Perl_get_ppaddr Perl_get_sv -syn keyword xsFunction Perl_get_vtbl Perl_getcwd_sv Perl_gp_dup Perl_gp_free -syn keyword xsFunction Perl_gp_ref Perl_grok_bin Perl_grok_hex -syn keyword xsFunction Perl_grok_number Perl_grok_numeric_radix Perl_grok_oct -syn keyword xsFunction Perl_gv_add_by_type Perl_gv_autoload_pv +syn keyword xsFunction Perl_get_c_backtrace_dump Perl_get_context Perl_get_cv +syn keyword xsFunction Perl_get_cvn_flags Perl_get_hv Perl_get_mstats +syn keyword xsFunction Perl_get_op_descs Perl_get_op_names Perl_get_ppaddr +syn keyword xsFunction Perl_get_sv Perl_get_vtbl Perl_getcwd_sv Perl_gp_dup +syn keyword xsFunction Perl_gp_free Perl_gp_ref Perl_grok_bin Perl_grok_hex +syn keyword xsFunction Perl_grok_infnan Perl_grok_number +syn keyword xsFunction Perl_grok_number_flags Perl_grok_numeric_radix +syn keyword xsFunction Perl_grok_oct Perl_gv_add_by_type Perl_gv_autoload_pv syn keyword xsFunction Perl_gv_autoload_pvn Perl_gv_autoload_sv Perl_gv_check syn keyword xsFunction Perl_gv_const_sv Perl_gv_dump Perl_gv_efullname syn keyword xsFunction Perl_gv_efullname4 Perl_gv_fetchfile @@ -574,72 +690,50 @@ syn keyword xsFunction Perl_hv_eiter_set Perl_hv_fill Perl_hv_free_ent syn keyword xsFunction Perl_hv_iterinit Perl_hv_iterkey Perl_hv_iterkeysv syn keyword xsFunction Perl_hv_iternext_flags Perl_hv_iternextsv syn keyword xsFunction Perl_hv_iterval Perl_hv_ksplit Perl_hv_name_set -syn keyword xsFunction Perl_hv_placeholders_get Perl_hv_placeholders_p -syn keyword xsFunction Perl_hv_placeholders_set Perl_hv_riter_p -syn keyword xsFunction Perl_hv_riter_set Perl_hv_scalar -syn keyword xsFunction Perl_init_global_struct Perl_init_i18nl10n -syn keyword xsFunction Perl_init_i18nl14n Perl_init_stacks Perl_init_tm -syn keyword xsFunction Perl_instr Perl_is_ascii_string Perl_is_lvalue_sub -syn keyword xsFunction Perl_is_uni_alnum Perl_is_uni_alnum_lc -syn keyword xsFunction Perl_is_uni_alpha Perl_is_uni_alpha_lc -syn keyword xsFunction Perl_is_uni_ascii Perl_is_uni_ascii_lc -syn keyword xsFunction Perl_is_uni_cntrl Perl_is_uni_cntrl_lc -syn keyword xsFunction Perl_is_uni_digit Perl_is_uni_digit_lc -syn keyword xsFunction Perl_is_uni_graph Perl_is_uni_graph_lc -syn keyword xsFunction Perl_is_uni_idfirst Perl_is_uni_idfirst_lc -syn keyword xsFunction Perl_is_uni_lower Perl_is_uni_lower_lc -syn keyword xsFunction Perl_is_uni_print Perl_is_uni_print_lc -syn keyword xsFunction Perl_is_uni_punct Perl_is_uni_punct_lc -syn keyword xsFunction Perl_is_uni_space Perl_is_uni_space_lc -syn keyword xsFunction Perl_is_uni_upper Perl_is_uni_upper_lc -syn keyword xsFunction Perl_is_uni_xdigit Perl_is_uni_xdigit_lc -syn keyword xsFunction Perl_is_utf8_alnum Perl_is_utf8_alpha -syn keyword xsFunction Perl_is_utf8_ascii Perl_is_utf8_char_buf -syn keyword xsFunction Perl_is_utf8_cntrl Perl_is_utf8_digit -syn keyword xsFunction Perl_is_utf8_graph Perl_is_utf8_idcont -syn keyword xsFunction Perl_is_utf8_idfirst Perl_is_utf8_lower -syn keyword xsFunction Perl_is_utf8_mark Perl_is_utf8_perl_space -syn keyword xsFunction Perl_is_utf8_perl_word Perl_is_utf8_posix_digit -syn keyword xsFunction Perl_is_utf8_print Perl_is_utf8_punct -syn keyword xsFunction Perl_is_utf8_space Perl_is_utf8_string -syn keyword xsFunction Perl_is_utf8_string_loclen Perl_is_utf8_upper -syn keyword xsFunction Perl_is_utf8_xdigit Perl_is_utf8_xidcont -syn keyword xsFunction Perl_is_utf8_xidfirst Perl_leave_scope -syn keyword xsFunction Perl_lex_bufutf8 Perl_lex_discard_to -syn keyword xsFunction Perl_lex_grow_linestr Perl_lex_next_chunk -syn keyword xsFunction Perl_lex_peek_unichar Perl_lex_read_space -syn keyword xsFunction Perl_lex_read_to Perl_lex_read_unichar Perl_lex_start -syn keyword xsFunction Perl_lex_stuff_pv Perl_lex_stuff_pvn Perl_lex_stuff_sv -syn keyword xsFunction Perl_lex_unstuff Perl_load_module -syn keyword xsFunction Perl_load_module_nocontext Perl_looks_like_number -syn keyword xsFunction Perl_magic_dump Perl_malloc Perl_markstack_grow -syn keyword xsFunction Perl_mess Perl_mess_nocontext Perl_mess_sv Perl_mfree -syn keyword xsFunction Perl_mg_clear Perl_mg_copy Perl_mg_dup Perl_mg_find -syn keyword xsFunction Perl_mg_findext Perl_mg_free Perl_mg_free_type -syn keyword xsFunction Perl_mg_get Perl_mg_length Perl_mg_magical Perl_mg_set -syn keyword xsFunction Perl_mg_size Perl_mini_mktime Perl_moreswitches -syn keyword xsFunction Perl_mro_get_from_name Perl_mro_get_linear_isa -syn keyword xsFunction Perl_mro_get_private_data Perl_mro_method_changed_in -syn keyword xsFunction Perl_mro_register Perl_mro_set_mro -syn keyword xsFunction Perl_mro_set_private_data Perl_my_atof Perl_my_atof2 -syn keyword xsFunction Perl_my_bcopy Perl_my_bzero Perl_my_chsize -syn keyword xsFunction Perl_my_cxt_index Perl_my_cxt_init Perl_my_dirfd -syn keyword xsFunction Perl_my_exit Perl_my_failure_exit Perl_my_fflush_all -syn keyword xsFunction Perl_my_fork Perl_my_htonl Perl_my_memcmp -syn keyword xsFunction Perl_my_memset Perl_my_ntohl Perl_my_pclose -syn keyword xsFunction Perl_my_popen Perl_my_popen_list Perl_my_setenv +syn keyword xsFunction Perl_hv_placeholders_get Perl_hv_placeholders_set +syn keyword xsFunction Perl_hv_rand_set Perl_hv_riter_p Perl_hv_riter_set +syn keyword xsFunction Perl_hv_scalar Perl_init_global_struct +syn keyword xsFunction Perl_init_i18nl10n Perl_init_i18nl14n Perl_init_stacks +syn keyword xsFunction Perl_init_tm Perl_instr Perl_intro_my +syn keyword xsFunction Perl_is_invariant_string Perl_is_lvalue_sub +syn keyword xsFunction Perl_is_utf8_string Perl_is_utf8_string_loclen +syn keyword xsFunction Perl_isinfnan Perl_leave_scope Perl_lex_bufutf8 +syn keyword xsFunction Perl_lex_discard_to Perl_lex_grow_linestr +syn keyword xsFunction Perl_lex_next_chunk Perl_lex_peek_unichar +syn keyword xsFunction Perl_lex_read_space Perl_lex_read_to +syn keyword xsFunction Perl_lex_read_unichar Perl_lex_start Perl_lex_stuff_pv +syn keyword xsFunction Perl_lex_stuff_pvn Perl_lex_stuff_sv Perl_lex_unstuff +syn keyword xsFunction Perl_load_module Perl_load_module_nocontext +syn keyword xsFunction Perl_looks_like_number Perl_magic_dump Perl_malloc +syn keyword xsFunction Perl_markstack_grow Perl_mess Perl_mess_nocontext +syn keyword xsFunction Perl_mess_sv Perl_mfree Perl_mg_clear Perl_mg_copy +syn keyword xsFunction Perl_mg_dup Perl_mg_find Perl_mg_findext Perl_mg_free +syn keyword xsFunction Perl_mg_free_type Perl_mg_get Perl_mg_magical +syn keyword xsFunction Perl_mg_set Perl_mg_size Perl_mini_mktime +syn keyword xsFunction Perl_moreswitches Perl_mro_get_from_name +syn keyword xsFunction Perl_mro_get_linear_isa Perl_mro_get_private_data +syn keyword xsFunction Perl_mro_method_changed_in Perl_mro_register +syn keyword xsFunction Perl_mro_set_mro Perl_mro_set_private_data +syn keyword xsFunction Perl_my_atof Perl_my_atof2 Perl_my_bcopy Perl_my_bzero +syn keyword xsFunction Perl_my_chsize Perl_my_cxt_index Perl_my_cxt_init +syn keyword xsFunction Perl_my_dirfd Perl_my_exit Perl_my_failure_exit +syn keyword xsFunction Perl_my_fflush_all Perl_my_fork Perl_my_memcmp +syn keyword xsFunction Perl_my_memset Perl_my_pclose Perl_my_popen +syn keyword xsFunction Perl_my_popen_list Perl_my_setenv Perl_my_setlocale syn keyword xsFunction Perl_my_snprintf Perl_my_socketpair Perl_my_sprintf -syn keyword xsFunction Perl_my_strftime Perl_my_strlcat Perl_my_strlcpy -syn keyword xsFunction Perl_my_swap Perl_my_vsnprintf Perl_newANONATTRSUB +syn keyword xsFunction Perl_my_strerror Perl_my_strftime Perl_my_strlcat +syn keyword xsFunction Perl_my_strlcpy Perl_my_vsnprintf Perl_newANONATTRSUB syn keyword xsFunction Perl_newANONHASH Perl_newANONLIST Perl_newANONSUB -syn keyword xsFunction Perl_newASSIGNOP Perl_newATTRSUB Perl_newAVREF -syn keyword xsFunction Perl_newBINOP Perl_newCONDOP Perl_newCONSTSUB -syn keyword xsFunction Perl_newCONSTSUB_flags Perl_newCVREF Perl_newFORM +syn keyword xsFunction Perl_newASSIGNOP Perl_newAVREF Perl_newBINOP +syn keyword xsFunction Perl_newCONDOP Perl_newCONSTSUB Perl_newCONSTSUB_flags +syn keyword xsFunction Perl_newCVREF Perl_newDEFSVOP Perl_newFORM syn keyword xsFunction Perl_newFOROP Perl_newGIVENOP Perl_newGVOP syn keyword xsFunction Perl_newGVREF Perl_newGVgen_flags Perl_newHVREF syn keyword xsFunction Perl_newHVhv Perl_newLISTOP Perl_newLOGOP -syn keyword xsFunction Perl_newLOOPEX Perl_newLOOPOP Perl_newMYSUB -syn keyword xsFunction Perl_newNULLLIST Perl_newOP Perl_newPADOP Perl_newPMOP +syn keyword xsFunction Perl_newLOOPEX Perl_newLOOPOP Perl_newMETHOP +syn keyword xsFunction Perl_newMETHOP_named Perl_newMYSUB Perl_newNULLLIST +syn keyword xsFunction Perl_newOP Perl_newPADNAMELIST Perl_newPADNAMEouter +syn keyword xsFunction Perl_newPADNAMEpvn Perl_newPADOP Perl_newPMOP syn keyword xsFunction Perl_newPROG Perl_newPVOP Perl_newRANGE Perl_newRV syn keyword xsFunction Perl_newRV_noinc Perl_newSLICEOP Perl_newSTATEOP syn keyword xsFunction Perl_newSV Perl_newSVOP Perl_newSVREF Perl_newSV_type @@ -647,21 +741,24 @@ syn keyword xsFunction Perl_newSVhek Perl_newSViv Perl_newSVnv Perl_newSVpv syn keyword xsFunction Perl_newSVpv_share Perl_newSVpvf syn keyword xsFunction Perl_newSVpvf_nocontext Perl_newSVpvn syn keyword xsFunction Perl_newSVpvn_flags Perl_newSVpvn_share Perl_newSVrv -syn keyword xsFunction Perl_newSVsv Perl_newSVuv Perl_newUNOP Perl_newWHENOP -syn keyword xsFunction Perl_newWHILEOP Perl_newXS Perl_newXS_flags -syn keyword xsFunction Perl_new_collate Perl_new_ctype Perl_new_numeric -syn keyword xsFunction Perl_new_stackinfo Perl_new_version Perl_ninstr -syn keyword xsFunction Perl_nothreadhook Perl_op_append_elem -syn keyword xsFunction Perl_op_append_list Perl_op_contextualize Perl_op_dump -syn keyword xsFunction Perl_op_free Perl_op_linklist Perl_op_null -syn keyword xsFunction Perl_op_prepend_elem Perl_op_refcnt_lock -syn keyword xsFunction Perl_op_refcnt_unlock Perl_op_scope Perl_pack_cat +syn keyword xsFunction Perl_newSVsv Perl_newSVuv Perl_newUNOP +syn keyword xsFunction Perl_newUNOP_AUX Perl_newWHENOP Perl_newWHILEOP +syn keyword xsFunction Perl_newXS Perl_newXS_flags Perl_new_collate +syn keyword xsFunction Perl_new_ctype Perl_new_numeric Perl_new_stackinfo +syn keyword xsFunction Perl_new_version Perl_ninstr Perl_nothreadhook +syn keyword xsFunction Perl_op_append_elem Perl_op_append_list +syn keyword xsFunction Perl_op_contextualize Perl_op_convert_list +syn keyword xsFunction Perl_op_dump Perl_op_free Perl_op_linklist +syn keyword xsFunction Perl_op_null Perl_op_parent Perl_op_prepend_elem +syn keyword xsFunction Perl_op_refcnt_lock Perl_op_refcnt_unlock +syn keyword xsFunction Perl_op_scope Perl_op_sibling_splice Perl_pack_cat syn keyword xsFunction Perl_packlist Perl_pad_add_anon Perl_pad_add_name_pv syn keyword xsFunction Perl_pad_add_name_pvn Perl_pad_add_name_sv syn keyword xsFunction Perl_pad_alloc Perl_pad_compname_type syn keyword xsFunction Perl_pad_findmy_pv Perl_pad_findmy_pvn syn keyword xsFunction Perl_pad_findmy_sv Perl_pad_new Perl_pad_setsv -syn keyword xsFunction Perl_pad_sv Perl_pad_tidy Perl_parse_arithexpr +syn keyword xsFunction Perl_pad_sv Perl_pad_tidy Perl_padnamelist_fetch +syn keyword xsFunction Perl_padnamelist_store Perl_parse_arithexpr syn keyword xsFunction Perl_parse_barestmt Perl_parse_block syn keyword xsFunction Perl_parse_fullexpr Perl_parse_fullstmt syn keyword xsFunction Perl_parse_label Perl_parse_listexpr @@ -673,7 +770,9 @@ syn keyword xsFunction Perl_ptr_table_fetch Perl_ptr_table_free syn keyword xsFunction Perl_ptr_table_new Perl_ptr_table_split syn keyword xsFunction Perl_ptr_table_store Perl_push_scope Perl_pv_display syn keyword xsFunction Perl_pv_escape Perl_pv_pretty Perl_pv_uni_display -syn keyword xsFunction Perl_re_compile Perl_re_dup_guts Perl_re_intuit_start +syn keyword xsFunction Perl_quadmath_format_needed +syn keyword xsFunction Perl_quadmath_format_single Perl_re_compile +syn keyword xsFunction Perl_re_dup_guts Perl_re_intuit_start syn keyword xsFunction Perl_re_intuit_string Perl_realloc Perl_reentrant_free syn keyword xsFunction Perl_reentrant_init Perl_reentrant_retry syn keyword xsFunction Perl_reentrant_size Perl_reg_named_buff_all @@ -707,37 +806,38 @@ syn keyword xsFunction Perl_savesharedpv Perl_savesharedpvn syn keyword xsFunction Perl_savesharedsvpv Perl_savestack_grow syn keyword xsFunction Perl_savestack_grow_cnt Perl_savesvpv Perl_scan_bin syn keyword xsFunction Perl_scan_hex Perl_scan_num Perl_scan_oct -syn keyword xsFunction Perl_scan_version Perl_scan_vstring Perl_screaminstr -syn keyword xsFunction Perl_seed Perl_set_context Perl_set_numeric_local +syn keyword xsFunction Perl_scan_version Perl_scan_vstring Perl_seed +syn keyword xsFunction Perl_set_context Perl_set_numeric_local syn keyword xsFunction Perl_set_numeric_radix Perl_set_numeric_standard syn keyword xsFunction Perl_setdefout Perl_share_hek Perl_si_dup Perl_sortsv syn keyword xsFunction Perl_sortsv_flags Perl_ss_dup Perl_stack_grow -syn keyword xsFunction Perl_start_subparse Perl_stashpv_hvname_match -syn keyword xsFunction Perl_str_to_version Perl_sv_2bool_flags Perl_sv_2cv -syn keyword xsFunction Perl_sv_2io Perl_sv_2iv_flags Perl_sv_2mortal -syn keyword xsFunction Perl_sv_2nv_flags Perl_sv_2pv_flags Perl_sv_2pvbyte -syn keyword xsFunction Perl_sv_2pvutf8 Perl_sv_2uv_flags Perl_sv_backoff -syn keyword xsFunction Perl_sv_bless Perl_sv_cat_decode Perl_sv_catpv -syn keyword xsFunction Perl_sv_catpv_flags Perl_sv_catpv_mg Perl_sv_catpvf -syn keyword xsFunction Perl_sv_catpvf_mg Perl_sv_catpvf_mg_nocontext -syn keyword xsFunction Perl_sv_catpvf_nocontext Perl_sv_catpvn_flags -syn keyword xsFunction Perl_sv_catsv_flags Perl_sv_chop Perl_sv_clear -syn keyword xsFunction Perl_sv_cmp Perl_sv_cmp_flags Perl_sv_cmp_locale -syn keyword xsFunction Perl_sv_cmp_locale_flags Perl_sv_collxfrm_flags -syn keyword xsFunction Perl_sv_copypv Perl_sv_dec Perl_sv_dec_nomg -syn keyword xsFunction Perl_sv_derived_from Perl_sv_derived_from_pv -syn keyword xsFunction Perl_sv_derived_from_pvn Perl_sv_derived_from_sv -syn keyword xsFunction Perl_sv_destroyable Perl_sv_does Perl_sv_does_pv -syn keyword xsFunction Perl_sv_does_pvn Perl_sv_does_sv Perl_sv_dump -syn keyword xsFunction Perl_sv_dup Perl_sv_dup_inc Perl_sv_eq_flags -syn keyword xsFunction Perl_sv_force_normal_flags Perl_sv_free Perl_sv_gets -syn keyword xsFunction Perl_sv_grow Perl_sv_inc Perl_sv_inc_nomg -syn keyword xsFunction Perl_sv_insert_flags Perl_sv_isa Perl_sv_isobject -syn keyword xsFunction Perl_sv_iv Perl_sv_len Perl_sv_len_utf8 Perl_sv_magic -syn keyword xsFunction Perl_sv_magicext Perl_sv_mortalcopy Perl_sv_newmortal -syn keyword xsFunction Perl_sv_newref Perl_sv_nosharing Perl_sv_nounlocking -syn keyword xsFunction Perl_sv_nv Perl_sv_peek Perl_sv_pos_b2u -syn keyword xsFunction Perl_sv_pos_u2b Perl_sv_pos_u2b_flags Perl_sv_pvbyten +syn keyword xsFunction Perl_start_subparse Perl_str_to_version +syn keyword xsFunction Perl_sv_2bool_flags Perl_sv_2cv Perl_sv_2io +syn keyword xsFunction Perl_sv_2iv_flags Perl_sv_2mortal Perl_sv_2nv_flags +syn keyword xsFunction Perl_sv_2pv_flags Perl_sv_2pvbyte Perl_sv_2pvutf8 +syn keyword xsFunction Perl_sv_2uv_flags Perl_sv_backoff Perl_sv_bless +syn keyword xsFunction Perl_sv_cat_decode Perl_sv_catpv Perl_sv_catpv_flags +syn keyword xsFunction Perl_sv_catpv_mg Perl_sv_catpvf Perl_sv_catpvf_mg +syn keyword xsFunction Perl_sv_catpvf_mg_nocontext Perl_sv_catpvf_nocontext +syn keyword xsFunction Perl_sv_catpvn_flags Perl_sv_catsv_flags Perl_sv_chop +syn keyword xsFunction Perl_sv_clear Perl_sv_cmp Perl_sv_cmp_flags +syn keyword xsFunction Perl_sv_cmp_locale Perl_sv_cmp_locale_flags +syn keyword xsFunction Perl_sv_collxfrm_flags Perl_sv_copypv_flags +syn keyword xsFunction Perl_sv_dec Perl_sv_dec_nomg Perl_sv_derived_from +syn keyword xsFunction Perl_sv_derived_from_pv Perl_sv_derived_from_pvn +syn keyword xsFunction Perl_sv_derived_from_sv Perl_sv_destroyable +syn keyword xsFunction Perl_sv_does Perl_sv_does_pv Perl_sv_does_pvn +syn keyword xsFunction Perl_sv_does_sv Perl_sv_dump Perl_sv_dup +syn keyword xsFunction Perl_sv_dup_inc Perl_sv_eq_flags +syn keyword xsFunction Perl_sv_force_normal_flags Perl_sv_free +syn keyword xsFunction Perl_sv_get_backrefs Perl_sv_gets Perl_sv_grow +syn keyword xsFunction Perl_sv_inc Perl_sv_inc_nomg Perl_sv_insert_flags +syn keyword xsFunction Perl_sv_isa Perl_sv_isobject Perl_sv_iv Perl_sv_len +syn keyword xsFunction Perl_sv_len_utf8 Perl_sv_magic Perl_sv_magicext +syn keyword xsFunction Perl_sv_newmortal Perl_sv_newref Perl_sv_nosharing +syn keyword xsFunction Perl_sv_nounlocking Perl_sv_nv Perl_sv_peek +syn keyword xsFunction Perl_sv_pos_b2u Perl_sv_pos_b2u_flags Perl_sv_pos_u2b +syn keyword xsFunction Perl_sv_pos_u2b_flags Perl_sv_pvbyten syn keyword xsFunction Perl_sv_pvbyten_force Perl_sv_pvn syn keyword xsFunction Perl_sv_pvn_force_flags Perl_sv_pvn_nomg syn keyword xsFunction Perl_sv_pvutf8n Perl_sv_pvutf8n_force @@ -758,67 +858,74 @@ syn keyword xsFunction Perl_sv_usepvn_flags Perl_sv_utf8_decode syn keyword xsFunction Perl_sv_utf8_downgrade Perl_sv_utf8_encode syn keyword xsFunction Perl_sv_utf8_upgrade_flags_grow Perl_sv_uv syn keyword xsFunction Perl_sv_vcatpvf Perl_sv_vcatpvf_mg Perl_sv_vcatpvfn -syn keyword xsFunction Perl_sv_vsetpvf Perl_sv_vsetpvf_mg Perl_sv_vsetpvfn -syn keyword xsFunction Perl_swash_fetch Perl_swash_init Perl_sys_init +syn keyword xsFunction Perl_sv_vcatpvfn_flags Perl_sv_vsetpvf +syn keyword xsFunction Perl_sv_vsetpvf_mg Perl_sv_vsetpvfn Perl_swash_fetch +syn keyword xsFunction Perl_swash_init Perl_sync_locale Perl_sys_init syn keyword xsFunction Perl_sys_init3 Perl_sys_intern_clear syn keyword xsFunction Perl_sys_intern_dup Perl_sys_intern_init Perl_sys_term -syn keyword xsFunction Perl_taint_env Perl_taint_proper Perl_tmps_grow -syn keyword xsFunction Perl_to_uni_lower Perl_to_uni_lower_lc -syn keyword xsFunction Perl_to_uni_title Perl_to_uni_title_lc -syn keyword xsFunction Perl_to_uni_upper Perl_to_uni_upper_lc -syn keyword xsFunction Perl_to_utf8_case Perl_unlnk Perl_unpack_str -syn keyword xsFunction Perl_unpackstring Perl_unsharepvn Perl_upg_version -syn keyword xsFunction Perl_utf16_to_utf8 Perl_utf16_to_utf8_reversed -syn keyword xsFunction Perl_utf8_distance Perl_utf8_hop Perl_utf8_length -syn keyword xsFunction Perl_utf8_to_bytes Perl_utf8_to_uvchr_buf -syn keyword xsFunction Perl_utf8_to_uvuni_buf Perl_utf8n_to_uvchr -syn keyword xsFunction Perl_utf8n_to_uvuni Perl_uvchr_to_utf8 -syn keyword xsFunction Perl_uvchr_to_utf8_flags Perl_uvuni_to_utf8_flags -syn keyword xsFunction Perl_valid_utf8_to_uvchr Perl_valid_utf8_to_uvuni +syn keyword xsFunction Perl_taint_env Perl_taint_proper Perl_to_uni_lower +syn keyword xsFunction Perl_to_uni_title Perl_to_uni_upper Perl_to_utf8_case +syn keyword xsFunction Perl_unlnk Perl_unpack_str Perl_unpackstring +syn keyword xsFunction Perl_unsharepvn Perl_upg_version Perl_utf16_to_utf8 +syn keyword xsFunction Perl_utf16_to_utf8_reversed Perl_utf8_distance +syn keyword xsFunction Perl_utf8_hop Perl_utf8_length Perl_utf8_to_bytes +syn keyword xsFunction Perl_utf8n_to_uvchr Perl_utf8n_to_uvuni +syn keyword xsFunction Perl_uvoffuni_to_utf8_flags Perl_uvuni_to_utf8 +syn keyword xsFunction Perl_uvuni_to_utf8_flags Perl_valid_utf8_to_uvchr syn keyword xsFunction Perl_vcmp Perl_vcroak Perl_vdeb Perl_vform syn keyword xsFunction Perl_vload_module Perl_vmess Perl_vnewSVpvf syn keyword xsFunction Perl_vnormal Perl_vnumify Perl_vstringify Perl_vverify syn keyword xsFunction Perl_vwarn Perl_vwarner Perl_warn Perl_warn_nocontext syn keyword xsFunction Perl_warn_sv Perl_warner Perl_warner_nocontext syn keyword xsFunction Perl_whichsig_pv Perl_whichsig_pvn Perl_whichsig_sv -syn keyword xsFunction Perl_wrap_op_checker Slab_Alloc Slab_Free -syn keyword xsFunction _is_utf8_quotemeta _to_uni_fold_flags -syn keyword xsFunction _to_utf8_fold_flags _to_utf8_lower_flags -syn keyword xsFunction _to_utf8_title_flags _to_utf8_upper_flags amagic_call -syn keyword xsFunction amagic_deref_call any_dup apply_attrs_string -syn keyword xsFunction atfork_lock atfork_unlock av_clear av_delete av_exists -syn keyword xsFunction av_extend av_fetch av_fill av_len av_make av_pop -syn keyword xsFunction av_push av_shift av_store av_undef av_unshift -syn keyword xsFunction block_gimme bytes_cmp_utf8 bytes_from_utf8 -syn keyword xsFunction bytes_to_utf8 call_argv call_atexit call_list -syn keyword xsFunction call_method call_pv call_sv caller_cx cast_i32 cast_iv -syn keyword xsFunction cast_ulong cast_uv ck_entersub_args_list -syn keyword xsFunction ck_entersub_args_proto ck_entersub_args_proto_or_list -syn keyword xsFunction ck_warner ck_warner_d croak croak_no_modify +syn keyword xsFunction Perl_wrap_op_checker _get_regclass_nonbitmap_data +syn keyword xsFunction _is_cur_LC_category_utf8 _is_in_locale_category +syn keyword xsFunction _is_uni_FOO _is_uni_perl_idcont _is_uni_perl_idstart +syn keyword xsFunction _is_utf8_FOO _is_utf8_char_slow _is_utf8_idcont +syn keyword xsFunction _is_utf8_idstart _is_utf8_mark _is_utf8_perl_idcont +syn keyword xsFunction _is_utf8_perl_idstart _is_utf8_xidcont +syn keyword xsFunction _is_utf8_xidstart _new_invlist_C_array +syn keyword xsFunction _to_uni_fold_flags _to_utf8_fold_flags +syn keyword xsFunction _to_utf8_lower_flags _to_utf8_title_flags +syn keyword xsFunction _to_utf8_upper_flags alloccopstash amagic_call +syn keyword xsFunction amagic_deref_call any_dup append_utf8_from_native_byte +syn keyword xsFunction apply_attrs_string atfork_lock atfork_unlock av_clear +syn keyword xsFunction av_delete av_exists av_extend av_fetch av_fill av_len +syn keyword xsFunction av_make av_pop av_push av_shift av_store av_top_index +syn keyword xsFunction av_undef av_unshift block_end block_gimme block_start +syn keyword xsFunction bytes_cmp_utf8 bytes_from_utf8 bytes_to_utf8 call_argv +syn keyword xsFunction call_atexit call_list call_method call_pv call_sv +syn keyword xsFunction caller_cx cast_i32 cast_iv cast_ulong cast_uv +syn keyword xsFunction ck_entersub_args_list ck_entersub_args_proto +syn keyword xsFunction ck_entersub_args_proto_or_list ck_warner ck_warner_d +syn keyword xsFunction croak croak_memory_wrap croak_no_modify syn keyword xsFunction croak_nocontext croak_sv croak_xs_usage csighandler syn keyword xsFunction custom_op_desc custom_op_name cv_clone cv_const_sv -syn keyword xsFunction cv_get_call_checker cv_set_call_checker cv_undef -syn keyword xsFunction cx_dump cx_dup cxinc deb deb_nocontext debop -syn keyword xsFunction debprofdump debstack debstackptrs delimcpy -syn keyword xsFunction despatch_signals die die_nocontext die_sv dirp_dup -syn keyword xsFunction do_aspawn do_binmode do_close do_gv_dump do_gvgv_dump -syn keyword xsFunction do_hv_dump do_join do_magic_dump do_op_dump do_open9 -syn keyword xsFunction do_openn do_pmop_dump do_spawn do_spawn_nowait -syn keyword xsFunction do_sprintf do_sv_dump doing_taint doref dounwind -syn keyword xsFunction dowantarray dump_all dump_eval dump_fds dump_form +syn keyword xsFunction cv_get_call_checker cv_name cv_set_call_checker +syn keyword xsFunction cv_set_call_checker_flags cv_undef cx_dump cx_dup +syn keyword xsFunction cxinc deb deb_nocontext debop debprofdump debstack +syn keyword xsFunction debstackptrs delimcpy despatch_signals die +syn keyword xsFunction die_nocontext die_sv dirp_dup do_aspawn do_binmode +syn keyword xsFunction do_close do_gv_dump do_gvgv_dump do_hv_dump do_join +syn keyword xsFunction do_magic_dump do_op_dump do_open9 do_openn +syn keyword xsFunction do_pmop_dump do_spawn do_spawn_nowait do_sprintf +syn keyword xsFunction do_sv_dump doing_taint doref dounwind dowantarray +syn keyword xsFunction dump_all dump_c_backtrace dump_eval dump_form syn keyword xsFunction dump_indent dump_mstats dump_packsubs dump_sub syn keyword xsFunction dump_vindent eval_pv eval_sv fbm_compile fbm_instr syn keyword xsFunction filter_add filter_del filter_read find_runcv syn keyword xsFunction find_rundefsv foldEQ foldEQ_latin1 foldEQ_locale syn keyword xsFunction foldEQ_utf8_flags form form_nocontext fp_dup syn keyword xsFunction fprintf_nocontext free_global_struct free_tmps get_av -syn keyword xsFunction get_context get_cv get_cvn_flags get_hv get_mstats -syn keyword xsFunction get_op_descs get_op_names get_ppaddr get_sv get_vtbl -syn keyword xsFunction getcwd_sv gp_dup gp_free gp_ref grok_bin grok_hex -syn keyword xsFunction grok_number grok_numeric_radix grok_oct gv_add_by_type -syn keyword xsFunction gv_autoload_pv gv_autoload_pvn gv_autoload_sv gv_check -syn keyword xsFunction gv_const_sv gv_dump gv_efullname gv_efullname4 -syn keyword xsFunction gv_fetchfile gv_fetchfile_flags gv_fetchmeth_pv +syn keyword xsFunction get_c_backtrace_dump get_context get_cv get_cvn_flags +syn keyword xsFunction get_hv get_mstats get_op_descs get_op_names get_ppaddr +syn keyword xsFunction get_sv get_vtbl getcwd_sv gp_dup gp_free gp_ref +syn keyword xsFunction grok_bin grok_hex grok_infnan grok_number +syn keyword xsFunction grok_number_flags grok_numeric_radix grok_oct +syn keyword xsFunction gv_add_by_type gv_autoload_pv gv_autoload_pvn +syn keyword xsFunction gv_autoload_sv gv_check gv_const_sv gv_dump +syn keyword xsFunction gv_efullname gv_efullname4 gv_fetchfile +syn keyword xsFunction gv_fetchfile_flags gv_fetchmeth_pv syn keyword xsFunction gv_fetchmeth_pv_autoload gv_fetchmeth_pvn syn keyword xsFunction gv_fetchmeth_pvn_autoload gv_fetchmeth_sv syn keyword xsFunction gv_fetchmeth_sv_autoload gv_fetchmethod_autoload @@ -831,118 +938,106 @@ syn keyword xsFunction hv_clear hv_clear_placeholders hv_common syn keyword xsFunction hv_common_key_len hv_copy_hints_hv hv_delayfree_ent syn keyword xsFunction hv_free_ent hv_iterinit hv_iterkey hv_iterkeysv syn keyword xsFunction hv_iternext_flags hv_iternextsv hv_iterval hv_ksplit -syn keyword xsFunction hv_name_set hv_scalar init_global_struct init_i18nl10n -syn keyword xsFunction init_i18nl14n init_stacks init_tm instr -syn keyword xsFunction is_ascii_string is_lvalue_sub is_uni_alnum -syn keyword xsFunction is_uni_alnum_lc is_uni_alpha is_uni_alpha_lc -syn keyword xsFunction is_uni_ascii is_uni_ascii_lc is_uni_cntrl -syn keyword xsFunction is_uni_cntrl_lc is_uni_digit is_uni_digit_lc -syn keyword xsFunction is_uni_graph is_uni_graph_lc is_uni_idfirst -syn keyword xsFunction is_uni_idfirst_lc is_uni_lower is_uni_lower_lc -syn keyword xsFunction is_uni_print is_uni_print_lc is_uni_punct -syn keyword xsFunction is_uni_punct_lc is_uni_space is_uni_space_lc -syn keyword xsFunction is_uni_upper is_uni_upper_lc is_uni_xdigit -syn keyword xsFunction is_uni_xdigit_lc is_utf8_alnum is_utf8_alpha -syn keyword xsFunction is_utf8_ascii is_utf8_char_buf is_utf8_cntrl -syn keyword xsFunction is_utf8_digit is_utf8_graph is_utf8_idcont -syn keyword xsFunction is_utf8_idfirst is_utf8_lower is_utf8_mark -syn keyword xsFunction is_utf8_perl_space is_utf8_perl_word -syn keyword xsFunction is_utf8_posix_digit is_utf8_print is_utf8_punct -syn keyword xsFunction is_utf8_space is_utf8_string is_utf8_string_loclen -syn keyword xsFunction is_utf8_upper is_utf8_xdigit is_utf8_xidcont -syn keyword xsFunction is_utf8_xidfirst leave_scope lex_bufutf8 -syn keyword xsFunction lex_discard_to lex_grow_linestr lex_next_chunk -syn keyword xsFunction lex_peek_unichar lex_read_space lex_read_to -syn keyword xsFunction lex_read_unichar lex_start lex_stuff_pv lex_stuff_pvn -syn keyword xsFunction lex_stuff_sv lex_unstuff load_module -syn keyword xsFunction load_module_nocontext looks_like_number magic_dump -syn keyword xsFunction markstack_grow mess mess_nocontext mess_sv mg_clear -syn keyword xsFunction mg_copy mg_dup mg_find mg_findext mg_free mg_free_type -syn keyword xsFunction mg_get mg_length mg_magical mg_set mg_size mini_mktime -syn keyword xsFunction moreswitches mro_get_linear_isa mro_method_changed_in -syn keyword xsFunction my_atof my_atof2 my_bcopy my_bzero my_chsize my_dirfd -syn keyword xsFunction my_exit my_failure_exit my_fflush_all my_fork my_htonl -syn keyword xsFunction my_memcmp my_memset my_ntohl my_pclose my_popen -syn keyword xsFunction my_popen_list my_setenv my_socketpair my_strftime -syn keyword xsFunction my_swap newANONATTRSUB newANONHASH newANONLIST -syn keyword xsFunction newANONSUB newASSIGNOP newATTRSUB newAVREF newBINOP -syn keyword xsFunction newCONDOP newCONSTSUB newCONSTSUB_flags newCVREF -syn keyword xsFunction newFORM newFOROP newGIVENOP newGVOP newGVREF -syn keyword xsFunction newGVgen_flags newHVREF newHVhv newLISTOP newLOGOP -syn keyword xsFunction newLOOPEX newLOOPOP newMYSUB newNULLLIST newOP -syn keyword xsFunction newPADOP newPMOP newPROG newPVOP newRANGE newRV -syn keyword xsFunction newRV_noinc newSLICEOP newSTATEOP newSV newSVOP -syn keyword xsFunction newSVREF newSV_type newSVhek newSViv newSVnv newSVpv +syn keyword xsFunction hv_name_set hv_rand_set hv_scalar init_global_struct +syn keyword xsFunction init_i18nl10n init_i18nl14n init_stacks init_tm instr +syn keyword xsFunction intro_my is_invariant_string is_lvalue_sub +syn keyword xsFunction is_safe_syscall is_utf8_string is_utf8_string_loclen +syn keyword xsFunction isinfnan leave_scope lex_bufutf8 lex_discard_to +syn keyword xsFunction lex_grow_linestr lex_next_chunk lex_peek_unichar +syn keyword xsFunction lex_read_space lex_read_to lex_read_unichar lex_start +syn keyword xsFunction lex_stuff_pv lex_stuff_pvn lex_stuff_sv lex_unstuff +syn keyword xsFunction load_module load_module_nocontext looks_like_number +syn keyword xsFunction magic_dump markstack_grow mess mess_nocontext mess_sv +syn keyword xsFunction mg_clear mg_copy mg_dup mg_find mg_findext mg_free +syn keyword xsFunction mg_free_type mg_get mg_magical mg_set mg_size +syn keyword xsFunction mini_mktime moreswitches mro_get_linear_isa +syn keyword xsFunction mro_method_changed_in my_atof my_atof2 my_bcopy +syn keyword xsFunction my_bzero my_chsize my_dirfd my_exit my_failure_exit +syn keyword xsFunction my_fflush_all my_fork my_memcmp my_memset my_pclose +syn keyword xsFunction my_popen my_popen_list my_setenv my_setlocale +syn keyword xsFunction my_socketpair my_strerror my_strftime newANONATTRSUB +syn keyword xsFunction newANONHASH newANONLIST newANONSUB newASSIGNOP +syn keyword xsFunction newAVREF newBINOP newCONDOP newCONSTSUB +syn keyword xsFunction newCONSTSUB_flags newCVREF newDEFSVOP newFORM newFOROP +syn keyword xsFunction newGIVENOP newGVOP newGVREF newGVgen_flags newHVREF +syn keyword xsFunction newHVhv newLISTOP newLOGOP newLOOPEX newLOOPOP +syn keyword xsFunction newMETHOP newMETHOP_named newMYSUB newNULLLIST newOP +syn keyword xsFunction newPADNAMELIST newPADNAMEouter newPADNAMEpvn newPADOP +syn keyword xsFunction newPMOP newPROG newPVOP newRANGE newRV newRV_noinc +syn keyword xsFunction newSLICEOP newSTATEOP newSV newSVOP newSVREF +syn keyword xsFunction newSV_type newSVhek newSViv newSVnv newSVpv syn keyword xsFunction newSVpv_share newSVpvf newSVpvf_nocontext newSVpvn syn keyword xsFunction newSVpvn_flags newSVpvn_share newSVrv newSVsv newSVuv -syn keyword xsFunction newUNOP newWHENOP newWHILEOP newXS newXS_flags -syn keyword xsFunction new_collate new_ctype new_numeric new_stackinfo -syn keyword xsFunction new_version ninstr nothreadhook op_append_elem -syn keyword xsFunction op_append_list op_contextualize op_dump op_free -syn keyword xsFunction op_linklist op_null op_prepend_elem op_refcnt_lock -syn keyword xsFunction op_refcnt_unlock op_scope pack_cat packlist -syn keyword xsFunction pad_add_anon pad_add_name_pv pad_add_name_pvn +syn keyword xsFunction newUNOP newUNOP_AUX newWHENOP newWHILEOP newXS +syn keyword xsFunction newXS_flags new_collate new_ctype new_numeric +syn keyword xsFunction new_stackinfo new_version ninstr nothreadhook +syn keyword xsFunction op_append_elem op_append_list op_contextualize +syn keyword xsFunction op_convert_list op_dump op_free op_linklist op_null +syn keyword xsFunction op_parent op_prepend_elem op_refcnt_lock +syn keyword xsFunction op_refcnt_unlock op_scope op_sibling_splice pack_cat +syn keyword xsFunction packlist pad_add_anon pad_add_name_pv pad_add_name_pvn syn keyword xsFunction pad_add_name_sv pad_alloc pad_compname_type syn keyword xsFunction pad_findmy_pv pad_findmy_pvn pad_findmy_sv pad_new -syn keyword xsFunction pad_setsv pad_sv pad_tidy parse_arithexpr -syn keyword xsFunction parse_barestmt parse_block parse_fullexpr -syn keyword xsFunction parse_fullstmt parse_label parse_listexpr -syn keyword xsFunction parse_stmtseq parse_termexpr parser_dup pmop_dump -syn keyword xsFunction pop_scope pregcomp pregexec pregfree pregfree2 -syn keyword xsFunction prescan_version printf_nocontext ptr_table_fetch -syn keyword xsFunction ptr_table_free ptr_table_new ptr_table_split -syn keyword xsFunction ptr_table_store push_scope pv_display pv_escape -syn keyword xsFunction pv_pretty pv_uni_display re_compile re_dup_guts -syn keyword xsFunction re_intuit_start re_intuit_string reentrant_free -syn keyword xsFunction reentrant_init reentrant_retry reentrant_size -syn keyword xsFunction reg_named_buff_all reg_named_buff_exists -syn keyword xsFunction reg_named_buff_fetch reg_named_buff_firstkey -syn keyword xsFunction reg_named_buff_nextkey reg_named_buff_scalar -syn keyword xsFunction regclass_swash regdump regdupe_internal regexec_flags -syn keyword xsFunction regfree_internal reginitcolors regnext repeatcpy -syn keyword xsFunction require_pv rninstr rsignal rsignal_state runops_debug -syn keyword xsFunction runops_standard rv2cv_op_cv rvpv_dup safesyscalloc -syn keyword xsFunction safesysfree safesysmalloc safesysrealloc save_I16 -syn keyword xsFunction save_I32 save_I8 save_adelete save_aelem_flags -syn keyword xsFunction save_alloc save_aptr save_ary save_bool save_clearsv -syn keyword xsFunction save_delete save_destructor save_destructor_x -syn keyword xsFunction save_generic_pvref save_generic_svref save_gp -syn keyword xsFunction save_hash save_hdelete save_helem_flags save_hints -syn keyword xsFunction save_hptr save_int save_item save_iv save_list -syn keyword xsFunction save_long save_nogv save_padsv_and_mortalize save_pptr -syn keyword xsFunction save_pushi32ptr save_pushptr save_pushptrptr -syn keyword xsFunction save_re_context save_scalar save_set_svflags -syn keyword xsFunction save_shared_pvref save_sptr save_svref save_vptr -syn keyword xsFunction savepv savepvn savesharedpv savesharedpvn -syn keyword xsFunction savesharedsvpv savestack_grow savestack_grow_cnt -syn keyword xsFunction savesvpv scan_bin scan_hex scan_num scan_oct -syn keyword xsFunction scan_version scan_vstring screaminstr seed set_context -syn keyword xsFunction set_numeric_local set_numeric_radix +syn keyword xsFunction pad_setsv pad_sv pad_tidy padnamelist_fetch +syn keyword xsFunction padnamelist_store parse_arithexpr parse_barestmt +syn keyword xsFunction parse_block parse_fullexpr parse_fullstmt parse_label +syn keyword xsFunction parse_listexpr parse_stmtseq parse_termexpr parser_dup +syn keyword xsFunction pmop_dump pop_scope pregcomp pregexec pregfree +syn keyword xsFunction pregfree2 prescan_version printf_nocontext +syn keyword xsFunction ptr_table_fetch ptr_table_free ptr_table_new +syn keyword xsFunction ptr_table_split ptr_table_store push_scope pv_display +syn keyword xsFunction pv_escape pv_pretty pv_uni_display +syn keyword xsFunction quadmath_format_needed quadmath_format_single +syn keyword xsFunction re_compile re_dup_guts re_intuit_start +syn keyword xsFunction re_intuit_string reentrant_free reentrant_init +syn keyword xsFunction reentrant_retry reentrant_size reg_named_buff_all +syn keyword xsFunction reg_named_buff_exists reg_named_buff_fetch +syn keyword xsFunction reg_named_buff_firstkey reg_named_buff_nextkey +syn keyword xsFunction reg_named_buff_scalar regclass_swash regdump +syn keyword xsFunction regdupe_internal regexec_flags regfree_internal +syn keyword xsFunction reginitcolors regnext repeatcpy require_pv rninstr +syn keyword xsFunction rsignal rsignal_state runops_debug runops_standard +syn keyword xsFunction rv2cv_op_cv rvpv_dup safesyscalloc safesysfree +syn keyword xsFunction safesysmalloc safesysrealloc save_I16 save_I32 save_I8 +syn keyword xsFunction save_adelete save_aelem_flags save_alloc save_aptr +syn keyword xsFunction save_ary save_bool save_clearsv save_delete +syn keyword xsFunction save_destructor save_destructor_x save_generic_pvref +syn keyword xsFunction save_generic_svref save_gp save_hash save_hdelete +syn keyword xsFunction save_helem_flags save_hints save_hptr save_int +syn keyword xsFunction save_item save_iv save_list save_long save_nogv +syn keyword xsFunction save_padsv_and_mortalize save_pptr save_pushi32ptr +syn keyword xsFunction save_pushptr save_pushptrptr save_re_context +syn keyword xsFunction save_scalar save_set_svflags save_shared_pvref +syn keyword xsFunction save_sptr save_svref save_vptr savepv savepvn +syn keyword xsFunction savesharedpv savesharedpvn savesharedsvpv +syn keyword xsFunction savestack_grow savestack_grow_cnt savesvpv scan_bin +syn keyword xsFunction scan_hex scan_num scan_oct scan_version scan_vstring +syn keyword xsFunction seed set_context set_numeric_local set_numeric_radix syn keyword xsFunction set_numeric_standard setdefout share_hek si_dup sortsv syn keyword xsFunction sortsv_flags ss_dup stack_grow start_subparse -syn keyword xsFunction stashpv_hvname_match str_to_version sv_2bool_flags -syn keyword xsFunction sv_2cv sv_2io sv_2iv_flags sv_2mortal sv_2nv_flags -syn keyword xsFunction sv_2pv_flags sv_2pvbyte sv_2pvutf8 sv_2uv_flags -syn keyword xsFunction sv_backoff sv_bless sv_cat_decode sv_catpv -syn keyword xsFunction sv_catpv_flags sv_catpv_mg sv_catpvf sv_catpvf_mg -syn keyword xsFunction sv_catpvf_mg_nocontext sv_catpvf_nocontext -syn keyword xsFunction sv_catpvn_flags sv_catsv_flags sv_chop sv_clear -syn keyword xsFunction sv_cmp_flags sv_cmp_locale_flags sv_collxfrm_flags -syn keyword xsFunction sv_copypv sv_dec sv_dec_nomg sv_derived_from -syn keyword xsFunction sv_derived_from_pv sv_derived_from_pvn +syn keyword xsFunction str_to_version sv_2bool_flags sv_2cv sv_2io +syn keyword xsFunction sv_2iv_flags sv_2mortal sv_2nv_flags sv_2pv_flags +syn keyword xsFunction sv_2pvbyte sv_2pvutf8 sv_2uv_flags sv_backoff sv_bless +syn keyword xsFunction sv_cat_decode sv_catpv sv_catpv_flags sv_catpv_mg +syn keyword xsFunction sv_catpvf sv_catpvf_mg sv_catpvf_mg_nocontext +syn keyword xsFunction sv_catpvf_nocontext sv_catpvn_flags sv_catsv_flags +syn keyword xsFunction sv_chop sv_clear sv_cmp_flags sv_cmp_locale_flags +syn keyword xsFunction sv_collxfrm_flags sv_copypv_flags sv_dec sv_dec_nomg +syn keyword xsFunction sv_derived_from sv_derived_from_pv sv_derived_from_pvn syn keyword xsFunction sv_derived_from_sv sv_destroyable sv_does sv_does_pv syn keyword xsFunction sv_does_pvn sv_does_sv sv_dump sv_dup sv_dup_inc -syn keyword xsFunction sv_eq_flags sv_force_normal_flags sv_free sv_gets -syn keyword xsFunction sv_grow sv_inc sv_inc_nomg sv_insert_flags sv_isa -syn keyword xsFunction sv_isobject sv_iv sv_len sv_len_utf8 sv_magic -syn keyword xsFunction sv_magicext sv_mortalcopy sv_newmortal sv_newref -syn keyword xsFunction sv_nosharing sv_nounlocking sv_nv sv_peek sv_pos_b2u -syn keyword xsFunction sv_pos_u2b sv_pos_u2b_flags sv_pvbyten -syn keyword xsFunction sv_pvbyten_force sv_pvn sv_pvn_force_flags sv_pvn_nomg -syn keyword xsFunction sv_pvutf8n sv_pvutf8n_force sv_recode_to_utf8 -syn keyword xsFunction sv_reftype sv_replace sv_report_used sv_reset -syn keyword xsFunction sv_rvweaken sv_setiv sv_setiv_mg sv_setnv sv_setnv_mg -syn keyword xsFunction sv_setpv sv_setpv_mg sv_setpvf sv_setpvf_mg +syn keyword xsFunction sv_eq_flags sv_force_normal_flags sv_free +syn keyword xsFunction sv_get_backrefs sv_gets sv_grow sv_inc sv_inc_nomg +syn keyword xsFunction sv_insert_flags sv_isa sv_isobject sv_iv sv_len +syn keyword xsFunction sv_len_utf8 sv_magic sv_magicext sv_newmortal +syn keyword xsFunction sv_newref sv_nosharing sv_nounlocking sv_nv sv_peek +syn keyword xsFunction sv_pos_b2u sv_pos_b2u_flags sv_pos_u2b +syn keyword xsFunction sv_pos_u2b_flags sv_pvbyten sv_pvbyten_force sv_pvn +syn keyword xsFunction sv_pvn_force_flags sv_pvn_nomg sv_pvutf8n +syn keyword xsFunction sv_pvutf8n_force sv_recode_to_utf8 sv_reftype +syn keyword xsFunction sv_replace sv_report_used sv_reset sv_rvweaken +syn keyword xsFunction sv_setiv sv_setiv_mg sv_setnv sv_setnv_mg sv_setpv +syn keyword xsFunction sv_setpv_mg sv_setpvf sv_setpvf_mg syn keyword xsFunction sv_setpvf_mg_nocontext sv_setpvf_nocontext sv_setpviv syn keyword xsFunction sv_setpviv_mg sv_setpvn sv_setpvn_mg sv_setref_iv syn keyword xsFunction sv_setref_nv sv_setref_pv sv_setref_pvn sv_setref_uv @@ -951,18 +1046,16 @@ syn keyword xsFunction sv_tainted sv_true sv_uni_display sv_unmagic syn keyword xsFunction sv_unmagicext sv_unref_flags sv_untaint sv_upgrade syn keyword xsFunction sv_usepvn_flags sv_utf8_decode sv_utf8_downgrade syn keyword xsFunction sv_utf8_encode sv_utf8_upgrade_flags_grow sv_uv -syn keyword xsFunction sv_vcatpvf sv_vcatpvf_mg sv_vcatpvfn sv_vsetpvf -syn keyword xsFunction sv_vsetpvf_mg sv_vsetpvfn swash_fetch swash_init -syn keyword xsFunction sys_intern_clear sys_intern_dup sys_intern_init -syn keyword xsFunction taint_env taint_proper tmps_grow to_uni_lower -syn keyword xsFunction to_uni_lower_lc to_uni_title to_uni_title_lc -syn keyword xsFunction to_uni_upper to_uni_upper_lc to_utf8_case unlnk +syn keyword xsFunction sv_vcatpvf sv_vcatpvf_mg sv_vcatpvfn sv_vcatpvfn_flags +syn keyword xsFunction sv_vsetpvf sv_vsetpvf_mg sv_vsetpvfn swash_fetch +syn keyword xsFunction swash_init sync_locale sys_intern_clear sys_intern_dup +syn keyword xsFunction sys_intern_init taint_env taint_proper to_uni_lower +syn keyword xsFunction to_uni_title to_uni_upper to_utf8_case unlnk syn keyword xsFunction unpack_str unpackstring unsharepvn upg_version syn keyword xsFunction utf16_to_utf8 utf16_to_utf8_reversed utf8_distance -syn keyword xsFunction utf8_hop utf8_length utf8_to_bytes utf8_to_uvchr_buf -syn keyword xsFunction utf8_to_uvuni_buf utf8n_to_uvchr utf8n_to_uvuni -syn keyword xsFunction uvchr_to_utf8 uvchr_to_utf8_flags uvuni_to_utf8_flags -syn keyword xsFunction valid_utf8_to_uvchr valid_utf8_to_uvuni vcmp vcroak +syn keyword xsFunction utf8_hop utf8_length utf8_to_bytes utf8n_to_uvchr +syn keyword xsFunction utf8n_to_uvuni uvoffuni_to_utf8_flags uvuni_to_utf8 +syn keyword xsFunction uvuni_to_utf8_flags valid_utf8_to_uvchr vcmp vcroak syn keyword xsFunction vdeb vform vload_module vmess vnewSVpvf vnormal syn keyword xsFunction vnumify vstringify vverify vwarn vwarner warn syn keyword xsFunction warn_nocontext warn_sv warner warner_nocontext @@ -971,149 +1064,165 @@ syn keyword xsVariable MARK MY_CXT ORIGMARK PL_I PL_No PL_Vars PL_VarsPtr syn keyword xsVariable PL_Yes PL_a2e PL_bincompat_options PL_bitcount syn keyword xsVariable PL_block_type PL_bufend PL_bufptr PL_charclass syn keyword xsVariable PL_check PL_copline PL_core_reg_engine PL_cshname -syn keyword xsVariable PL_curforce PL_e2a PL_e2utf PL_endwhite PL_error_count -syn keyword xsVariable PL_expect PL_faketokens PL_fold PL_fold_latin1 -syn keyword xsVariable PL_fold_locale PL_force_link_funcs PL_freq -syn keyword xsVariable PL_global_struct_size PL_hexdigit PL_in_my -syn keyword xsVariable PL_in_my_stash PL_interp_size PL_interp_size_5_16_0 -syn keyword xsVariable PL_last_lop PL_last_lop_op PL_last_uni PL_lasttoke -syn keyword xsVariable PL_latin1_lc PL_lex_allbrackets PL_lex_brackets -syn keyword xsVariable PL_lex_brackstack PL_lex_casemods PL_lex_casestack -syn keyword xsVariable PL_lex_defer PL_lex_dojoin PL_lex_expect -syn keyword xsVariable PL_lex_fakeeof PL_lex_formbrack PL_lex_inpat -syn keyword xsVariable PL_lex_inwhat PL_lex_op PL_lex_repl PL_lex_starts -syn keyword xsVariable PL_lex_state PL_lex_stuff PL_linestart PL_linestr -syn keyword xsVariable PL_magic_data PL_magic_vtable_names PL_memory_wrap -syn keyword xsVariable PL_mod_latin1_uc PL_multi_close PL_multi_end -syn keyword xsVariable PL_multi_open PL_multi_start PL_nexttoke PL_nexttype -syn keyword xsVariable PL_nextval PL_nextwhite PL_no_aelem PL_no_dir_func +syn keyword xsVariable PL_e2a PL_e2utf PL_error_count PL_expect PL_fold +syn keyword xsVariable PL_fold_latin1 PL_fold_locale PL_force_link_funcs +syn keyword xsVariable PL_freq PL_global_struct_size PL_hexdigit PL_in_my +syn keyword xsVariable PL_in_my_stash PL_interp_size PL_interp_size_5_18_0 +syn keyword xsVariable PL_last_lop PL_last_lop_op PL_last_uni PL_latin1_lc +syn keyword xsVariable PL_lex_allbrackets PL_lex_brackets PL_lex_brackstack +syn keyword xsVariable PL_lex_casemods PL_lex_casestack PL_lex_defer +syn keyword xsVariable PL_lex_dojoin PL_lex_fakeeof PL_lex_formbrack +syn keyword xsVariable PL_lex_inpat PL_lex_inwhat PL_lex_op PL_lex_repl +syn keyword xsVariable PL_lex_starts PL_lex_state PL_lex_stuff PL_linestart +syn keyword xsVariable PL_linestr PL_magic_data PL_magic_vtable_names +syn keyword xsVariable PL_memory_wrap PL_mod_latin1_uc PL_multi_close +syn keyword xsVariable PL_multi_end PL_multi_open PL_multi_start PL_nexttoke +syn keyword xsVariable PL_nexttype PL_nextval PL_no_aelem PL_no_dir_func syn keyword xsVariable PL_no_func PL_no_helem_sv PL_no_localize_ref PL_no_mem syn keyword xsVariable PL_no_modify PL_no_myglob PL_no_security syn keyword xsVariable PL_no_sock_func PL_no_symref PL_no_symref_sv syn keyword xsVariable PL_no_usym PL_no_wrongref PL_oldbufptr PL_oldoldbufptr -syn keyword xsVariable PL_op_desc PL_op_name PL_opargs PL_pending_ident +syn keyword xsVariable PL_op_desc PL_op_name PL_op_private_bitdef_ix +syn keyword xsVariable PL_op_private_bitdefs PL_op_private_bitfields +syn keyword xsVariable PL_op_private_labels PL_op_private_valid PL_opargs syn keyword xsVariable PL_phase_names PL_ppaddr PL_preambled -syn keyword xsVariable PL_realtokenstart PL_reg_extflags_name PL_reg_name +syn keyword xsVariable PL_reg_extflags_name PL_reg_intflags_name PL_reg_name syn keyword xsVariable PL_regkind PL_revision PL_rsfp PL_rsfp_filters syn keyword xsVariable PL_runops_dbg PL_runops_std PL_sh_path PL_sig_name -syn keyword xsVariable PL_sig_num PL_simple PL_simple_bitmask PL_skipwhite -syn keyword xsVariable PL_sublex_info PL_subversion PL_thisclose PL_thismad -syn keyword xsVariable PL_thisopen PL_thisstuff PL_thistoken PL_thiswhite -syn keyword xsVariable PL_tokenbuf PL_utf2e PL_utf8skip PL_uudmap PL_uuemap -syn keyword xsVariable PL_valid_types_IVX PL_valid_types_IV_set -syn keyword xsVariable PL_valid_types_NVX PL_valid_types_NV_set -syn keyword xsVariable PL_valid_types_PVX PL_valid_types_RV PL_varies -syn keyword xsVariable PL_varies_bitmask PL_version PL_warn_nl PL_warn_nosemi -syn keyword xsVariable PL_warn_reserved PL_warn_uninit PL_warn_uninit_sv -syn keyword xsVariable RETVAL SP TARG _aMY_CXT _aTHX aMY_CXT aMY_CXT_ aTHX -syn keyword xsVariable aTHX_ items +syn keyword xsVariable PL_sig_num PL_simple PL_simple_bitmask PL_sublex_info +syn keyword xsVariable PL_subversion PL_tokenbuf PL_utf2e PL_utf8skip +syn keyword xsVariable PL_uudmap PL_uuemap PL_valid_types_IVX +syn keyword xsVariable PL_valid_types_IV_set PL_valid_types_NVX +syn keyword xsVariable PL_valid_types_NV_set PL_valid_types_PVX +syn keyword xsVariable PL_valid_types_RV PL_varies PL_varies_bitmask +syn keyword xsVariable PL_version PL_warn_nl PL_warn_nosemi PL_warn_reserved +syn keyword xsVariable PL_warn_uninit PL_warn_uninit_sv RETVAL SP TARG +syn keyword xsVariable _aMY_CXT _aTHX aMY_CXT aMY_CXT_ aTHX aTHX_ items syn keyword xsMacro ABORT ACCEPT ADDOP AHOCORASICK AHOCORASICKC -syn keyword xsMacro ALLOC_THREAD_KEY ALNUM ALNUMA ALNUML ALNUMU AMG_CALLun -syn keyword xsMacro AMG_CALLunary AMGf_assign AMGf_noleft AMGf_noright -syn keyword xsMacro AMGf_numeric AMGf_set AMGf_unary AMGfallNEVER AMGfallNO +syn keyword xsMacro ALLOC_THREAD_KEY AMG_CALLun AMG_CALLunary AMGf_assign +syn keyword xsMacro AMGf_noleft AMGf_noright AMGf_numarg AMGf_numeric +syn keyword xsMacro AMGf_set AMGf_unary AMGf_want_list AMGfallNEVER AMGfallNO syn keyword xsMacro AMGfallYES AMT_AMAGIC AMT_AMAGIC_off AMT_AMAGIC_on -syn keyword xsMacro AMT_OVERLOADED AMT_OVERLOADED_off AMT_OVERLOADED_on -syn keyword xsMacro AMTf_AMAGIC AMTf_OVERLOADED ANDAND ANDOP ANONSUB ANYOF -syn keyword xsMacro ANYOFV ANYOF_ALNUM ANYOF_ALNUMC ANYOF_ALNUML ANYOF_ALPHA -syn keyword xsMacro ANYOF_ASCII ANYOF_BIT ANYOF_BITMAP ANYOF_BITMAP_BYTE -syn keyword xsMacro ANYOF_BITMAP_CLEAR ANYOF_BITMAP_CLEARALL ANYOF_BITMAP_SET +syn keyword xsMacro AMTf_AMAGIC ANDAND ANDOP ANGSTROM_SIGN ANONSUB ANYOF +syn keyword xsMacro ANYOFL ANYOF_ALNUM ANYOF_ALNUML ANYOF_ALPHA +syn keyword xsMacro ANYOF_ALPHANUMERIC ANYOF_ASCII ANYOF_BIT ANYOF_BITMAP +syn keyword xsMacro ANYOF_BITMAP_BYTE ANYOF_BITMAP_CLEAR +syn keyword xsMacro ANYOF_BITMAP_CLEARALL ANYOF_BITMAP_SET syn keyword xsMacro ANYOF_BITMAP_SETALL ANYOF_BITMAP_SIZE ANYOF_BITMAP_TEST -syn keyword xsMacro ANYOF_BITMAP_TESTALLSET ANYOF_BITMAP_ZERO ANYOF_BLANK -syn keyword xsMacro ANYOF_CLASS ANYOF_CLASSBITMAP_SIZE ANYOF_CLASS_BYTE -syn keyword xsMacro ANYOF_CLASS_CLEAR ANYOF_CLASS_SET ANYOF_CLASS_SETALL -syn keyword xsMacro ANYOF_CLASS_SIZE ANYOF_CLASS_SKIP ANYOF_CLASS_TEST +syn keyword xsMacro ANYOF_BITMAP_ZERO ANYOF_BLANK ANYOF_CASED +syn keyword xsMacro ANYOF_CLASS_CLEAR ANYOF_CLASS_OR ANYOF_CLASS_SET +syn keyword xsMacro ANYOF_CLASS_SETALL ANYOF_CLASS_TEST syn keyword xsMacro ANYOF_CLASS_TEST_ANY_SET ANYOF_CLASS_ZERO ANYOF_CNTRL -syn keyword xsMacro ANYOF_DIGIT ANYOF_EOS ANYOF_FLAGS ANYOF_FLAGS_ALL -syn keyword xsMacro ANYOF_FOLD_SHARP_S ANYOF_GRAPH ANYOF_HORIZWS ANYOF_INVERT -syn keyword xsMacro ANYOF_IS_SYNTHETIC ANYOF_LARGE ANYOF_LOCALE -syn keyword xsMacro ANYOF_LOC_NONBITMAP_FOLD ANYOF_LOWER ANYOF_MAX -syn keyword xsMacro ANYOF_NALNUM ANYOF_NALNUMC ANYOF_NALNUML ANYOF_NALPHA -syn keyword xsMacro ANYOF_NASCII ANYOF_NBLANK ANYOF_NCNTRL ANYOF_NDIGIT -syn keyword xsMacro ANYOF_NGRAPH ANYOF_NHORIZWS ANYOF_NLOWER ANYOF_NONBITMAP -syn keyword xsMacro ANYOF_NONBITMAP_EMPTY ANYOF_NONBITMAP_NON_UTF8 -syn keyword xsMacro ANYOF_NON_UTF8_LATIN1_ALL ANYOF_NPRINT ANYOF_NPSXSPC -syn keyword xsMacro ANYOF_NPUNCT ANYOF_NSPACE ANYOF_NSPACEL ANYOF_NUPPER -syn keyword xsMacro ANYOF_NVERTWS ANYOF_NXDIGIT ANYOF_PRINT ANYOF_PSXSPC -syn keyword xsMacro ANYOF_PUNCT ANYOF_SIZE ANYOF_SKIP ANYOF_SPACE -syn keyword xsMacro ANYOF_SPACEL ANYOF_UNICODE_ALL ANYOF_UPPER ANYOF_VERTWS -syn keyword xsMacro ANYOF_XDIGIT ARCHLIB ARCHLIB_EXP ARCHNAME ARG ARG1 -syn keyword xsMacro ARG1_LOC ARG1_SET ARG2 ARG2L ARG2L_LOC ARG2L_SET ARG2_LOC -syn keyword xsMacro ARG2_SET ARGTARG ARG_LOC ARG_SET ARG_VALUE ARG__SET ARROW +syn keyword xsMacro ANYOF_COMMON_FLAGS ANYOF_DIGIT ANYOF_FLAGS +syn keyword xsMacro ANYOF_FLAGS_ALL ANYOF_FOLD_SHARP_S ANYOF_GRAPH +syn keyword xsMacro ANYOF_HAS_NONBITMAP_NON_UTF8_MATCHES +syn keyword xsMacro ANYOF_HAS_UTF8_NONBITMAP_MATCHES ANYOF_HORIZWS +syn keyword xsMacro ANYOF_INVERT ANYOF_LOCALE_FLAGS ANYOF_LOC_FOLD +syn keyword xsMacro ANYOF_LOWER ANYOF_MATCHES_ALL_ABOVE_BITMAP +syn keyword xsMacro ANYOF_MATCHES_ALL_NON_UTF8_NON_ASCII ANYOF_MATCHES_POSIXL +syn keyword xsMacro ANYOF_MAX ANYOF_NALNUM ANYOF_NALNUML ANYOF_NALPHA +syn keyword xsMacro ANYOF_NALPHANUMERIC ANYOF_NASCII ANYOF_NBLANK +syn keyword xsMacro ANYOF_NCASED ANYOF_NCNTRL ANYOF_NDIGIT ANYOF_NGRAPH +syn keyword xsMacro ANYOF_NHORIZWS ANYOF_NLOWER ANYOF_NPRINT ANYOF_NPUNCT +syn keyword xsMacro ANYOF_NSPACE ANYOF_NSPACEL ANYOF_NUPPER ANYOF_NVERTWS +syn keyword xsMacro ANYOF_NWORDCHAR ANYOF_NXDIGIT ANYOF_ONLY_HAS_BITMAP +syn keyword xsMacro ANYOF_POSIXL_AND ANYOF_POSIXL_CLEAR ANYOF_POSIXL_MAX +syn keyword xsMacro ANYOF_POSIXL_OR ANYOF_POSIXL_SET ANYOF_POSIXL_SETALL +syn keyword xsMacro ANYOF_POSIXL_SKIP ANYOF_POSIXL_SSC_TEST_ALL_SET +syn keyword xsMacro ANYOF_POSIXL_SSC_TEST_ANY_SET ANYOF_POSIXL_TEST +syn keyword xsMacro ANYOF_POSIXL_TEST_ALL_SET ANYOF_POSIXL_TEST_ANY_SET +syn keyword xsMacro ANYOF_POSIXL_ZERO ANYOF_PRINT ANYOF_PUNCT ANYOF_SKIP +syn keyword xsMacro ANYOF_SPACE ANYOF_SPACEL ANYOF_UNIPROP ANYOF_UPPER +syn keyword xsMacro ANYOF_VERTWS ANYOF_WARN_SUPER ANYOF_WORDCHAR ANYOF_XDIGIT +syn keyword xsMacro ARCHLIB ARCHLIB_EXP ARCHNAME ARG ARG1 ARG1_LOC ARG1_SET +syn keyword xsMacro ARG2 ARG2L ARG2L_LOC ARG2L_SET ARG2_LOC ARG2_SET ARGTARG +syn keyword xsMacro ARG_LOC ARG_SET ARG_VALUE ARG__SET ARROW syn keyword xsMacro ASCII_MORE_RESTRICT_PAT_MODS ASCII_RESTRICT_PAT_MOD -syn keyword xsMacro ASCII_RESTRICT_PAT_MODS ASCII_TO_NATIVE ASCII_TO_NEED -syn keyword xsMacro ASCTIME_R_PROTO ASSERT_CURPAD_ACTIVE ASSERT_CURPAD_LEGAL -syn keyword xsMacro ASSIGNOP Atof Atol Atoul AvALLOC AvARRAY AvARYLEN AvFILL -syn keyword xsMacro AvFILLp AvMAX AvREAL AvREALISH AvREAL_off AvREAL_on -syn keyword xsMacro AvREAL_only AvREIFY AvREIFY_off AvREIFY_on AvREIFY_only -syn keyword xsMacro BACK BADVERSION BASEOP BHKf_bhk_eval BHKf_bhk_post_end -syn keyword xsMacro BHKf_bhk_pre_end BHKf_bhk_start BIN BIN_EXP BITANDOP -syn keyword xsMacro BITMAP_BYTE BITMAP_TEST BITOROP BIT_BUCKET BIT_DIGITS BOL -syn keyword xsMacro BOUND BOUNDA BOUNDL BOUNDU BRANCH BRANCHJ BRANCH_next -syn keyword xsMacro BRANCH_next_fail BSD_GETPGRP BSD_SETPGRP BSDish BUFSIZ -syn keyword xsMacro BYTEORDER BhkDISABLE BhkENABLE BhkENTRY BhkENTRY_set -syn keyword xsMacro BhkFLAGS Bit BmFLAGS BmPREVIOUS BmRARE BmUSEFUL -syn keyword xsMacro CALLREGCOMP CALLREGCOMP_ENG CALLREGDUPE CALLREGDUPE_PVT -syn keyword xsMacro CALLREGEXEC CALLREGFREE CALLREGFREE_PVT -syn keyword xsMacro CALLREG_INTUIT_START CALLREG_INTUIT_STRING -syn keyword xsMacro CALLREG_NAMED_BUFF_ALL CALLREG_NAMED_BUFF_CLEAR -syn keyword xsMacro CALLREG_NAMED_BUFF_COUNT CALLREG_NAMED_BUFF_DELETE -syn keyword xsMacro CALLREG_NAMED_BUFF_EXISTS CALLREG_NAMED_BUFF_FETCH -syn keyword xsMacro CALLREG_NAMED_BUFF_FIRSTKEY CALLREG_NAMED_BUFF_NEXTKEY -syn keyword xsMacro CALLREG_NAMED_BUFF_SCALAR CALLREG_NAMED_BUFF_STORE -syn keyword xsMacro CALLREG_NUMBUF_FETCH CALLREG_NUMBUF_LENGTH -syn keyword xsMacro CALLREG_NUMBUF_STORE CALLREG_PACKAGE CALLRUNOPS -syn keyword xsMacro CALL_BLOCK_HOOKS CALL_FPTR CANY CAN_COW_FLAGS +syn keyword xsMacro ASCII_RESTRICT_PAT_MODS ASCII_TO_NATIVE ASCTIME_R_PROTO +syn keyword xsMacro ASSERT_CURPAD_ACTIVE ASSERT_CURPAD_LEGAL ASSIGNOP ASSUME +syn keyword xsMacro Atof Atol Atoul AvALLOC AvARRAY AvARYLEN AvFILL AvFILLp +syn keyword xsMacro AvMAX AvREAL AvREALISH AvREAL_off AvREAL_on AvREAL_only +syn keyword xsMacro AvREIFY AvREIFY_off AvREIFY_on AvREIFY_only BADVERSION +syn keyword xsMacro BASEOP BHKf_bhk_eval BHKf_bhk_post_end BHKf_bhk_pre_end +syn keyword xsMacro BHKf_bhk_start BIN BIN_EXP BITANDOP BITMAP_BYTE +syn keyword xsMacro BITMAP_TEST BITOROP BIT_BUCKET BIT_DIGITS BOL +syn keyword xsMacro BOM_UTF8_FIRST_BYTE BOM_UTF8_TAIL BOUND BOUNDA BOUNDL +syn keyword xsMacro BOUNDU BRANCH BRANCHJ BRANCH_next BRANCH_next_fail +syn keyword xsMacro BSD_GETPGRP BSD_SETPGRP BSDish BUFSIZ BYTEORDER +syn keyword xsMacro BhkDISABLE BhkENABLE BhkENTRY BhkENTRY_set BhkFLAGS Bit +syn keyword xsMacro BmFLAGS BmPREVIOUS BmRARE BmUSEFUL CALLREGCOMP +syn keyword xsMacro CALLREGCOMP_ENG CALLREGDUPE CALLREGDUPE_PVT CALLREGEXEC +syn keyword xsMacro CALLREGFREE CALLREGFREE_PVT CALLREG_INTUIT_START +syn keyword xsMacro CALLREG_INTUIT_STRING CALLREG_NAMED_BUFF_ALL +syn keyword xsMacro CALLREG_NAMED_BUFF_CLEAR CALLREG_NAMED_BUFF_COUNT +syn keyword xsMacro CALLREG_NAMED_BUFF_DELETE CALLREG_NAMED_BUFF_EXISTS +syn keyword xsMacro CALLREG_NAMED_BUFF_FETCH CALLREG_NAMED_BUFF_FIRSTKEY +syn keyword xsMacro CALLREG_NAMED_BUFF_NEXTKEY CALLREG_NAMED_BUFF_SCALAR +syn keyword xsMacro CALLREG_NAMED_BUFF_STORE CALLREG_NUMBUF_FETCH +syn keyword xsMacro CALLREG_NUMBUF_LENGTH CALLREG_NUMBUF_STORE +syn keyword xsMacro CALLREG_PACKAGE CALLRUNOPS CALL_BLOCK_HOOKS +syn keyword xsMacro CALL_CHECKER_REQUIRE_GV CALL_FPTR CANY CAN_COW_FLAGS syn keyword xsMacro CAN_COW_MASK CAN_PROTOTYPE CAN_VAPROTO syn keyword xsMacro CASE_STD_PMMOD_FLAGS_PARSE_SET CASTFLAGS CASTNEGFLOAT -syn keyword xsMacro CAT2 CATCH_GET CATCH_SET CHARBITS CHARSET_PAT_MODS -syn keyword xsMacro CHECK_MALLOC_TAINT CHECK_MALLOC_TOO_LATE_FOR -syn keyword xsMacro CHECK_MALLOC_TOO_LATE_FOR_ CLEAR_ARGARRAY CLEAR_ERRSV -syn keyword xsMacro CLONEf_CLONE_HOST CLONEf_COPY_STACKS CLONEf_JOIN_IN -syn keyword xsMacro CLONEf_KEEP_PTR_TABLE CLOSE CLUMP CLUMP_2IV CLUMP_2UV -syn keyword xsMacro COLONATTR COMMIT COMMIT_next COMMIT_next_fail -syn keyword xsMacro COND_BROADCAST COND_DESTROY COND_INIT COND_SIGNAL -syn keyword xsMacro COND_WAIT CONTINUE CONTINUE_PAT_MOD COPHH_KEY_UTF8 -syn keyword xsMacro COP_SEQ_RANGE_HIGH COP_SEQ_RANGE_LOW CPERLarg CPERLarg_ -syn keyword xsMacro CPERLscope CPPLAST CPPMINUS CPPRUN CPPSTDIN CRYPT_R_PROTO -syn keyword xsMacro CSH CTERMID_R_PROTO CTIME_R_PROTO CTYPE256 CURLY CURLYM +syn keyword xsMacro CAT2 CATCH_GET CATCH_SET CHANGE_MULTICALL_FLAGS CHARBITS +syn keyword xsMacro CHARSET_PAT_MODS CHECK_MALLOC_TAINT +syn keyword xsMacro CHECK_MALLOC_TOO_LATE_FOR CHECK_MALLOC_TOO_LATE_FOR_ +syn keyword xsMacro CLEAR_ARGARRAY CLEAR_ERRSV CLONEf_CLONE_HOST +syn keyword xsMacro CLONEf_COPY_STACKS CLONEf_JOIN_IN CLONEf_KEEP_PTR_TABLE +syn keyword xsMacro CLOSE CLUMP CLUMP_2IV CLUMP_2UV COLONATTR +syn keyword xsMacro COMBINING_GRAVE_ACCENT_UTF8 COMMIT COMMIT_next +syn keyword xsMacro COMMIT_next_fail COND_BROADCAST COND_DESTROY COND_INIT +syn keyword xsMacro COND_SIGNAL COND_WAIT CONTINUE CONTINUE_PAT_MOD +syn keyword xsMacro COPHH_KEY_UTF8 COP_SEQMAX_INC COP_SEQ_RANGE_HIGH +syn keyword xsMacro COP_SEQ_RANGE_LOW CPERLarg CPERLarg_ CPERLscope CPPLAST +syn keyword xsMacro CPPMINUS CPPRUN CPPSTDIN CRYPT_R_PROTO CR_NATIVE CSH +syn keyword xsMacro CTERMID_R_PROTO CTIME_R_PROTO CTYPE256 CURLY CURLYM syn keyword xsMacro CURLYM_A CURLYM_A_fail CURLYM_B CURLYM_B_fail CURLYN syn keyword xsMacro CURLYX CURLYX_end CURLYX_end_fail CURLY_B_max syn keyword xsMacro CURLY_B_max_fail CURLY_B_min CURLY_B_min_fail syn keyword xsMacro CURLY_B_min_known CURLY_B_min_known_fail syn keyword xsMacro CURRENT_FEATURE_BUNDLE CURRENT_HINTS CUTGROUP -syn keyword xsMacro CUTGROUP_next CUTGROUP_next_fail CVf_ANON CVf_AUTOLOAD +syn keyword xsMacro CUTGROUP_next CUTGROUP_next_fail CV_NAME_NOTQUAL +syn keyword xsMacro CV_UNDEF_KEEP_NAME CVf_ANON CVf_ANONCONST CVf_AUTOLOAD syn keyword xsMacro CVf_BUILTIN_ATTRS CVf_CLONE CVf_CLONED CVf_CONST -syn keyword xsMacro CVf_CVGV_RC CVf_DYNFILE CVf_ISXSUB CVf_LVALUE CVf_METHOD -syn keyword xsMacro CVf_NODEBUG CVf_UNIQUE CVf_WEAKOUTSIDE CXINC CXTYPEMASK -syn keyword xsMacro CX_CURPAD_SAVE CX_CURPAD_SV CXp_FOR_DEF CXp_HASARGS -syn keyword xsMacro CXp_MULTICALL CXp_ONCE CXp_REAL CXp_TRYBLOCK C_ARRAY_END -syn keyword xsMacro C_ARRAY_LENGTH C_FAC_POSIX CopFILE CopFILEAV CopFILEAVx -syn keyword xsMacro CopFILEGV CopFILEGV_set CopFILESV CopFILE_free -syn keyword xsMacro CopFILE_set CopFILE_setn CopHINTHASH_get CopHINTHASH_set -syn keyword xsMacro CopHINTS_get CopHINTS_set CopLABEL CopLABEL_alloc -syn keyword xsMacro CopLABEL_len CopLABEL_len_flags CopLINE CopLINE_dec -syn keyword xsMacro CopLINE_inc CopLINE_set CopSTASH CopSTASHPV -syn keyword xsMacro CopSTASHPV_set CopSTASH_eq CopSTASH_free CopSTASH_len -syn keyword xsMacro CopSTASH_len_set CopSTASH_ne CopSTASH_set Copy CopyD Ctl -syn keyword xsMacro CvANON CvANON_off CvANON_on CvAUTOLOAD CvAUTOLOAD_off +syn keyword xsMacro CVf_CVGV_RC CVf_DYNFILE CVf_HASEVAL CVf_ISXSUB +syn keyword xsMacro CVf_LEXICAL CVf_LVALUE CVf_METHOD CVf_NAMED CVf_NODEBUG +syn keyword xsMacro CVf_SLABBED CVf_UNIQUE CVf_WEAKOUTSIDE CXINC CXTYPEMASK +syn keyword xsMacro CX_CURPAD_SAVE CX_CURPAD_SV CXp_FOR_DEF CXp_FOR_LVREF +syn keyword xsMacro CXp_HASARGS CXp_MULTICALL CXp_ONCE CXp_REAL CXp_SUB_RE +syn keyword xsMacro CXp_SUB_RE_FAKE CXp_TRYBLOCK C_ARRAY_END C_ARRAY_LENGTH +syn keyword xsMacro C_FAC_POSIX CopFILE CopFILEAV CopFILEAVx CopFILEGV +syn keyword xsMacro CopFILEGV_set CopFILESV CopFILE_free CopFILE_set +syn keyword xsMacro CopFILE_setn CopHINTHASH_get CopHINTHASH_set CopHINTS_get +syn keyword xsMacro CopHINTS_set CopLABEL CopLABEL_alloc CopLABEL_len +syn keyword xsMacro CopLABEL_len_flags CopLINE CopLINE_dec CopLINE_inc +syn keyword xsMacro CopLINE_set CopSTASH CopSTASHPV CopSTASHPV_set +syn keyword xsMacro CopSTASH_eq CopSTASH_ne CopSTASH_set Copy CopyD CowREFCNT +syn keyword xsMacro Ctl CvANON CvANONCONST CvANONCONST_off CvANONCONST_on +syn keyword xsMacro CvANON_off CvANON_on CvAUTOLOAD CvAUTOLOAD_off syn keyword xsMacro CvAUTOLOAD_on CvCLONE CvCLONED CvCLONED_off CvCLONED_on syn keyword xsMacro CvCLONE_off CvCLONE_on CvCONST CvCONST_off CvCONST_on -syn keyword xsMacro CvCVGV_RC CvCVGV_RC_off CvCVGV_RC_on CvDEPTH CvDYNFILE -syn keyword xsMacro CvDYNFILE_off CvDYNFILE_on CvEVAL CvEVAL_off CvEVAL_on -syn keyword xsMacro CvFILE CvFILEGV CvFILE_set_from_cop CvFLAGS CvGV CvGV_set -syn keyword xsMacro CvISXSUB CvISXSUB_off CvISXSUB_on CvLVALUE CvLVALUE_off -syn keyword xsMacro CvLVALUE_on CvMETHOD CvMETHOD_off CvMETHOD_on CvNODEBUG -syn keyword xsMacro CvNODEBUG_off CvNODEBUG_on CvOUTSIDE CvOUTSIDE_SEQ -syn keyword xsMacro CvPADLIST CvPROTO CvPROTOLEN CvROOT CvSPECIAL +syn keyword xsMacro CvCVGV_RC CvCVGV_RC_off CvCVGV_RC_on CvDEPTH +syn keyword xsMacro CvDEPTHunsafe CvDYNFILE CvDYNFILE_off CvDYNFILE_on CvEVAL +syn keyword xsMacro CvEVAL_off CvEVAL_on CvFILE CvFILEGV CvFILE_set_from_cop +syn keyword xsMacro CvFLAGS CvGV CvGV_set CvHASEVAL CvHASEVAL_off +syn keyword xsMacro CvHASEVAL_on CvHASGV CvHSCXT CvISXSUB CvISXSUB_off +syn keyword xsMacro CvISXSUB_on CvLEXICAL CvLEXICAL_off CvLEXICAL_on CvLVALUE +syn keyword xsMacro CvLVALUE_off CvLVALUE_on CvMETHOD CvMETHOD_off +syn keyword xsMacro CvMETHOD_on CvNAMED CvNAMED_off CvNAMED_on CvNAME_HEK_set +syn keyword xsMacro CvNODEBUG CvNODEBUG_off CvNODEBUG_on CvOUTSIDE +syn keyword xsMacro CvOUTSIDE_SEQ CvPADLIST CvPADLIST_set CvPROTO CvPROTOLEN +syn keyword xsMacro CvROOT CvSLABBED CvSLABBED_off CvSLABBED_on CvSPECIAL syn keyword xsMacro CvSPECIAL_off CvSPECIAL_on CvSTART CvSTASH CvSTASH_set syn keyword xsMacro CvUNIQUE CvUNIQUE_off CvUNIQUE_on CvWEAKOUTSIDE syn keyword xsMacro CvWEAKOUTSIDE_off CvWEAKOUTSIDE_on CvXSUB CvXSUBANY syn keyword xsMacro CxFOREACH CxFOREACHDEF CxHASARGS CxITERVAR syn keyword xsMacro CxITERVAR_PADSV CxLABEL CxLABEL_len CxLABEL_len_flags syn keyword xsMacro CxLVAL CxMULTICALL CxOLD_IN_EVAL CxOLD_OP_TYPE CxONCE -syn keyword xsMacro CxPADLOOP CxREALEVAL CxTRYBLOCK CxTYPE CxTYPE_is_LOOP -syn keyword xsMacro DBL_DIG DBL_MAX DBL_MIN DBM_ckFilter DBM_setFilter -syn keyword xsMacro DB_VERSION_MAJOR_CFG DB_VERSION_MINOR_CFG +syn keyword xsMacro CxPADLOOP CxPOPSUB_DONE CxREALEVAL CxTRYBLOCK CxTYPE +syn keyword xsMacro CxTYPE_is_LOOP DBL_DIG DBL_MAX DBL_MIN DBM_ckFilter +syn keyword xsMacro DBM_setFilter DBVARMG_COUNT DBVARMG_SIGNAL DBVARMG_SINGLE +syn keyword xsMacro DBVARMG_TRACE DB_VERSION_MAJOR_CFG DB_VERSION_MINOR_CFG syn keyword xsMacro DB_VERSION_PATCH_CFG DEBUG_A DEBUG_A_FLAG DEBUG_A_TEST syn keyword xsMacro DEBUG_A_TEST_ DEBUG_B DEBUG_BUFFERS_r DEBUG_B_FLAG syn keyword xsMacro DEBUG_B_TEST DEBUG_B_TEST_ DEBUG_C DEBUG_COMPILE_r @@ -1122,13 +1231,15 @@ syn keyword xsMacro DEBUG_DB_RECURSE_FLAG DEBUG_DUMP_r DEBUG_D_FLAG syn keyword xsMacro DEBUG_D_TEST DEBUG_D_TEST_ DEBUG_EXECUTE_r DEBUG_EXTRA_r syn keyword xsMacro DEBUG_FLAGS_r DEBUG_GPOS_r DEBUG_H DEBUG_H_FLAG syn keyword xsMacro DEBUG_H_TEST DEBUG_H_TEST_ DEBUG_INTUIT_r DEBUG_J_FLAG -syn keyword xsMacro DEBUG_J_TEST DEBUG_J_TEST_ DEBUG_M DEBUG_MASK +syn keyword xsMacro DEBUG_J_TEST DEBUG_J_TEST_ DEBUG_L DEBUG_L_FLAG +syn keyword xsMacro DEBUG_L_TEST DEBUG_L_TEST_ DEBUG_M DEBUG_MASK syn keyword xsMacro DEBUG_MATCH_r DEBUG_M_FLAG DEBUG_M_TEST DEBUG_M_TEST_ syn keyword xsMacro DEBUG_OFFSETS_r DEBUG_OPTIMISE_MORE_r DEBUG_OPTIMISE_r syn keyword xsMacro DEBUG_P DEBUG_PARSE_r DEBUG_P_FLAG DEBUG_P_TEST syn keyword xsMacro DEBUG_P_TEST_ DEBUG_Pv DEBUG_Pv_TEST DEBUG_Pv_TEST_ -syn keyword xsMacro DEBUG_R DEBUG_R_FLAG DEBUG_R_TEST DEBUG_R_TEST_ -syn keyword xsMacro DEBUG_SCOPE DEBUG_STACK_r DEBUG_STATE_r DEBUG_T +syn keyword xsMacro DEBUG_R DEBUG_R_FLAG DEBUG_R_TEST DEBUG_R_TEST_ DEBUG_S +syn keyword xsMacro DEBUG_SCOPE DEBUG_STACK_r DEBUG_STATE_r DEBUG_S_FLAG +syn keyword xsMacro DEBUG_S_TEST DEBUG_S_TEST_ DEBUG_T DEBUG_TEST_r syn keyword xsMacro DEBUG_TOP_FLAG DEBUG_TRIE_COMPILE_MORE_r syn keyword xsMacro DEBUG_TRIE_COMPILE_r DEBUG_TRIE_EXECUTE_MORE_r syn keyword xsMacro DEBUG_TRIE_EXECUTE_r DEBUG_TRIE_r DEBUG_T_FLAG @@ -1148,47 +1259,71 @@ syn keyword xsMacro DEBUG_s_FLAG DEBUG_s_TEST DEBUG_s_TEST_ DEBUG_t_FLAG syn keyword xsMacro DEBUG_t_TEST DEBUG_t_TEST_ DEBUG_u DEBUG_u_FLAG syn keyword xsMacro DEBUG_u_TEST DEBUG_u_TEST_ DEBUG_v DEBUG_v_FLAG syn keyword xsMacro DEBUG_v_TEST DEBUG_v_TEST_ DEBUG_x DEBUG_x_FLAG -syn keyword xsMacro DEBUG_x_TEST DEBUG_x_TEST_ DEFAULT DEFAULT_PAT_MOD -syn keyword xsMacro DEFINEP DEFSV DEFSV_set DEPENDS_PAT_MOD DEPENDS_PAT_MODS -syn keyword xsMacro DETACH DIE DIGIT DIGITA DIGITL DIR DM_ARRAY_ISA DM_DELAY -syn keyword xsMacro DM_EGID DM_EUID DM_GID DM_RGID DM_RUID DM_UID DO DOINIT -syn keyword xsMacro DOLSHARP DONT_DECLARE_STD DORDOR DOROP DOSISH DOTDOT -syn keyword xsMacro DOUBLESIZE DO_UTF8 DPTR2FPTR DRAND48_R_PROTO DUP_WARNINGS -syn keyword xsMacro Drand01 ELSE ELSIF EMBEDMYMALLOC END ENDGRENT_R_PROTO -syn keyword xsMacro ENDHOSTENT_R_PROTO ENDLIKE ENDNETENT_R_PROTO -syn keyword xsMacro ENDPROTOENT_R_PROTO ENDPWENT_R_PROTO ENDSERVENT_R_PROTO -syn keyword xsMacro END_EXTERN_C ENTER ENTER_with_name ENTRY_PROBE ENUM_BOOL -syn keyword xsMacro EOF EOL EOS EQOP ERRHV ERRSV EVAL EVAL_AB EVAL_AB_fail -syn keyword xsMacro EVAL_INEVAL EVAL_INREQUIRE EVAL_KEEPERR EVAL_NULL -syn keyword xsMacro EVAL_WARNONLY EXACT EXACTF EXACTFA EXACTFL EXACTFU -syn keyword xsMacro EXACTFU_SS EXACTFU_TRICKYFOLD EXEC_ARGV_CAST EXEC_PAT_MOD +syn keyword xsMacro DEBUG_x_TEST DEBUG_x_TEST_ +syn keyword xsMacro DECLARATION_FOR_LC_NUMERIC_MANIPULATION +syn keyword xsMacro DECLARATION_FOR_STORE_LC_NUMERIC_SET_TO_NEEDED +syn keyword xsMacro DECLARE_STORE_LC_NUMERIC_SET_TO_NEEDED DEFAULT +syn keyword xsMacro DEFAULT_PAT_MOD DEFINEP DEFSV DEFSV_set DEL_NATIVE +syn keyword xsMacro DEPENDS_PAT_MOD DEPENDS_PAT_MODS DETACH DIE DM_ARRAY_ISA +syn keyword xsMacro DM_DELAY DM_EGID DM_EUID DM_GID DM_RGID DM_RUID DM_UID DO +syn keyword xsMacro DOINIT DOLSHARP DONT_DECLARE_STD DORDOR DOROP DOSISH +syn keyword xsMacro DOTDOT DOUBLEKIND DOUBLESIZE DOUBLE_BIG_ENDIAN +syn keyword xsMacro DOUBLE_IS_IEEE_754_128_BIT_BIG_ENDIAN +syn keyword xsMacro DOUBLE_IS_IEEE_754_128_BIT_LITTLE_ENDIAN +syn keyword xsMacro DOUBLE_IS_IEEE_754_32_BIT_BIG_ENDIAN +syn keyword xsMacro DOUBLE_IS_IEEE_754_32_BIT_LITTLE_ENDIAN +syn keyword xsMacro DOUBLE_IS_IEEE_754_64_BIT_BIG_ENDIAN +syn keyword xsMacro DOUBLE_IS_IEEE_754_64_BIT_LITTLE_ENDIAN +syn keyword xsMacro DOUBLE_IS_IEEE_754_64_BIT_MIXED_ENDIAN_BE_LE +syn keyword xsMacro DOUBLE_IS_IEEE_754_64_BIT_MIXED_ENDIAN_LE_BE +syn keyword xsMacro DOUBLE_IS_UNKNOWN_FORMAT DOUBLE_LITTLE_ENDIAN +syn keyword xsMacro DOUBLE_MIX_ENDIAN DO_UTF8 DPTR2FPTR DRAND48_R_PROTO +syn keyword xsMacro DUP_WARNINGS Drand01 ELSE ELSIF EMBEDMYMALLOC END +syn keyword xsMacro ENDGRENT_R_PROTO ENDHOSTENT_R_PROTO ENDLIKE +syn keyword xsMacro ENDNETENT_R_PROTO ENDPROTOENT_R_PROTO ENDPWENT_R_PROTO +syn keyword xsMacro ENDSERVENT_R_PROTO END_EXTERN_C ENTER ENTER_with_name +syn keyword xsMacro ENTRY_PROBE EOF EOL EOS EQOP ERRSV ESC_NATIVE EVAL +syn keyword xsMacro EVAL_AB EVAL_AB_fail EVAL_INEVAL EVAL_INREQUIRE +syn keyword xsMacro EVAL_KEEPERR EVAL_NULL EVAL_RE_REPARSING EVAL_WARNONLY +syn keyword xsMacro EXACT EXACTF EXACTFA EXACTFA_NO_TRIE EXACTFL EXACTFLU8 +syn keyword xsMacro EXACTFU EXACTFU_SS EXACTL EXEC_ARGV_CAST EXEC_PAT_MOD syn keyword xsMacro EXEC_PAT_MODS EXPECT EXT EXTCONST EXTEND EXTEND_MORTAL syn keyword xsMacro EXTERN_C EXTPERLIO EXTRA_SIZE EXTRA_STEP_2ARGS EXT_MGVTBL syn keyword xsMacro EXT_PAT_MODS FAKE_BIT_BUCKET FAKE_DEFAULT_SIGNAL_HANDLERS -syn keyword xsMacro FAKE_PERSISTENT_SIGNAL_HANDLERS FBMcf_TAIL +syn keyword xsMacro FAKE_PERSISTENT_SIGNAL_HANDLERS FALSE FBMcf_TAIL syn keyword xsMacro FBMcf_TAIL_DOLLAR FBMcf_TAIL_DOLLARM FBMcf_TAIL_Z syn keyword xsMacro FBMcf_TAIL_z FBMrf_MULTILINE FCNTL_CAN_LOCK FD_CLR syn keyword xsMacro FD_ISSET FD_SET FD_ZERO FEATURE_ARYBASE_IS_ENABLED -syn keyword xsMacro FEATURE_BUNDLE_510 FEATURE_BUNDLE_511 FEATURE_BUNDLE_515 +syn keyword xsMacro FEATURE_BITWISE_IS_ENABLED FEATURE_BUNDLE_510 +syn keyword xsMacro FEATURE_BUNDLE_511 FEATURE_BUNDLE_515 syn keyword xsMacro FEATURE_BUNDLE_CUSTOM FEATURE_BUNDLE_DEFAULT syn keyword xsMacro FEATURE_EVALBYTES_IS_ENABLED FEATURE_FC_IS_ENABLED -syn keyword xsMacro FEATURE_IS_ENABLED FEATURE_SAY_IS_ENABLED -syn keyword xsMacro FEATURE_STATE_IS_ENABLED FEATURE_SWITCH_IS_ENABLED -syn keyword xsMacro FEATURE_UNICODE_IS_ENABLED FEATURE_UNIEVAL_IS_ENABLED -syn keyword xsMacro FEATURE___SUB___IS_ENABLED FFLUSH_NULL FF_0DECIMAL -syn keyword xsMacro FF_BLANK FF_CHECKCHOP FF_CHECKNL FF_CHOP FF_DECIMAL -syn keyword xsMacro FF_END FF_FETCH FF_HALFSPACE FF_ITEM FF_LINEGLOB -syn keyword xsMacro FF_LINEMARK FF_LINESNGL FF_LITERAL FF_MORE FF_NEWLINE -syn keyword xsMacro FF_SKIP FF_SPACE FILE FILE_base FILE_bufsiz FILE_cnt -syn keyword xsMacro FILE_ptr FILL_ADVANCE_NODE FILL_ADVANCE_NODE_ARG -syn keyword xsMacro FILTER_DATA FILTER_ISREADER FILTER_READ FITS_IN_8_BITS -syn keyword xsMacro FLAGS FLEXFILENAMES FOLDEQ_S1_ALREADY_FOLDED -syn keyword xsMacro FOLDEQ_S2_ALREADY_FOLDED FOLDEQ_UTF8_LOCALE -syn keyword xsMacro FOLDEQ_UTF8_NOMIX_ASCII FOLD_FLAGS_FULL FOLD_FLAGS_LOCALE -syn keyword xsMacro FOR FORMAT FPTR2DPTR FREETMPS FREE_THREAD_KEY FSEEKSIZE -syn keyword xsMacro FUNC FUNC0 FUNC0OP FUNC0SUB FUNC1 FUNCMETH FUNCTION__ -syn keyword xsMacro F_atan2_amg F_cos_amg F_exp_amg F_log_amg F_pow_amg -syn keyword xsMacro F_sin_amg F_sqrt_amg Fflush FmLINES FreeOp Fstat +syn keyword xsMacro FEATURE_IS_ENABLED FEATURE_LEXSUBS_IS_ENABLED +syn keyword xsMacro FEATURE_POSTDEREF_IS_ENABLED +syn keyword xsMacro FEATURE_POSTDEREF_QQ_IS_ENABLED +syn keyword xsMacro FEATURE_REFALIASING_IS_ENABLED FEATURE_SAY_IS_ENABLED +syn keyword xsMacro FEATURE_SIGNATURES_IS_ENABLED FEATURE_STATE_IS_ENABLED +syn keyword xsMacro FEATURE_SWITCH_IS_ENABLED FEATURE_UNICODE_IS_ENABLED +syn keyword xsMacro FEATURE_UNIEVAL_IS_ENABLED FEATURE___SUB___IS_ENABLED +syn keyword xsMacro FFLUSH_NULL FF_0DECIMAL FF_BLANK FF_CHECKCHOP FF_CHECKNL +syn keyword xsMacro FF_CHOP FF_DECIMAL FF_END FF_FETCH FF_HALFSPACE FF_ITEM +syn keyword xsMacro FF_LINEGLOB FF_LINEMARK FF_LINESNGL FF_LITERAL FF_MORE +syn keyword xsMacro FF_NEWLINE FF_SKIP FF_SPACE FILE FILE_base FILE_bufsiz +syn keyword xsMacro FILE_cnt FILE_ptr FILL_ADVANCE_NODE +syn keyword xsMacro FILL_ADVANCE_NODE_2L_ARG FILL_ADVANCE_NODE_ARG +syn keyword xsMacro FILTER_DATA FILTER_ISREADER FILTER_READ +syn keyword xsMacro FIND_RUNCV_level_eq FIND_RUNCV_padid_eq +syn keyword xsMacro FIRST_SURROGATE_UTF8_FIRST_BYTE FITS_IN_8_BITS FLAGS +syn keyword xsMacro FLEXFILENAMES FOLDEQ_LOCALE FOLDEQ_S1_ALREADY_FOLDED +syn keyword xsMacro FOLDEQ_S1_FOLDS_SANE FOLDEQ_S2_ALREADY_FOLDED +syn keyword xsMacro FOLDEQ_S2_FOLDS_SANE FOLDEQ_UTF8_NOMIX_ASCII +syn keyword xsMacro FOLD_FLAGS_FULL FOLD_FLAGS_LOCALE FOLD_FLAGS_NOMIX_ASCII +syn keyword xsMacro FOR FORMAT FORMLBRACK FORMRBRACK FPTR2DPTR FP_PINF +syn keyword xsMacro FP_QNAN FREETMPS FREE_THREAD_KEY FSEEKSIZE FUNC FUNC0 +syn keyword xsMacro FUNC0OP FUNC0SUB FUNC1 FUNCMETH FUNCTION__ F_atan2_amg +syn keyword xsMacro F_cos_amg F_exp_amg F_log_amg F_pow_amg F_sin_amg +syn keyword xsMacro F_sqrt_amg Fflush FmLINES FreeOp Fstat GCB_ENUM_COUNT +syn keyword xsMacro GCC_DIAG_IGNORE GCC_DIAG_PRAGMA GCC_DIAG_RESTORE syn keyword xsMacro GDBMNDBM_H_USES_PROTOTYPES GETATARGET GETGRENT_R_PROTO syn keyword xsMacro GETGRGID_R_PROTO GETGRNAM_R_PROTO GETHOSTBYADDR_R_PROTO syn keyword xsMacro GETHOSTBYNAME_R_PROTO GETHOSTENT_R_PROTO GETLOGIN_R_PROTO @@ -1201,164 +1336,185 @@ syn keyword xsMacro GETSERVENT_R_PROTO GETSPNAM_R_PROTO GETTARGET syn keyword xsMacro GETTARGETSTACKED GET_RE_DEBUG_FLAGS syn keyword xsMacro GET_RE_DEBUG_FLAGS_DECL GIMME GIMME_V GIVEN syn keyword xsMacro GLOBAL_PAT_MOD GMTIME_MAX GMTIME_MIN GMTIME_R -syn keyword xsMacro GMTIME_R_PROTO GOSTART GOSUB GPOS GRAMBARESTMT GRAMBLOCK -syn keyword xsMacro GRAMEXPR GRAMFULLSTMT GRAMPROG GRAMSTMTSEQ +syn keyword xsMacro GMTIME_R_PROTO GOSTART GOSUB GPOS GPf_ALIASED_SV +syn keyword xsMacro GRAMBARESTMT GRAMBLOCK GRAMEXPR GRAMFULLSTMT GRAMPROG +syn keyword xsMacro GRAMSTMTSEQ GREEK_CAPITAL_LETTER_IOTA_UTF8 syn keyword xsMacro GREEK_CAPITAL_LETTER_MU GREEK_SMALL_LETTER_MU -syn keyword xsMacro GROK_NUMERIC_RADIX GROUPP GRPASSWD GV_ADD GV_ADDINEVAL -syn keyword xsMacro GV_ADDMG GV_ADDMULTI GV_ADDWARN GV_AUTOLOAD -syn keyword xsMacro GV_AUTOLOAD_ISMETHOD GV_CROAK GV_NOADD_MASK -syn keyword xsMacro GV_NOADD_NOINIT GV_NOEXPAND GV_NOINIT GV_NOTQUAL -syn keyword xsMacro GV_NO_SVGMAGIC GVf_ASSUMECV GVf_IMPORTED GVf_IMPORTED_AV -syn keyword xsMacro GVf_IMPORTED_CV GVf_IMPORTED_HV GVf_IMPORTED_SV GVf_INTRO -syn keyword xsMacro GVf_IN_PAD GVf_MULTI Gconvert Gid_t_f Gid_t_sign -syn keyword xsMacro Gid_t_size GvASSIGN_GENERATION GvASSIGN_GENERATION_set -syn keyword xsMacro GvASSUMECV GvASSUMECV_off GvASSUMECV_on GvAV GvAVn GvCV -syn keyword xsMacro GvCVGEN GvCV_set GvCVu GvEGV GvEGVx GvENAME GvENAMELEN -syn keyword xsMacro GvENAMEUTF8 GvENAME_HEK GvESTASH GvFILE GvFILEGV -syn keyword xsMacro GvFILE_HEK GvFLAGS GvFORM GvGP GvGP_set GvHV GvHVn -syn keyword xsMacro GvIMPORTED GvIMPORTED_AV GvIMPORTED_AV_off -syn keyword xsMacro GvIMPORTED_AV_on GvIMPORTED_CV GvIMPORTED_CV_off -syn keyword xsMacro GvIMPORTED_CV_on GvIMPORTED_HV GvIMPORTED_HV_off -syn keyword xsMacro GvIMPORTED_HV_on GvIMPORTED_SV GvIMPORTED_SV_off -syn keyword xsMacro GvIMPORTED_SV_on GvIMPORTED_off GvIMPORTED_on GvINTRO -syn keyword xsMacro GvINTRO_off GvINTRO_on GvIN_PAD GvIN_PAD_off GvIN_PAD_on -syn keyword xsMacro GvIO GvIOn GvIOp GvLINE GvMULTI GvMULTI_off GvMULTI_on -syn keyword xsMacro GvNAME GvNAMELEN GvNAMELEN_get GvNAMEUTF8 GvNAME_HEK -syn keyword xsMacro GvNAME_get GvREFCNT GvSTASH GvSV GvSVn GvXPVGV Gv_AMG +syn keyword xsMacro GREEK_SMALL_LETTER_MU_UTF8 GROK_NUMERIC_RADIX GROUPP +syn keyword xsMacro GRPASSWD GV_ADD GV_ADDMG GV_ADDMULTI GV_ADDWARN +syn keyword xsMacro GV_AUTOLOAD GV_AUTOLOAD_ISMETHOD GV_CACHE_ONLY GV_CROAK +syn keyword xsMacro GV_NOADD_MASK GV_NOADD_NOINIT GV_NOEXPAND GV_NOINIT +syn keyword xsMacro GV_NOTQUAL GV_NO_SVGMAGIC GV_SUPER GVf_ASSUMECV +syn keyword xsMacro GVf_IMPORTED GVf_IMPORTED_AV GVf_IMPORTED_CV +syn keyword xsMacro GVf_IMPORTED_HV GVf_IMPORTED_SV GVf_INTRO GVf_MULTI +syn keyword xsMacro Gconvert Gid_t_f Gid_t_sign Gid_t_size GvALIASED_SV +syn keyword xsMacro GvALIASED_SV_off GvALIASED_SV_on GvASSIGN_GENERATION +syn keyword xsMacro GvASSIGN_GENERATION_set GvASSUMECV GvASSUMECV_off +syn keyword xsMacro GvASSUMECV_on GvAV GvAVn GvCV GvCVGEN GvCV_set GvCVu +syn keyword xsMacro GvEGV GvEGVx GvENAME GvENAMELEN GvENAMEUTF8 GvENAME_HEK +syn keyword xsMacro GvESTASH GvFILE GvFILEGV GvFILE_HEK GvFILEx GvFLAGS +syn keyword xsMacro GvFORM GvGP GvGPFLAGS GvGP_set GvHV GvHVn GvIMPORTED +syn keyword xsMacro GvIMPORTED_AV GvIMPORTED_AV_off GvIMPORTED_AV_on +syn keyword xsMacro GvIMPORTED_CV GvIMPORTED_CV_off GvIMPORTED_CV_on +syn keyword xsMacro GvIMPORTED_HV GvIMPORTED_HV_off GvIMPORTED_HV_on +syn keyword xsMacro GvIMPORTED_SV GvIMPORTED_SV_off GvIMPORTED_SV_on +syn keyword xsMacro GvIMPORTED_off GvIMPORTED_on GvINTRO GvINTRO_off +syn keyword xsMacro GvINTRO_on GvIN_PAD GvIN_PAD_off GvIN_PAD_on GvIO GvIOn +syn keyword xsMacro GvIOp GvLINE GvMULTI GvMULTI_off GvMULTI_on GvNAME +syn keyword xsMacro GvNAMELEN GvNAMELEN_get GvNAMEUTF8 GvNAME_HEK GvNAME_get +syn keyword xsMacro GvREFCNT GvSTASH GvSV GvSVn GvXPVGV Gv_AMG HANDY_H syn keyword xsMacro HASATTRIBUTE_DEPRECATED HASATTRIBUTE_FORMAT syn keyword xsMacro HASATTRIBUTE_MALLOC HASATTRIBUTE_NONNULL syn keyword xsMacro HASATTRIBUTE_NORETURN HASATTRIBUTE_PURE syn keyword xsMacro HASATTRIBUTE_UNUSED HASATTRIBUTE_WARN_UNUSED_RESULT -syn keyword xsMacro HASCONST HASHBRACK HASVOLATILE HAS_64K_LIMIT HAS_ACCESS -syn keyword xsMacro HAS_ALARM HAS_ATOLL HAS_BCMP HAS_BCOPY HAS_BOOL -syn keyword xsMacro HAS_BUILTIN_CHOOSE_EXPR HAS_BUILTIN_EXPECT HAS_BZERO -syn keyword xsMacro HAS_C99_VARIADIC_MACROS HAS_CHOWN HAS_CHROOT HAS_CLEARENV -syn keyword xsMacro HAS_COPYSIGNL HAS_CRYPT HAS_CTERMID HAS_CUSERID -syn keyword xsMacro HAS_DBL_DIG HAS_DBMINIT_PROTO HAS_DIFFTIME HAS_DIRFD -syn keyword xsMacro HAS_DLERROR HAS_DRAND48_PROTO HAS_DUP2 HAS_EACCESS -syn keyword xsMacro HAS_ENDGRENT HAS_ENDHOSTENT HAS_ENDNETENT HAS_ENDPROTOENT -syn keyword xsMacro HAS_ENDPWENT HAS_ENDSERVENT HAS_FAST_STDIO HAS_FCHDIR -syn keyword xsMacro HAS_FCHMOD HAS_FCHOWN HAS_FCNTL HAS_FD_SET HAS_FGETPOS -syn keyword xsMacro HAS_FINITE HAS_FINITEL HAS_FLOCK HAS_FLOCK_PROTO HAS_FORK -syn keyword xsMacro HAS_FPATHCONF HAS_FREXPL HAS_FSEEKO HAS_FSETPOS -syn keyword xsMacro HAS_FSTATFS HAS_FSTATVFS HAS_FSYNC HAS_FTELLO HAS_FUTIMES -syn keyword xsMacro HAS_GETADDRINFO HAS_GETCWD HAS_GETGRENT HAS_GETGROUPS -syn keyword xsMacro HAS_GETHOSTBYADDR HAS_GETHOSTBYNAME HAS_GETHOSTENT -syn keyword xsMacro HAS_GETHOSTNAME HAS_GETHOST_PROTOS HAS_GETITIMER -syn keyword xsMacro HAS_GETLOGIN HAS_GETMNTENT HAS_GETNAMEINFO -syn keyword xsMacro HAS_GETNETBYADDR HAS_GETNETBYNAME HAS_GETNETENT -syn keyword xsMacro HAS_GETNET_PROTOS HAS_GETPAGESIZE HAS_GETPGID HAS_GETPGRP -syn keyword xsMacro HAS_GETPPID HAS_GETPRIORITY HAS_GETPROTOBYNAME -syn keyword xsMacro HAS_GETPROTOBYNUMBER HAS_GETPROTOENT HAS_GETPROTO_PROTOS -syn keyword xsMacro HAS_GETPWENT HAS_GETSERVBYNAME HAS_GETSERVBYPORT -syn keyword xsMacro HAS_GETSERVENT HAS_GETSERV_PROTOS HAS_GETSPNAM -syn keyword xsMacro HAS_GETTIMEOFDAY HAS_GNULIBC HAS_GROUP HAS_HASMNTOPT -syn keyword xsMacro HAS_HTOVL HAS_HTOVS HAS_ILOGBL HAS_INETNTOP HAS_INETPTON +syn keyword xsMacro HASCONST HASHBRACK HASVOLATILE HAS_ACCESS HAS_ACOSH +syn keyword xsMacro HAS_ALARM HAS_ASINH HAS_ATANH HAS_ATOLL HAS_BACKTRACE +syn keyword xsMacro HAS_BCMP HAS_BCOPY HAS_BOOL HAS_BUILTIN_CHOOSE_EXPR +syn keyword xsMacro HAS_BUILTIN_EXPECT HAS_BZERO HAS_C99 +syn keyword xsMacro HAS_C99_VARIADIC_MACROS HAS_CBRT HAS_CHOWN HAS_CHROOT +syn keyword xsMacro HAS_CLEARENV HAS_COPYSIGN HAS_COPYSIGNL HAS_CRYPT +syn keyword xsMacro HAS_CTERMID HAS_CUSERID HAS_DBL_DIG HAS_DBMINIT_PROTO +syn keyword xsMacro HAS_DIFFTIME HAS_DIRFD HAS_DLADDR HAS_DLERROR +syn keyword xsMacro HAS_DRAND48_PROTO HAS_DUP2 HAS_EACCESS HAS_ENDGRENT +syn keyword xsMacro HAS_ENDHOSTENT HAS_ENDNETENT HAS_ENDPROTOENT HAS_ENDPWENT +syn keyword xsMacro HAS_ENDSERVENT HAS_ERF HAS_ERFC HAS_EXP2 HAS_EXPM1 +syn keyword xsMacro HAS_FCHDIR HAS_FCHMOD HAS_FCHOWN HAS_FCNTL HAS_FDIM +syn keyword xsMacro HAS_FD_SET HAS_FEGETROUND HAS_FGETPOS HAS_FINITE +syn keyword xsMacro HAS_FINITEL HAS_FLOCK HAS_FLOCK_PROTO HAS_FMA HAS_FMAX +syn keyword xsMacro HAS_FMIN HAS_FORK HAS_FPATHCONF HAS_FPCLASSIFY HAS_FREXPL +syn keyword xsMacro HAS_FSEEKO HAS_FSETPOS HAS_FSTATFS HAS_FSTATVFS HAS_FSYNC +syn keyword xsMacro HAS_FTELLO HAS_FUTIMES HAS_GETADDRINFO HAS_GETCWD +syn keyword xsMacro HAS_GETGRENT HAS_GETGROUPS HAS_GETHOSTBYADDR +syn keyword xsMacro HAS_GETHOSTBYNAME HAS_GETHOSTENT HAS_GETHOSTNAME +syn keyword xsMacro HAS_GETHOST_PROTOS HAS_GETITIMER HAS_GETLOGIN +syn keyword xsMacro HAS_GETMNTENT HAS_GETNAMEINFO HAS_GETNETBYADDR +syn keyword xsMacro HAS_GETNETBYNAME HAS_GETNETENT HAS_GETNET_PROTOS +syn keyword xsMacro HAS_GETPAGESIZE HAS_GETPGID HAS_GETPGRP HAS_GETPPID +syn keyword xsMacro HAS_GETPRIORITY HAS_GETPROTOBYNAME HAS_GETPROTOBYNUMBER +syn keyword xsMacro HAS_GETPROTOENT HAS_GETPROTO_PROTOS HAS_GETPWENT +syn keyword xsMacro HAS_GETSERVBYNAME HAS_GETSERVBYPORT HAS_GETSERVENT +syn keyword xsMacro HAS_GETSERV_PROTOS HAS_GETSPNAM HAS_GETTIMEOFDAY +syn keyword xsMacro HAS_GNULIBC HAS_GROUP HAS_HASMNTOPT HAS_HTONL HAS_HTONS +syn keyword xsMacro HAS_HYPOT HAS_ILOGB HAS_ILOGBL HAS_INETNTOP HAS_INETPTON syn keyword xsMacro HAS_INET_ATON HAS_INT64_T HAS_IOCTL HAS_IPV6_MREQ -syn keyword xsMacro HAS_ISASCII HAS_ISBLANK HAS_ISINF HAS_ISNAN HAS_ISNANL -syn keyword xsMacro HAS_KILL HAS_KILLPG HAS_LCHOWN HAS_LDBL_DIG HAS_LINK -syn keyword xsMacro HAS_LOCALECONV HAS_LOCKF HAS_LONG_DOUBLE HAS_LONG_LONG +syn keyword xsMacro HAS_IP_MREQ HAS_IP_MREQ_SOURCE HAS_ISASCII HAS_ISBLANK +syn keyword xsMacro HAS_ISFINITE HAS_ISINF HAS_ISINFL HAS_ISNAN HAS_ISNANL +syn keyword xsMacro HAS_ISNORMAL HAS_J0 HAS_J0L HAS_KILL HAS_KILLPG +syn keyword xsMacro HAS_LCHOWN HAS_LC_MONETARY_2008 HAS_LDBL_DIG HAS_LDEXPL +syn keyword xsMacro HAS_LGAMMA HAS_LGAMMA_R HAS_LINK HAS_LLRINT HAS_LLRINTL +syn keyword xsMacro HAS_LLROUND HAS_LLROUNDL HAS_LOCALECONV HAS_LOCKF +syn keyword xsMacro HAS_LOG1P HAS_LOG2 HAS_LOGB HAS_LONG_DOUBLE HAS_LONG_LONG +syn keyword xsMacro HAS_LRINT HAS_LRINTL HAS_LROUND HAS_LROUNDL syn keyword xsMacro HAS_LSEEK_PROTO HAS_LSTAT HAS_MADVISE HAS_MBLEN syn keyword xsMacro HAS_MBSTOWCS HAS_MBTOWC HAS_MEMCHR HAS_MEMCMP HAS_MEMCPY syn keyword xsMacro HAS_MEMMOVE HAS_MEMSET HAS_MKDIR HAS_MKDTEMP HAS_MKFIFO syn keyword xsMacro HAS_MKSTEMP HAS_MKSTEMPS HAS_MKTIME HAS_MMAP HAS_MODFL syn keyword xsMacro HAS_MODFL_PROTO HAS_MPROTECT HAS_MSG HAS_MSG_CTRUNC syn keyword xsMacro HAS_MSG_DONTROUTE HAS_MSG_OOB HAS_MSG_PEEK HAS_MSG_PROXY -syn keyword xsMacro HAS_MSYNC HAS_MUNMAP HAS_NICE HAS_NL_LANGINFO HAS_OPEN3 -syn keyword xsMacro HAS_PASSWD HAS_PATHCONF HAS_PAUSE HAS_PIPE HAS_POLL -syn keyword xsMacro HAS_PRCTL HAS_PRCTL_SET_NAME HAS_PROCSELFEXE +syn keyword xsMacro HAS_MSYNC HAS_MUNMAP HAS_NAN HAS_NEARBYINT HAS_NEXTAFTER +syn keyword xsMacro HAS_NEXTTOWARD HAS_NICE HAS_NL_LANGINFO HAS_NTOHL +syn keyword xsMacro HAS_NTOHS HAS_OPEN3 HAS_PASSWD HAS_PATHCONF HAS_PAUSE +syn keyword xsMacro HAS_PIPE HAS_POLL HAS_PRCTL HAS_PRCTL_SET_NAME +syn keyword xsMacro HAS_PROCSELFEXE HAS_PTHREAD_ATFORK syn keyword xsMacro HAS_PTHREAD_ATTR_SETSCOPE -syn keyword xsMacro HAS_PTHREAD_UNCHECKED_GETSPECIFIC_NP HAS_READDIR -syn keyword xsMacro HAS_READLINK HAS_READV HAS_RECVMSG HAS_RENAME -syn keyword xsMacro HAS_REWINDDIR HAS_RMDIR HAS_SANE_MEMCMP HAS_SBRK_PROTO -syn keyword xsMacro HAS_SCALBNL HAS_SCHED_YIELD HAS_SCM_RIGHTS HAS_SEEKDIR -syn keyword xsMacro HAS_SELECT HAS_SEM HAS_SENDMSG HAS_SETEGID HAS_SETEUID -syn keyword xsMacro HAS_SETGRENT HAS_SETGROUPS HAS_SETHOSTENT HAS_SETITIMER -syn keyword xsMacro HAS_SETLINEBUF HAS_SETLOCALE HAS_SETNETENT HAS_SETPGID -syn keyword xsMacro HAS_SETPGRP HAS_SETPRIORITY HAS_SETPROTOENT HAS_SETPWENT -syn keyword xsMacro HAS_SETREGID HAS_SETRESGID HAS_SETRESUID HAS_SETREUID -syn keyword xsMacro HAS_SETSERVENT HAS_SETSID HAS_SETVBUF HAS_SHM -syn keyword xsMacro HAS_SHMAT_PROTOTYPE HAS_SIGACTION HAS_SIGNBIT -syn keyword xsMacro HAS_SIGPROCMASK HAS_SIGSETJMP HAS_SIN6_SCOPE_ID -syn keyword xsMacro HAS_SNPRINTF HAS_SOCKADDR_IN6 HAS_SOCKATMARK -syn keyword xsMacro HAS_SOCKATMARK_PROTO HAS_SOCKET HAS_SQRTL -syn keyword xsMacro HAS_STATIC_INLINE HAS_STRCHR HAS_STRCOLL HAS_STRFTIME -syn keyword xsMacro HAS_STRTOD HAS_STRTOL HAS_STRTOLD HAS_STRTOLL HAS_STRTOQ -syn keyword xsMacro HAS_STRTOUL HAS_STRTOULL HAS_STRTOUQ HAS_STRUCT_CMSGHDR +syn keyword xsMacro HAS_PTHREAD_UNCHECKED_GETSPECIFIC_NP HAS_PTHREAD_YIELD +syn keyword xsMacro HAS_PTRDIFF_T HAS_READDIR HAS_READLINK HAS_READV +syn keyword xsMacro HAS_RECVMSG HAS_REGCOMP HAS_REMAINDER HAS_REMQUO +syn keyword xsMacro HAS_RENAME HAS_REWINDDIR HAS_RINT HAS_RMDIR HAS_ROUND +syn keyword xsMacro HAS_SANE_MEMCMP HAS_SBRK_PROTO HAS_SCALBN HAS_SCALBNL +syn keyword xsMacro HAS_SCHED_YIELD HAS_SCM_RIGHTS HAS_SEEKDIR HAS_SELECT +syn keyword xsMacro HAS_SEM HAS_SENDMSG HAS_SETEGID HAS_SETEUID HAS_SETGRENT +syn keyword xsMacro HAS_SETGROUPS HAS_SETHOSTENT HAS_SETITIMER HAS_SETLINEBUF +syn keyword xsMacro HAS_SETLOCALE HAS_SETNETENT HAS_SETPGID HAS_SETPGRP +syn keyword xsMacro HAS_SETPRIORITY HAS_SETPROTOENT HAS_SETPWENT HAS_SETREGID +syn keyword xsMacro HAS_SETRESGID HAS_SETRESUID HAS_SETREUID HAS_SETSERVENT +syn keyword xsMacro HAS_SETSID HAS_SETVBUF HAS_SHM HAS_SHMAT_PROTOTYPE +syn keyword xsMacro HAS_SIGACTION HAS_SIGNBIT HAS_SIGPROCMASK HAS_SIGSETJMP +syn keyword xsMacro HAS_SIN6_SCOPE_ID HAS_SKIP_LOCALE_INIT HAS_SNPRINTF +syn keyword xsMacro HAS_SOCKADDR_IN6 HAS_SOCKATMARK HAS_SOCKATMARK_PROTO +syn keyword xsMacro HAS_SOCKET HAS_SQRTL HAS_STAT HAS_STATIC_INLINE +syn keyword xsMacro HAS_STRCHR HAS_STRCOLL HAS_STRFTIME HAS_STRTOD HAS_STRTOL +syn keyword xsMacro HAS_STRTOLD HAS_STRTOLL HAS_STRTOQ HAS_STRTOUL +syn keyword xsMacro HAS_STRTOULL HAS_STRTOUQ HAS_STRUCT_CMSGHDR syn keyword xsMacro HAS_STRUCT_MSGHDR HAS_STRUCT_STATFS syn keyword xsMacro HAS_STRUCT_STATFS_F_FLAGS HAS_STRXFRM HAS_SYMLINK syn keyword xsMacro HAS_SYSCALL HAS_SYSCALL_PROTO HAS_SYSCONF HAS_SYSTEM syn keyword xsMacro HAS_SYS_ERRLIST HAS_TCGETPGRP HAS_TCSETPGRP HAS_TELLDIR -syn keyword xsMacro HAS_TELLDIR_PROTO HAS_TIME HAS_TIMEGM HAS_TIMES -syn keyword xsMacro HAS_TM_TM_GMTOFF HAS_TM_TM_ZONE HAS_TRUNCATE HAS_TZNAME -syn keyword xsMacro HAS_UALARM HAS_UMASK HAS_UNAME HAS_UNSETENV HAS_USLEEP -syn keyword xsMacro HAS_USLEEP_PROTO HAS_USTAT HAS_UTIME HAS_VPRINTF -syn keyword xsMacro HAS_VSNPRINTF HAS_VTOHL HAS_VTOHS HAS_WAIT HAS_WAIT4 -syn keyword xsMacro HAS_WAITPID HAS_WCSTOMBS HAS_WCTOMB HAS_WRITEV -syn keyword xsMacro HAVE_THREAD_INTERN HEK_BASESIZE HEK_FLAGS HEK_HASH -syn keyword xsMacro HEK_KEY HEK_LEN HEK_REHASH HEK_REHASH_on HEK_UTF8 -syn keyword xsMacro HEK_UTF8_off HEK_UTF8_on HEK_WASUTF8 HEK_WASUTF8_off -syn keyword xsMacro HEK_WASUTF8_on HEKf HEKf256 HEKfARG HE_SVSLOT HEf_SVKEY -syn keyword xsMacro HINTS_REFCNT_INIT HINTS_REFCNT_LOCK HINTS_REFCNT_TERM -syn keyword xsMacro HINTS_REFCNT_UNLOCK HINT_BLOCK_SCOPE HINT_BYTES -syn keyword xsMacro HINT_EXPLICIT_STRICT_REFS HINT_EXPLICIT_STRICT_SUBS -syn keyword xsMacro HINT_EXPLICIT_STRICT_VARS HINT_FEATURE_MASK -syn keyword xsMacro HINT_FEATURE_SHIFT HINT_FILETEST_ACCESS HINT_INTEGER -syn keyword xsMacro HINT_LEXICAL_IO_IN HINT_LEXICAL_IO_OUT HINT_LOCALE -syn keyword xsMacro HINT_LOCALE_NOT_CHARS HINT_LOCALIZE_HH HINT_NEW_BINARY -syn keyword xsMacro HINT_NEW_FLOAT HINT_NEW_INTEGER HINT_NEW_RE -syn keyword xsMacro HINT_NEW_STRING HINT_NO_AMAGIC HINT_RE_EVAL HINT_RE_FLAGS -syn keyword xsMacro HINT_RE_TAINT HINT_SORT_MERGESORT HINT_SORT_QUICKSORT -syn keyword xsMacro HINT_SORT_SORT_BITS HINT_SORT_STABLE HINT_STRICT_REFS -syn keyword xsMacro HINT_STRICT_SUBS HINT_STRICT_VARS HINT_UNI_8_BIT -syn keyword xsMacro HINT_UTF8 HORIZWS HV_DELETE HV_DISABLE_UVAR_XKEY +syn keyword xsMacro HAS_TELLDIR_PROTO HAS_TGAMMA HAS_TIME HAS_TIMEGM +syn keyword xsMacro HAS_TIMES HAS_TM_TM_GMTOFF HAS_TM_TM_ZONE HAS_TRUNC +syn keyword xsMacro HAS_TRUNCATE HAS_TRUNCL HAS_TZNAME HAS_UALARM HAS_UMASK +syn keyword xsMacro HAS_UNAME HAS_UNSETENV HAS_USLEEP HAS_USLEEP_PROTO +syn keyword xsMacro HAS_USTAT HAS_UTIME HAS_VPRINTF HAS_VSNPRINTF HAS_WAIT +syn keyword xsMacro HAS_WAIT4 HAS_WAITPID HAS_WCSCMP HAS_WCSTOMBS HAS_WCSXFRM +syn keyword xsMacro HAS_WCTOMB HAS_WRITEV HEK_BASESIZE HEK_FLAGS HEK_HASH +syn keyword xsMacro HEK_KEY HEK_LEN HEK_UTF8 HEK_UTF8_off HEK_UTF8_on +syn keyword xsMacro HEK_WASUTF8 HEK_WASUTF8_off HEK_WASUTF8_on HEKf HEKf256 +syn keyword xsMacro HEKfARG HE_SVSLOT HEf_SVKEY HINTS_REFCNT_INIT +syn keyword xsMacro HINTS_REFCNT_LOCK HINTS_REFCNT_TERM HINTS_REFCNT_UNLOCK +syn keyword xsMacro HINT_BLOCK_SCOPE HINT_BYTES HINT_EXPLICIT_STRICT_REFS +syn keyword xsMacro HINT_EXPLICIT_STRICT_SUBS HINT_EXPLICIT_STRICT_VARS +syn keyword xsMacro HINT_FEATURE_MASK HINT_FEATURE_SHIFT HINT_FILETEST_ACCESS +syn keyword xsMacro HINT_INTEGER HINT_LEXICAL_IO_IN HINT_LEXICAL_IO_OUT +syn keyword xsMacro HINT_LOCALE HINT_LOCALE_PARTIAL HINT_LOCALIZE_HH +syn keyword xsMacro HINT_NEW_BINARY HINT_NEW_FLOAT HINT_NEW_INTEGER +syn keyword xsMacro HINT_NEW_RE HINT_NEW_STRING HINT_NO_AMAGIC HINT_RE_EVAL +syn keyword xsMacro HINT_RE_FLAGS HINT_RE_TAINT HINT_SORT_MERGESORT +syn keyword xsMacro HINT_SORT_QUICKSORT HINT_SORT_SORT_BITS HINT_SORT_STABLE +syn keyword xsMacro HINT_STRICT_REFS HINT_STRICT_SUBS HINT_STRICT_VARS +syn keyword xsMacro HINT_UNI_8_BIT HINT_UTF8 HS_APIVERLEN_MAX HS_CXT +syn keyword xsMacro HS_GETAPIVERLEN HS_GETINTERPSIZE HS_GETXSVERLEN HS_KEY +syn keyword xsMacro HS_KEYp HS_XSVERLEN_MAX HSf_IMP_CXT HSf_NOCHK HSf_POPMARK +syn keyword xsMacro HSf_SETXSUBFN HSm_APIVERLEN HSm_INTRPSIZE HSm_KEY_MATCH +syn keyword xsMacro HSm_XSVERLEN HV_DELETE HV_DISABLE_UVAR_XKEY syn keyword xsMacro HV_FETCH_EMPTY_HE HV_FETCH_ISEXISTS HV_FETCH_ISSTORE syn keyword xsMacro HV_FETCH_JUST_SV HV_FETCH_LVALUE syn keyword xsMacro HV_ITERNEXT_WANTPLACEHOLDERS HV_NAME_SETALL syn keyword xsMacro HVhek_ENABLEHVKFLAGS HVhek_FREEKEY HVhek_KEYCANONICAL -syn keyword xsMacro HVhek_MASK HVhek_PLACEHOLD HVhek_REHASH HVhek_UNSHARED -syn keyword xsMacro HVhek_UTF8 HVhek_WASUTF8 HVrhek_IV HVrhek_PV -syn keyword xsMacro HVrhek_PV_UTF8 HVrhek_UV HVrhek_delete HVrhek_typemask -syn keyword xsMacro HVrhek_undef H_PERL HeHASH HeKEY HeKEY_hek HeKEY_sv -syn keyword xsMacro HeKFLAGS HeKLEN HeKLEN_UTF8 HeKREHASH HeKUTF8 HeKWASUTF8 +syn keyword xsMacro HVhek_MASK HVhek_PLACEHOLD HVhek_UNSHARED HVhek_UTF8 +syn keyword xsMacro HVhek_WASUTF8 HVrhek_IV HVrhek_PV HVrhek_PV_UTF8 +syn keyword xsMacro HVrhek_UV HVrhek_delete HVrhek_typemask HVrhek_undef +syn keyword xsMacro HYPHEN_UTF8 H_EBCDIC_TABLES H_PERL H_REGCHARCLASS +syn keyword xsMacro H_UNICODE_CONSTANTS H_UTF8 HeHASH HeKEY HeKEY_hek +syn keyword xsMacro HeKEY_sv HeKFLAGS HeKLEN HeKLEN_UTF8 HeKUTF8 HeKWASUTF8 syn keyword xsMacro HeNEXT HePV HeSVKEY HeSVKEY_force HeSVKEY_set HeUTF8 -syn keyword xsMacro HeVAL HvARRAY HvAUX HvEITER HvEITER_get HvEITER_set -syn keyword xsMacro HvENAME HvENAMELEN HvENAMELEN_get HvENAMEUTF8 HvENAME_HEK -syn keyword xsMacro HvENAME_HEK_NN HvENAME_get HvFILL HvHASKFLAGS -syn keyword xsMacro HvHASKFLAGS_off HvHASKFLAGS_on HvKEYS HvLAZYDEL -syn keyword xsMacro HvLAZYDEL_off HvLAZYDEL_on HvMAX HvMROMETA HvNAME -syn keyword xsMacro HvNAMELEN HvNAMELEN_get HvNAMEUTF8 HvNAME_HEK +syn keyword xsMacro HeVAL HvAMAGIC HvAMAGIC_off HvAMAGIC_on HvARRAY HvAUX +syn keyword xsMacro HvAUXf_NO_DEREF HvAUXf_SCAN_STASH HvEITER HvEITER_get +syn keyword xsMacro HvEITER_set HvENAME HvENAMELEN HvENAMELEN_get HvENAMEUTF8 +syn keyword xsMacro HvENAME_HEK HvENAME_HEK_NN HvENAME_get HvFILL HvHASKFLAGS +syn keyword xsMacro HvHASKFLAGS_off HvHASKFLAGS_on HvKEYS HvLASTRAND_get +syn keyword xsMacro HvLAZYDEL HvLAZYDEL_off HvLAZYDEL_on HvMAX HvMROMETA +syn keyword xsMacro HvNAME HvNAMELEN HvNAMELEN_get HvNAMEUTF8 HvNAME_HEK syn keyword xsMacro HvNAME_HEK_NN HvNAME_get HvPLACEHOLDERS -syn keyword xsMacro HvPLACEHOLDERS_get HvPLACEHOLDERS_set HvREHASH -syn keyword xsMacro HvREHASH_off HvREHASH_on HvRITER HvRITER_get HvRITER_set -syn keyword xsMacro HvSHAREKEYS HvSHAREKEYS_off HvSHAREKEYS_on HvTOTALKEYS -syn keyword xsMacro HvUSEDKEYS I16SIZE I16TYPE I16_MAX I16_MIN I286 I32SIZE -syn keyword xsMacro I32TYPE I32_MAX I32_MAX_P1 I32_MIN I64SIZE I64TYPE I8SIZE -syn keyword xsMacro I8TYPE I8_TO_NATIVE IF IFMATCH IFMATCH_A IFMATCH_A_fail -syn keyword xsMacro IFTHEN IGNORE_PAT_MOD INIT INIT_THREADS +syn keyword xsMacro HvPLACEHOLDERS_get HvPLACEHOLDERS_set HvRAND_get HvRITER +syn keyword xsMacro HvRITER_get HvRITER_set HvSHAREKEYS HvSHAREKEYS_off +syn keyword xsMacro HvSHAREKEYS_on HvTOTALKEYS HvUSEDKEYS I16SIZE I16TYPE +syn keyword xsMacro I16_MAX I16_MIN I32SIZE I32TYPE I32_MAX I32_MAX_P1 +syn keyword xsMacro I32_MIN I64SIZE I64TYPE I8SIZE I8TYPE I8_TO_NATIVE +syn keyword xsMacro I8_TO_NATIVE_UTF8 IF IFMATCH IFMATCH_A IFMATCH_A_fail +syn keyword xsMacro IFTHEN IGNORE_PAT_MOD ILLEGAL_UTF8_BYTE INIT INIT_THREADS syn keyword xsMacro INIT_TRACK_MEMPOOL INSUBP INT2PTR INT32_MIN INT64_C -syn keyword xsMacro INT64_MIN INTSIZE INT_64_T INT_PAT_MODS -syn keyword xsMacro INVERSION_UNAFFECTED_FLAGS IN_BYTES IN_LOCALE +syn keyword xsMacro INT64_MIN INTSIZE INT_64_T INT_PAT_MODS IN_BYTES +syn keyword xsMacro IN_ENCODING IN_LC IN_LC_ALL_COMPILETIME IN_LC_ALL_RUNTIME +syn keyword xsMacro IN_LC_COMPILETIME IN_LC_PARTIAL_COMPILETIME +syn keyword xsMacro IN_LC_PARTIAL_RUNTIME IN_LC_RUNTIME IN_LOCALE syn keyword xsMacro IN_LOCALE_COMPILETIME IN_LOCALE_RUNTIME syn keyword xsMacro IN_PERL_COMPILETIME IN_PERL_RUNTIME IN_SOME_LOCALE_FORM syn keyword xsMacro IN_SOME_LOCALE_FORM_COMPILETIME -syn keyword xsMacro IN_SOME_LOCALE_FORM_RUNTIME IN_UNI_8_BIT IOCPARM_LEN -syn keyword xsMacro IOf_ARGV IOf_DIDTOP IOf_FAKE_DIRP IOf_FLUSH IOf_NOLINE -syn keyword xsMacro IOf_START IOf_UNTAINT ISHISH IS_ANYOF_TRIE +syn keyword xsMacro IN_SOME_LOCALE_FORM_RUNTIME IN_UNI_8_BIT +syn keyword xsMacro IN_UTF8_CTYPE_LOCALE IOCPARM_LEN IOf_ARGV IOf_DIDTOP +syn keyword xsMacro IOf_FAKE_DIRP IOf_FLUSH IOf_NOLINE IOf_START IOf_UNTAINT +syn keyword xsMacro ISA_VERSION_OBJ IS_ANYOF_TRIE syn keyword xsMacro IS_NUMBER_GREATER_THAN_UV_MAX IS_NUMBER_INFINITY syn keyword xsMacro IS_NUMBER_IN_UV IS_NUMBER_NAN IS_NUMBER_NEG -syn keyword xsMacro IS_NUMBER_NOT_INT IS_NUMERIC_RADIX IS_PADCONST IS_PADGV -syn keyword xsMacro IS_TRIE_AC IS_UTF8_CHAR IS_UTF8_CHAR_1 IS_UTF8_CHAR_2 -syn keyword xsMacro IS_UTF8_CHAR_3 IS_UTF8_CHAR_3a IS_UTF8_CHAR_3b -syn keyword xsMacro IS_UTF8_CHAR_3c IS_UTF8_CHAR_3d IS_UTF8_CHAR_4 -syn keyword xsMacro IS_UTF8_CHAR_4a IS_UTF8_CHAR_4b IS_UTF8_CHAR_4c -syn keyword xsMacro IS_UTF8_CHAR_5 IS_UTF8_CHAR_5a IS_UTF8_CHAR_5b -syn keyword xsMacro IS_UTF8_CHAR_FAST IVSIZE IVTYPE IV_DIG IV_MAX IV_MAX_P1 -syn keyword xsMacro IV_MIN I_32 I_ARPA_INET I_ASSERT I_CRYPT I_DBM I_DIRENT -syn keyword xsMacro I_DLFCN I_FLOAT I_GDBM I_GDBMNDBM I_GRP I_INTTYPES -syn keyword xsMacro I_LANGINFO I_LIMITS I_LOCALE I_MATH I_MNTENT I_NETDB -syn keyword xsMacro I_NETINET_IN I_NETINET_TCP I_POLL I_PTHREAD I_PWD -syn keyword xsMacro I_SHADOW I_STDARG I_STDBOOL I_STDDEF I_STDLIB I_STRING +syn keyword xsMacro IS_NUMBER_NOT_INT IS_NUMBER_TRAILING IS_NUMERIC_RADIX +syn keyword xsMacro IS_PADCONST IS_PADGV IS_SAFE_PATHNAME IS_SAFE_SYSCALL +syn keyword xsMacro IS_TRIE_AC IS_UTF8_CHAR IS_UTF8_CHAR_FAST IVSIZE IVTYPE +syn keyword xsMacro IV_DIG IV_MAX IV_MAX_P1 IV_MIN I_32 I_ARPA_INET I_ASSERT +syn keyword xsMacro I_BFD I_CRYPT I_DBM I_DIRENT I_DLFCN I_EXECINFO I_FENV +syn keyword xsMacro I_FLOAT I_GDBM I_GDBMNDBM I_GRP I_INTTYPES I_LANGINFO +syn keyword xsMacro I_LIMITS I_LOCALE I_MATH I_MNTENT I_NETDB I_NETINET_IN +syn keyword xsMacro I_NETINET_TCP I_POLL I_PTHREAD I_PWD I_QUADMATH I_SHADOW +syn keyword xsMacro I_STDARG I_STDBOOL I_STDDEF I_STDINT I_STDLIB I_STRING syn keyword xsMacro I_SYSLOG I_SYSUIO I_SYSUTSNAME I_SYS_DIR I_SYS_FILE syn keyword xsMacro I_SYS_IOCTL I_SYS_MOUNT I_SYS_PARAM I_SYS_POLL syn keyword xsMacro I_SYS_RESOURCE I_SYS_SELECT I_SYS_STAT I_SYS_STATFS @@ -1372,12 +1528,12 @@ syn keyword xsMacro IoTYPE_NUMERIC IoTYPE_PIPE IoTYPE_RDONLY IoTYPE_RDWR syn keyword xsMacro IoTYPE_SOCKET IoTYPE_STD IoTYPE_WRONLY IsSet syn keyword xsMacro JMPENV_BOOTSTRAP JMPENV_JUMP JMPENV_POP JMPENV_PUSH JOIN syn keyword xsMacro KEEPCOPY_PAT_MOD KEEPCOPY_PAT_MODS KEEPS KEEPS_next -syn keyword xsMacro KEEPS_next_fail KEYWORD_PLUGIN_DECLINE +syn keyword xsMacro KEEPS_next_fail KELVIN_SIGN KEYWORD_PLUGIN_DECLINE syn keyword xsMacro KEYWORD_PLUGIN_EXPR KEYWORD_PLUGIN_STMT KEY_AUTOLOAD -syn keyword xsMacro KEY_BEGIN KEY_CHECK KEY_CORE KEY_DESTROY KEY_END KEY_INIT -syn keyword xsMacro KEY_NULL KEY_UNITCHECK KEY___DATA__ KEY___END__ -syn keyword xsMacro KEY___FILE__ KEY___LINE__ KEY___PACKAGE__ KEY___SUB__ -syn keyword xsMacro KEY_abs KEY_accept KEY_alarm KEY_and KEY_atan2 KEY_bind +syn keyword xsMacro KEY_BEGIN KEY_CHECK KEY_DESTROY KEY_END KEY_INIT KEY_NULL +syn keyword xsMacro KEY_UNITCHECK KEY___DATA__ KEY___END__ KEY___FILE__ +syn keyword xsMacro KEY___LINE__ KEY___PACKAGE__ KEY___SUB__ KEY_abs +syn keyword xsMacro KEY_accept KEY_alarm KEY_and KEY_atan2 KEY_bind syn keyword xsMacro KEY_binmode KEY_bless KEY_break KEY_caller KEY_chdir syn keyword xsMacro KEY_chmod KEY_chomp KEY_chop KEY_chown KEY_chr KEY_chroot syn keyword xsMacro KEY_close KEY_closedir KEY_cmp KEY_connect KEY_continue @@ -1425,125 +1581,177 @@ syn keyword xsMacro KEY_uc KEY_ucfirst KEY_umask KEY_undef KEY_unless syn keyword xsMacro KEY_unlink KEY_unpack KEY_unshift KEY_untie KEY_until syn keyword xsMacro KEY_use KEY_utime KEY_values KEY_vec KEY_wait KEY_waitpid syn keyword xsMacro KEY_wantarray KEY_warn KEY_when KEY_while KEY_write KEY_x -syn keyword xsMacro KEY_xor KEY_y LABEL +syn keyword xsMacro KEY_xor KEY_y LABEL LATIN1_TO_NATIVE syn keyword xsMacro LATIN_CAPITAL_LETTER_A_WITH_RING_ABOVE +syn keyword xsMacro LATIN_CAPITAL_LETTER_A_WITH_RING_ABOVE_NATIVE syn keyword xsMacro LATIN_CAPITAL_LETTER_SHARP_S +syn keyword xsMacro LATIN_CAPITAL_LETTER_SHARP_S_UTF8 syn keyword xsMacro LATIN_CAPITAL_LETTER_Y_WITH_DIAERESIS syn keyword xsMacro LATIN_SMALL_LETTER_A_WITH_RING_ABOVE +syn keyword xsMacro LATIN_SMALL_LETTER_A_WITH_RING_ABOVE_NATIVE +syn keyword xsMacro LATIN_SMALL_LETTER_LONG_S LATIN_SMALL_LETTER_LONG_S_UTF8 syn keyword xsMacro LATIN_SMALL_LETTER_SHARP_S -syn keyword xsMacro LATIN_SMALL_LETTER_Y_WITH_DIAERESIS LDBL_DIG LEAVE -syn keyword xsMacro LEAVESUB LEAVE_SCOPE LEAVE_with_name LEX_DONT_CLOSE_RSFP -syn keyword xsMacro LEX_EVALBYTES LEX_IGNORE_UTF8_HINTS LEX_KEEP_PREVIOUS -syn keyword xsMacro LEX_NOTPARSING LEX_START_COPIED LEX_START_FLAGS -syn keyword xsMacro LEX_START_SAME_FILTER LEX_STUFF_UTF8 LIBERAL -syn keyword xsMacro LIBM_LIB_VERSION LIB_INVARG LIKELY LINKLIST LNBREAK LOCAL -syn keyword xsMacro LOCALE_PAT_MOD LOCALE_PAT_MODS LOCALTIME_MAX +syn keyword xsMacro LATIN_SMALL_LETTER_SHARP_S_NATIVE +syn keyword xsMacro LATIN_SMALL_LETTER_Y_WITH_DIAERESIS +syn keyword xsMacro LATIN_SMALL_LETTER_Y_WITH_DIAERESIS_NATIVE +syn keyword xsMacro LATIN_SMALL_LIGATURE_LONG_S_T +syn keyword xsMacro LATIN_SMALL_LIGATURE_LONG_S_T_UTF8 +syn keyword xsMacro LATIN_SMALL_LIGATURE_ST LATIN_SMALL_LIGATURE_ST_UTF8 +syn keyword xsMacro LDBL_DIG LEAVE LEAVESUB LEAVE_SCOPE LEAVE_with_name +syn keyword xsMacro LEX_DONT_CLOSE_RSFP LEX_EVALBYTES LEX_IGNORE_UTF8_HINTS +syn keyword xsMacro LEX_KEEP_PREVIOUS LEX_NOTPARSING LEX_START_COPIED +syn keyword xsMacro LEX_START_FLAGS LEX_START_SAME_FILTER LEX_STUFF_UTF8 +syn keyword xsMacro LF_NATIVE LIBERAL LIBM_LIB_VERSION LIB_INVARG LIKELY +syn keyword xsMacro LINKLIST LNBREAK LOADED_FILE_PROBE LOADING_FILE_PROBE +syn keyword xsMacro LOCAL LOCALE_PAT_MOD LOCALE_PAT_MODS LOCALTIME_MAX syn keyword xsMacro LOCALTIME_MIN LOCALTIME_R LOCALTIME_R_PROTO -syn keyword xsMacro LOCAL_PATCH_COUNT LOCK_DOLLARZERO_MUTEX LOC_SED LOGICAL -syn keyword xsMacro LONGJMP LONGLONGSIZE LONGSIZE LONG_DOUBLESIZE -syn keyword xsMacro LONG_DOUBLE_EQUALS_DOUBLE LOOPEX LOOP_PAT_MODS LSEEKSIZE -syn keyword xsMacro LSTOP LSTOPSUB LVRET L_R_TZSET LvFLAGS LvTARG LvTARGLEN -syn keyword xsMacro LvTARGOFF LvTYPE MADPROP_IN_BASEOP MAD_NULL MAD_OP MAD_PV -syn keyword xsMacro MAD_SV MALLOC_CHECK_TAINT MALLOC_CHECK_TAINT2 -syn keyword xsMacro MALLOC_CTL_H MALLOC_INIT MALLOC_OVERHEAD MALLOC_TERM +syn keyword xsMacro LOCAL_PATCH_COUNT LOCK_DOLLARZERO_MUTEX +syn keyword xsMacro LOCK_LC_NUMERIC_STANDARD LOCK_NUMERIC_STANDARD LOC_SED +syn keyword xsMacro LOGICAL LONGDOUBLE_BIG_ENDIAN LONGDOUBLE_DOUBLEDOUBLE +syn keyword xsMacro LONGDOUBLE_LITTLE_ENDIAN LONGDOUBLE_X86_80_BIT LONGJMP +syn keyword xsMacro LONGLONGSIZE LONGSIZE LONG_DOUBLEKIND LONG_DOUBLESIZE +syn keyword xsMacro LONG_DOUBLE_EQUALS_DOUBLE LONG_DOUBLE_IS_DOUBLE +syn keyword xsMacro LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_BIG_ENDIAN +syn keyword xsMacro LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_LITTLE_ENDIAN +syn keyword xsMacro LONG_DOUBLE_IS_IEEE_754_128_BIT_BIG_ENDIAN +syn keyword xsMacro LONG_DOUBLE_IS_IEEE_754_128_BIT_LITTLE_ENDIAN +syn keyword xsMacro LONG_DOUBLE_IS_UNKNOWN_FORMAT +syn keyword xsMacro LONG_DOUBLE_IS_X86_80_BIT_BIG_ENDIAN +syn keyword xsMacro LONG_DOUBLE_IS_X86_80_BIT_LITTLE_ENDIAN LOOPEX +syn keyword xsMacro LOOP_PAT_MODS LSEEKSIZE LSTOP LSTOPSUB LVRET L_R_TZSET +syn keyword xsMacro LvFLAGS LvSTARGOFF LvTARG LvTARGLEN LvTARGOFF LvTYPE +syn keyword xsMacro MALLOC_CHECK_TAINT MALLOC_CHECK_TAINT2 MALLOC_CTL_H +syn keyword xsMacro MALLOC_INIT MALLOC_OVERHEAD MALLOC_TERM syn keyword xsMacro MALLOC_TOO_LATE_FOR MARKPOINT MARKPOINT_next syn keyword xsMacro MARKPOINT_next_fail MASK MATCHOP MAXARG MAXO MAXPATHLEN syn keyword xsMacro MAXSYSFD MAX_CHARSET_NAME_LENGTH MAX_FEATURE_LEN syn keyword xsMacro MAX_PORTABLE_UTF8_TWO_BYTE -syn keyword xsMacro MAX_RECURSE_EVAL_NOCHANGE_DEPTH MAYBE_DEREF_GV -syn keyword xsMacro MAYBE_DEREF_GV_flags MAYBE_DEREF_GV_nomg MBOL -syn keyword xsMacro MEMBER_TO_FPTR MEM_ALIGNBYTES MEM_LOG_ALLOC MEM_LOG_FREE -syn keyword xsMacro MEM_LOG_REALLOC MEM_SIZE MEM_SIZE_MAX MEM_WRAP_CHECK -syn keyword xsMacro MEM_WRAP_CHECK_ MEM_WRAP_CHECK_1 MEM_WRAP_CHECK_2 MEOL -syn keyword xsMacro METHOD MEXTEND MGf_COPY MGf_DUP MGf_GSKIP MGf_LOCAL -syn keyword xsMacro MGf_MINMATCH MGf_REFCOUNTED MGf_TAINTEDDIR MICRO_SIGN -syn keyword xsMacro MINMOD MJD_OFFSET_DEBUG MRO_GET_PRIVATE_DATA MSPAGAIN -syn keyword xsMacro MULOP MULTICALL MULTILINE_PAT_MOD MULTIPLICITY MUTABLE_AV -syn keyword xsMacro MUTABLE_CV MUTABLE_GV MUTABLE_HV MUTABLE_IO MUTABLE_PTR -syn keyword xsMacro MUTABLE_SV MUTEX_DESTROY MUTEX_INIT -syn keyword xsMacro MUTEX_INIT_CALLS_MALLOC MUTEX_INIT_NEEDS_MUTEX_ZEROED -syn keyword xsMacro MUTEX_LOCK MUTEX_UNLOCK MY MYSUB MYSWAP MY_CXT_CLONE -syn keyword xsMacro MY_CXT_INDEX MY_CXT_INIT MY_CXT_INIT_ARG -syn keyword xsMacro MY_CXT_INIT_INTERP M_PAT_MODS M_VOID MgPV MgPV_const -syn keyword xsMacro MgPV_nolen_const MgTAINTEDDIR MgTAINTEDDIR_off -syn keyword xsMacro MgTAINTEDDIR_on Mkdir Move MoveD NALNUM NALNUMA NALNUML -syn keyword xsMacro NALNUMU NATIVE8_TO_UNI NATIVE_IS_INVARIANT -syn keyword xsMacro NATIVE_TO_ASCII NATIVE_TO_I8 NATIVE_TO_NEED NATIVE_TO_UNI -syn keyword xsMacro NATIVE_TO_UTF NBOUND NBOUNDA NBOUNDL NBOUNDU -syn keyword xsMacro NDBM_H_USES_PROTOTYPES NDIGIT NDIGITA NDIGITL +syn keyword xsMacro MAX_PRINT_A_FOR_USE_ONLY_BY_REGCOMP_DOT_C +syn keyword xsMacro MAX_RECURSE_EVAL_NOCHANGE_DEPTH MAX_UTF8_TWO_BYTE +syn keyword xsMacro MAYBE_DEREF_GV MAYBE_DEREF_GV_flags MAYBE_DEREF_GV_nomg +syn keyword xsMacro MBOL MB_CUR_MAX MDEREF_ACTION_MASK MDEREF_AV_gvav_aelem +syn keyword xsMacro MDEREF_AV_gvsv_vivify_rv2av_aelem MDEREF_AV_padav_aelem +syn keyword xsMacro MDEREF_AV_padsv_vivify_rv2av_aelem +syn keyword xsMacro MDEREF_AV_pop_rv2av_aelem MDEREF_AV_vivify_rv2av_aelem +syn keyword xsMacro MDEREF_FLAG_last MDEREF_HV_gvhv_helem +syn keyword xsMacro MDEREF_HV_gvsv_vivify_rv2hv_helem MDEREF_HV_padhv_helem +syn keyword xsMacro MDEREF_HV_padsv_vivify_rv2hv_helem +syn keyword xsMacro MDEREF_HV_pop_rv2hv_helem MDEREF_HV_vivify_rv2hv_helem +syn keyword xsMacro MDEREF_INDEX_MASK MDEREF_INDEX_const MDEREF_INDEX_gvsv +syn keyword xsMacro MDEREF_INDEX_none MDEREF_INDEX_padsv MDEREF_MASK +syn keyword xsMacro MDEREF_SHIFT MDEREF_reload MEMBER_TO_FPTR MEM_ALIGNBYTES +syn keyword xsMacro MEM_LOG_ALLOC MEM_LOG_FREE MEM_LOG_REALLOC MEM_SIZE +syn keyword xsMacro MEM_SIZE_MAX MEM_WRAP_CHECK MEM_WRAP_CHECK_ +syn keyword xsMacro MEM_WRAP_CHECK_1 MEM_WRAP_CHECK_2 MEOL METHOD MEXTEND +syn keyword xsMacro MGf_BYTES MGf_COPY MGf_DUP MGf_GSKIP MGf_LOCAL +syn keyword xsMacro MGf_MINMATCH MGf_PERSIST MGf_REFCOUNTED MGf_REQUIRE_GV +syn keyword xsMacro MGf_TAINTEDDIR MICRO_SIGN MICRO_SIGN_NATIVE MINMOD +syn keyword xsMacro MJD_OFFSET_DEBUG MRO_GET_PRIVATE_DATA MSPAGAIN MULOP +syn keyword xsMacro MULTICALL MULTILINE_PAT_MOD MULTIPLICITY MURMUR_C1 +syn keyword xsMacro MURMUR_C2 MURMUR_C3 MURMUR_C4 MURMUR_C5 MURMUR_DOBLOCK +syn keyword xsMacro MURMUR_DOBYTES MUTABLE_AV MUTABLE_CV MUTABLE_GV +syn keyword xsMacro MUTABLE_HV MUTABLE_IO MUTABLE_PTR MUTABLE_SV +syn keyword xsMacro MUTEX_DESTROY MUTEX_INIT MUTEX_INIT_NEEDS_MUTEX_ZEROED +syn keyword xsMacro MUTEX_LOCK MUTEX_UNLOCK MY MY_CXT_CLONE MY_CXT_INDEX +syn keyword xsMacro MY_CXT_INIT MY_CXT_INIT_ARG MY_CXT_INIT_INTERP M_PAT_MODS +syn keyword xsMacro MgBYTEPOS MgBYTEPOS_set MgPV MgPV_const MgPV_nolen_const +syn keyword xsMacro MgTAINTEDDIR MgTAINTEDDIR_off MgTAINTEDDIR_on Mkdir Move +syn keyword xsMacro MoveD NAN_COMPARE_BROKEN NATIVE8_TO_UNI +syn keyword xsMacro NATIVE_BYTE_IS_INVARIANT NATIVE_SKIP NATIVE_TO_ASCII +syn keyword xsMacro NATIVE_TO_I8 NATIVE_TO_LATIN1 NATIVE_TO_UNI NATIVE_TO_UTF +syn keyword xsMacro NATIVE_UTF8_TO_I8 NBOUND NBOUNDA NBOUNDL NBOUNDU +syn keyword xsMacro NBSP_NATIVE NBSP_UTF8 NDBM_H_USES_PROTOTYPES NDEBUG syn keyword xsMacro NEED_PTHREAD_INIT NEED_VA_COPY NEGATIVE_INDICES_VAR -syn keyword xsMacro NETDB_R_OBSOLETE NEWSV NEXTOPER NEXT_LINE_CHAR NEXT_OFF -syn keyword xsMacro NGROUPP NHORIZWS NOAMP NODE_ALIGN NODE_ALIGN_FILL -syn keyword xsMacro NODE_STEP_B NODE_STEP_REGNODE NODE_SZ_STR NOLINE -syn keyword xsMacro NONDESTRUCT_PAT_MOD NONDESTRUCT_PAT_MODS NOOP +syn keyword xsMacro NETDB_R_OBSOLETE NEWSV NEW_VERSION NEXTOPER +syn keyword xsMacro NEXT_LINE_CHAR NEXT_OFF NGROUPP NOAMP NOCAPTURE_PAT_MOD +syn keyword xsMacro NOCAPTURE_PAT_MODS NODE_ALIGN NODE_ALIGN_FILL NODE_STEP_B +syn keyword xsMacro NODE_STEP_REGNODE NODE_SZ_STR NOLINE NONDESTRUCT_PAT_MOD +syn keyword xsMacro NONDESTRUCT_PAT_MODS +syn keyword xsMacro NON_OTHER_COUNT_FOR_USE_ONLY_BY_REGCOMP_DOT_C NOOP syn keyword xsMacro NORETURN_FUNCTION_END NORMAL NOTHING NOTOP NOT_IN_PAD -syn keyword xsMacro NO_ENV_ARRAY_IN_MAIN NO_LOCALE -syn keyword xsMacro NO_LOCALECONV_MON_THOUSANDS_SEP NREF NREFF NREFFA NREFFL -syn keyword xsMacro NREFFU NSIG NSPACE NSPACEA NSPACEL NSPACEU NUM2PTR -syn keyword xsMacro NVERTWS NVSIZE NVTYPE NV_DIG NV_EPSILON NV_INF -syn keyword xsMacro NV_MANT_DIG NV_MAX NV_MAX_10_EXP NV_MIN NV_MIN_10_EXP -syn keyword xsMacro NV_NAN NV_OVERFLOWS_INTEGERS_AT NV_PRESERVES_UV_BITS +syn keyword xsMacro NOT_REACHED NO_ENV_ARRAY_IN_MAIN NO_LOCALE +syn keyword xsMacro NO_LOCALECONV_MON_THOUSANDS_SEP NO_TAINT_SUPPORT NPOSIXA +syn keyword xsMacro NPOSIXD NPOSIXL NPOSIXU NREF NREFF NREFFA NREFFL NREFFU +syn keyword xsMacro NSIG NUM2PTR NUM_ANYOF_CODE_POINTS NVSIZE NVTYPE +syn keyword xsMacro NV_BIG_ENDIAN NV_DIG NV_EPSILON NV_INF NV_LITTLE_ENDIAN +syn keyword xsMacro NV_MANT_DIG NV_MAX NV_MAX_10_EXP NV_MAX_EXP NV_MIN +syn keyword xsMacro NV_MIN_10_EXP NV_MIN_EXP NV_MIX_ENDIAN NV_NAN +syn keyword xsMacro NV_OVERFLOWS_INTEGERS_AT NV_PRESERVES_UV_BITS syn keyword xsMacro NV_WITHIN_IV NV_WITHIN_UV New NewOp NewOpSz Newc Newx syn keyword xsMacro Newxc Newxz Newz NofAMmeth Null Nullav Nullch Nullcv syn keyword xsMacro Nullfp Nullgv Nullhe Nullhek Nullhv Nullop Nullsv OASHIFT -syn keyword xsMacro OCSHIFT ONCE_PAT_MOD ONCE_PAT_MODS OPEN OPERAND OPFAIL +syn keyword xsMacro OCSHIFT OCTAL_VALUE OFFUNISKIP ONCE_PAT_MOD ONCE_PAT_MODS +syn keyword xsMacro OPEN OPERAND OPFAIL OPSLOT_HEADER OPSLOT_HEADER_P syn keyword xsMacro OPTIMIZED OP_BINARY OP_CHECK_MUTEX_INIT syn keyword xsMacro OP_CHECK_MUTEX_LOCK OP_CHECK_MUTEX_TERM -syn keyword xsMacro OP_CHECK_MUTEX_UNLOCK OP_CLASS OP_DESC OP_GIMME -syn keyword xsMacro OP_GIMME_REVERSE OP_IS_DIRHOP OP_IS_FILETEST -syn keyword xsMacro OP_IS_FILETEST_ACCESS OP_IS_NUMCOMPARE OP_IS_SOCKET -syn keyword xsMacro OP_LVALUE_NO_CROAK OP_MEM_TO_REG OP_NAME OP_REFCNT_INIT -syn keyword xsMacro OP_REFCNT_LOCK OP_REFCNT_TERM OP_REFCNT_UNLOCK -syn keyword xsMacro OP_REG_TO_MEM OROP OROR OSNAME OSVERS O_CREAT O_RDONLY -syn keyword xsMacro O_RDWR O_TEXT O_WRONLY Off Off_t_size OpREFCNT_dec -syn keyword xsMacro OpREFCNT_inc OpREFCNT_set OutCopFILE PAD_BASE_SV -syn keyword xsMacro PAD_CLONE_VARS PAD_COMPNAME_FLAGS +syn keyword xsMacro OP_CHECK_MUTEX_UNLOCK OP_CLASS OP_DESC OP_ENTRY_PROBE +syn keyword xsMacro OP_FREED OP_GIMME OP_GIMME_REVERSE OP_IS_DIRHOP +syn keyword xsMacro OP_IS_FILETEST OP_IS_FILETEST_ACCESS OP_IS_INFIX_BIT +syn keyword xsMacro OP_IS_NUMCOMPARE OP_IS_SOCKET OP_LVALUE_NO_CROAK OP_NAME +syn keyword xsMacro OP_REFCNT_INIT OP_REFCNT_LOCK OP_REFCNT_TERM +syn keyword xsMacro OP_REFCNT_UNLOCK OP_SIBLING OP_TYPE_IS OP_TYPE_ISNT +syn keyword xsMacro OP_TYPE_ISNT_AND_WASNT OP_TYPE_ISNT_AND_WASNT_NN +syn keyword xsMacro OP_TYPE_ISNT_NN OP_TYPE_IS_NN OP_TYPE_IS_OR_WAS +syn keyword xsMacro OP_TYPE_IS_OR_WAS_NN OROP OROR OSNAME OSVERS O_CREAT +syn keyword xsMacro O_RDONLY O_RDWR O_TEXT O_WRONLY Off Off_t_size +syn keyword xsMacro OpHAS_SIBLING OpLASTSIB_set OpMAYBESIB_set OpMORESIB_set +syn keyword xsMacro OpREFCNT_dec OpREFCNT_inc OpREFCNT_set OpSIBLING OpSLAB +syn keyword xsMacro OpSLOT OpslabREFCNT_dec OpslabREFCNT_dec_padok OutCopFILE +syn keyword xsMacro PADNAME_FROM_PV PADNAMEt_LVALUE PADNAMEt_OUR +syn keyword xsMacro PADNAMEt_OUTER PADNAMEt_STATE PADNAMEt_TYPED PAD_BASE_SV +syn keyword xsMacro PAD_CLONE_VARS PAD_COMPNAME PAD_COMPNAME_FLAGS syn keyword xsMacro PAD_COMPNAME_FLAGS_isOUR PAD_COMPNAME_GEN syn keyword xsMacro PAD_COMPNAME_GEN_set PAD_COMPNAME_OURSTASH syn keyword xsMacro PAD_COMPNAME_PV PAD_COMPNAME_SV PAD_COMPNAME_TYPE syn keyword xsMacro PAD_FAKELEX_ANON PAD_FAKELEX_MULTI PAD_RESTORE_LOCAL syn keyword xsMacro PAD_SAVE_LOCAL PAD_SAVE_SETNULLPAD PAD_SETSV PAD_SET_CUR syn keyword xsMacro PAD_SET_CUR_NOSAVE PAD_SV PAD_SVl PARENT_FAKELEX_FLAGS -syn keyword xsMacro PARENT_PAD_INDEX PARSE_OPTIONAL PATCHLEVEL PEG PERLDB_ALL -syn keyword xsMacro PERLDB_GOTO PERLDB_INTER PERLDB_LINE PERLDB_NAMEANON -syn keyword xsMacro PERLDB_NAMEEVAL PERLDB_NOOPT PERLDB_SAVESRC -syn keyword xsMacro PERLDB_SAVESRC_INVALID PERLDB_SAVESRC_NOSUBS -syn keyword xsMacro PERLDB_SINGLE PERLDB_SUB PERLDB_SUBLINE PERLDB_SUB_NN -syn keyword xsMacro PERLDBf_GOTO PERLDBf_INTER PERLDBf_LINE PERLDBf_NAMEANON -syn keyword xsMacro PERLDBf_NAMEEVAL PERLDBf_NONAME PERLDBf_NOOPT -syn keyword xsMacro PERLDBf_SAVESRC PERLDBf_SAVESRC_INVALID -syn keyword xsMacro PERLDBf_SAVESRC_NOSUBS PERLDBf_SINGLE PERLDBf_SUB -syn keyword xsMacro PERLDBf_SUBLINE PERLIOBUF_DEFAULT_BUFSIZ PERLIO_DUP_CLONE -syn keyword xsMacro PERLIO_DUP_FD PERLIO_FUNCS_CAST PERLIO_FUNCS_CONST -syn keyword xsMacro PERLIO_FUNCS_DECL PERLIO_F_APPEND PERLIO_F_CANREAD -syn keyword xsMacro PERLIO_F_CANWRITE PERLIO_F_CLEARED PERLIO_F_CRLF -syn keyword xsMacro PERLIO_F_EOF PERLIO_F_ERROR PERLIO_F_FASTGETS -syn keyword xsMacro PERLIO_F_LINEBUF PERLIO_F_NOTREG PERLIO_F_OPEN -syn keyword xsMacro PERLIO_F_RDBUF PERLIO_F_TEMP PERLIO_F_TRUNCATE -syn keyword xsMacro PERLIO_F_TTY PERLIO_F_UNBUF PERLIO_F_UTF8 PERLIO_F_WRBUF -syn keyword xsMacro PERLIO_INIT PERLIO_IS_STDIO PERLIO_K_BUFFERED -syn keyword xsMacro PERLIO_K_CANCRLF PERLIO_K_DESTRUCT PERLIO_K_DUMMY -syn keyword xsMacro PERLIO_K_FASTGETS PERLIO_K_MULTIARG PERLIO_K_RAW -syn keyword xsMacro PERLIO_K_UTF8 PERLIO_LAYERS PERLIO_NOT_STDIO -syn keyword xsMacro PERLIO_STDTEXT PERLIO_TERM PERLIO_USING_CRLF -syn keyword xsMacro PERLSI_DESTROY PERLSI_DIEHOOK PERLSI_MAGIC PERLSI_MAIN -syn keyword xsMacro PERLSI_OVERLOAD PERLSI_REQUIRE PERLSI_SIGNAL PERLSI_SORT -syn keyword xsMacro PERLSI_UNDEF PERLSI_UNKNOWN PERLSI_WARNHOOK PERL_ABS -syn keyword xsMacro PERL_ALLOC_CHECK PERL_API_REVISION PERL_API_SUBVERSION -syn keyword xsMacro PERL_API_VERSION PERL_API_VERSION_STRING -syn keyword xsMacro PERL_ARENA_ROOTS_SIZE PERL_ARENA_SIZE -syn keyword xsMacro PERL_ARGS_ASSERT_ADD_ALTERNATE PERL_ARGS_ASSERT_ADD_DATA +syn keyword xsMacro PARENT_PAD_INDEX PARSE_OPTIONAL PASS1 PASS2 PATCHLEVEL +syn keyword xsMacro PERLDB_ALL PERLDB_GOTO PERLDB_INTER PERLDB_LINE +syn keyword xsMacro PERLDB_NAMEANON PERLDB_NAMEEVAL PERLDB_NOOPT +syn keyword xsMacro PERLDB_SAVESRC PERLDB_SAVESRC_INVALID +syn keyword xsMacro PERLDB_SAVESRC_NOSUBS PERLDB_SINGLE PERLDB_SUB +syn keyword xsMacro PERLDB_SUBLINE PERLDB_SUB_NN PERLDBf_GOTO PERLDBf_INTER +syn keyword xsMacro PERLDBf_LINE PERLDBf_NAMEANON PERLDBf_NAMEEVAL +syn keyword xsMacro PERLDBf_NONAME PERLDBf_NOOPT PERLDBf_SAVESRC +syn keyword xsMacro PERLDBf_SAVESRC_INVALID PERLDBf_SAVESRC_NOSUBS +syn keyword xsMacro PERLDBf_SINGLE PERLDBf_SUB PERLDBf_SUBLINE +syn keyword xsMacro PERLIOBUF_DEFAULT_BUFSIZ PERLIO_DUP_CLONE PERLIO_DUP_FD +syn keyword xsMacro PERLIO_FUNCS_CAST PERLIO_FUNCS_CONST PERLIO_FUNCS_DECL +syn keyword xsMacro PERLIO_F_APPEND PERLIO_F_CANREAD PERLIO_F_CANWRITE +syn keyword xsMacro PERLIO_F_CLEARED PERLIO_F_CRLF PERLIO_F_EOF +syn keyword xsMacro PERLIO_F_ERROR PERLIO_F_FASTGETS PERLIO_F_LINEBUF +syn keyword xsMacro PERLIO_F_NOTREG PERLIO_F_OPEN PERLIO_F_RDBUF +syn keyword xsMacro PERLIO_F_TEMP PERLIO_F_TRUNCATE PERLIO_F_TTY +syn keyword xsMacro PERLIO_F_UNBUF PERLIO_F_UTF8 PERLIO_F_WRBUF PERLIO_INIT +syn keyword xsMacro PERLIO_IS_STDIO PERLIO_K_BUFFERED PERLIO_K_CANCRLF +syn keyword xsMacro PERLIO_K_DESTRUCT PERLIO_K_DUMMY PERLIO_K_FASTGETS +syn keyword xsMacro PERLIO_K_MULTIARG PERLIO_K_RAW PERLIO_K_UTF8 +syn keyword xsMacro PERLIO_LAYERS PERLIO_NOT_STDIO PERLIO_STDTEXT PERLIO_TERM +syn keyword xsMacro PERLIO_USING_CRLF PERLSI_DESTROY PERLSI_DIEHOOK +syn keyword xsMacro PERLSI_MAGIC PERLSI_MAIN PERLSI_OVERLOAD PERLSI_REQUIRE +syn keyword xsMacro PERLSI_SIGNAL PERLSI_SORT PERLSI_UNDEF PERLSI_UNKNOWN +syn keyword xsMacro PERLSI_WARNHOOK PERL_ABS PERL_ALLOC_CHECK PERL_ANY_COW +syn keyword xsMacro PERL_API_REVISION PERL_API_SUBVERSION PERL_API_VERSION +syn keyword xsMacro PERL_API_VERSION_STRING PERL_ARENA_ROOTS_SIZE +syn keyword xsMacro PERL_ARENA_SIZE PERL_ARGS_ASSERT_ADD_ABOVE_LATIN1_FOLDS +syn keyword xsMacro PERL_ARGS_ASSERT_ADD_DATA +syn keyword xsMacro PERL_ARGS_ASSERT_ADD_MULTI_MATCH syn keyword xsMacro PERL_ARGS_ASSERT_ADD_UTF16_TEXTFILTER -syn keyword xsMacro PERL_ARGS_ASSERT_ADJUST_STACK_ON_LEAVE -syn keyword xsMacro PERL_ARGS_ASSERT_ALLOCMY PERL_ARGS_ASSERT_AMAGIC_CALL -syn keyword xsMacro PERL_ARGS_ASSERT_AMAGIC_CMP +syn keyword xsMacro PERL_ARGS_ASSERT_ADJUST_SIZE_AND_FIND_BUCKET +syn keyword xsMacro PERL_ARGS_ASSERT_ADVANCE_ONE_SB +syn keyword xsMacro PERL_ARGS_ASSERT_ADVANCE_ONE_WB +syn keyword xsMacro PERL_ARGS_ASSERT_ALLOCCOPSTASH PERL_ARGS_ASSERT_ALLOCMY +syn keyword xsMacro PERL_ARGS_ASSERT_ALLOC_MAYBE_POPULATE_EXACT +syn keyword xsMacro PERL_ARGS_ASSERT_AMAGIC_CALL PERL_ARGS_ASSERT_AMAGIC_CMP syn keyword xsMacro PERL_ARGS_ASSERT_AMAGIC_CMP_LOCALE syn keyword xsMacro PERL_ARGS_ASSERT_AMAGIC_DEREF_CALL syn keyword xsMacro PERL_ARGS_ASSERT_AMAGIC_I_NCMP syn keyword xsMacro PERL_ARGS_ASSERT_AMAGIC_NCMP syn keyword xsMacro PERL_ARGS_ASSERT_ANONYMISE_CV_MAYBE -syn keyword xsMacro PERL_ARGS_ASSERT_ANY_DUP PERL_ARGS_ASSERT_APPLY -syn keyword xsMacro PERL_ARGS_ASSERT_APPLY_ATTRS +syn keyword xsMacro PERL_ARGS_ASSERT_ANY_DUP +syn keyword xsMacro PERL_ARGS_ASSERT_APPEND_UTF8_FROM_NATIVE_BYTE +syn keyword xsMacro PERL_ARGS_ASSERT_APPLY PERL_ARGS_ASSERT_APPLY_ATTRS syn keyword xsMacro PERL_ARGS_ASSERT_APPLY_ATTRS_MY syn keyword xsMacro PERL_ARGS_ASSERT_APPLY_ATTRS_STRING syn keyword xsMacro PERL_ARGS_ASSERT_ASSERT_UFT8_CACHE_COHERENT @@ -1551,82 +1759,92 @@ syn keyword xsMacro PERL_ARGS_ASSERT_AV_ARYLEN_P PERL_ARGS_ASSERT_AV_CLEAR syn keyword xsMacro PERL_ARGS_ASSERT_AV_CREATE_AND_PUSH syn keyword xsMacro PERL_ARGS_ASSERT_AV_CREATE_AND_UNSHIFT_ONE syn keyword xsMacro PERL_ARGS_ASSERT_AV_DELETE PERL_ARGS_ASSERT_AV_EXISTS -syn keyword xsMacro PERL_ARGS_ASSERT_AV_EXTEND PERL_ARGS_ASSERT_AV_FETCH +syn keyword xsMacro PERL_ARGS_ASSERT_AV_EXTEND +syn keyword xsMacro PERL_ARGS_ASSERT_AV_EXTEND_GUTS PERL_ARGS_ASSERT_AV_FETCH syn keyword xsMacro PERL_ARGS_ASSERT_AV_FILL PERL_ARGS_ASSERT_AV_ITER_P syn keyword xsMacro PERL_ARGS_ASSERT_AV_LEN PERL_ARGS_ASSERT_AV_MAKE syn keyword xsMacro PERL_ARGS_ASSERT_AV_POP PERL_ARGS_ASSERT_AV_PUSH syn keyword xsMacro PERL_ARGS_ASSERT_AV_REIFY PERL_ARGS_ASSERT_AV_SHIFT -syn keyword xsMacro PERL_ARGS_ASSERT_AV_STORE PERL_ARGS_ASSERT_AV_UNDEF -syn keyword xsMacro PERL_ARGS_ASSERT_AV_UNSHIFT PERL_ARGS_ASSERT_BAD_TYPE_PV -syn keyword xsMacro PERL_ARGS_ASSERT_BAD_TYPE_SV PERL_ARGS_ASSERT_BIND_MATCH +syn keyword xsMacro PERL_ARGS_ASSERT_AV_STORE PERL_ARGS_ASSERT_AV_TOP_INDEX +syn keyword xsMacro PERL_ARGS_ASSERT_AV_UNDEF PERL_ARGS_ASSERT_AV_UNSHIFT +syn keyword xsMacro PERL_ARGS_ASSERT_BACKUP_ONE_SB +syn keyword xsMacro PERL_ARGS_ASSERT_BACKUP_ONE_WB +syn keyword xsMacro PERL_ARGS_ASSERT_BAD_TYPE_GV PERL_ARGS_ASSERT_BAD_TYPE_PV +syn keyword xsMacro PERL_ARGS_ASSERT_BIND_MATCH syn keyword xsMacro PERL_ARGS_ASSERT_BLOCKHOOK_REGISTER syn keyword xsMacro PERL_ARGS_ASSERT_BYTES_CMP_UTF8 syn keyword xsMacro PERL_ARGS_ASSERT_BYTES_FROM_UTF8 -syn keyword xsMacro PERL_ARGS_ASSERT_BYTES_TO_UNI syn keyword xsMacro PERL_ARGS_ASSERT_BYTES_TO_UTF8 PERL_ARGS_ASSERT_CALL_ARGV syn keyword xsMacro PERL_ARGS_ASSERT_CALL_LIST PERL_ARGS_ASSERT_CALL_METHOD syn keyword xsMacro PERL_ARGS_ASSERT_CALL_PV PERL_ARGS_ASSERT_CALL_SV syn keyword xsMacro PERL_ARGS_ASSERT_CANDO PERL_ARGS_ASSERT_CHECKCOMMA -syn keyword xsMacro PERL_ARGS_ASSERT_CHECKPOSIXCC syn keyword xsMacro PERL_ARGS_ASSERT_CHECK_LOCALE_BOUNDARY_CROSSING syn keyword xsMacro PERL_ARGS_ASSERT_CHECK_TYPE_AND_OPEN syn keyword xsMacro PERL_ARGS_ASSERT_CHECK_UTF8_PRINT -syn keyword xsMacro PERL_ARGS_ASSERT_CK_ANONCODE PERL_ARGS_ASSERT_CK_BITOP -syn keyword xsMacro PERL_ARGS_ASSERT_CK_CHDIR PERL_ARGS_ASSERT_CK_CMP +syn keyword xsMacro PERL_ARGS_ASSERT_CK_ANONCODE PERL_ARGS_ASSERT_CK_BACKTICK +syn keyword xsMacro PERL_ARGS_ASSERT_CK_BITOP PERL_ARGS_ASSERT_CK_CMP syn keyword xsMacro PERL_ARGS_ASSERT_CK_CONCAT PERL_ARGS_ASSERT_CK_DEFINED -syn keyword xsMacro PERL_ARGS_ASSERT_CK_DELETE PERL_ARGS_ASSERT_CK_DIE -syn keyword xsMacro PERL_ARGS_ASSERT_CK_EACH +syn keyword xsMacro PERL_ARGS_ASSERT_CK_DELETE PERL_ARGS_ASSERT_CK_EACH syn keyword xsMacro PERL_ARGS_ASSERT_CK_ENTERSUB_ARGS_CORE syn keyword xsMacro PERL_ARGS_ASSERT_CK_ENTERSUB_ARGS_LIST syn keyword xsMacro PERL_ARGS_ASSERT_CK_ENTERSUB_ARGS_PROTO syn keyword xsMacro PERL_ARGS_ASSERT_CK_ENTERSUB_ARGS_PROTO_OR_LIST syn keyword xsMacro PERL_ARGS_ASSERT_CK_EOF PERL_ARGS_ASSERT_CK_EVAL syn keyword xsMacro PERL_ARGS_ASSERT_CK_EXEC PERL_ARGS_ASSERT_CK_EXISTS -syn keyword xsMacro PERL_ARGS_ASSERT_CK_EXIT PERL_ARGS_ASSERT_CK_FTST -syn keyword xsMacro PERL_ARGS_ASSERT_CK_FUN PERL_ARGS_ASSERT_CK_GLOB -syn keyword xsMacro PERL_ARGS_ASSERT_CK_GREP PERL_ARGS_ASSERT_CK_INDEX -syn keyword xsMacro PERL_ARGS_ASSERT_CK_JOIN PERL_ARGS_ASSERT_CK_LENGTH -syn keyword xsMacro PERL_ARGS_ASSERT_CK_LFUN PERL_ARGS_ASSERT_CK_LISTIOB -syn keyword xsMacro PERL_ARGS_ASSERT_CK_MATCH PERL_ARGS_ASSERT_CK_METHOD -syn keyword xsMacro PERL_ARGS_ASSERT_CK_NULL PERL_ARGS_ASSERT_CK_OPEN -syn keyword xsMacro PERL_ARGS_ASSERT_CK_READLINE PERL_ARGS_ASSERT_CK_REPEAT +syn keyword xsMacro PERL_ARGS_ASSERT_CK_FTST PERL_ARGS_ASSERT_CK_FUN +syn keyword xsMacro PERL_ARGS_ASSERT_CK_GLOB PERL_ARGS_ASSERT_CK_GREP +syn keyword xsMacro PERL_ARGS_ASSERT_CK_INDEX PERL_ARGS_ASSERT_CK_JOIN +syn keyword xsMacro PERL_ARGS_ASSERT_CK_LENGTH PERL_ARGS_ASSERT_CK_LFUN +syn keyword xsMacro PERL_ARGS_ASSERT_CK_LISTIOB PERL_ARGS_ASSERT_CK_MATCH +syn keyword xsMacro PERL_ARGS_ASSERT_CK_METHOD PERL_ARGS_ASSERT_CK_NULL +syn keyword xsMacro PERL_ARGS_ASSERT_CK_OPEN PERL_ARGS_ASSERT_CK_PROTOTYPE +syn keyword xsMacro PERL_ARGS_ASSERT_CK_READLINE +syn keyword xsMacro PERL_ARGS_ASSERT_CK_REFASSIGN PERL_ARGS_ASSERT_CK_REPEAT syn keyword xsMacro PERL_ARGS_ASSERT_CK_REQUIRE PERL_ARGS_ASSERT_CK_RETURN syn keyword xsMacro PERL_ARGS_ASSERT_CK_RFUN PERL_ARGS_ASSERT_CK_RVCONST syn keyword xsMacro PERL_ARGS_ASSERT_CK_SASSIGN PERL_ARGS_ASSERT_CK_SELECT syn keyword xsMacro PERL_ARGS_ASSERT_CK_SHIFT PERL_ARGS_ASSERT_CK_SMARTMATCH syn keyword xsMacro PERL_ARGS_ASSERT_CK_SORT PERL_ARGS_ASSERT_CK_SPAIR -syn keyword xsMacro PERL_ARGS_ASSERT_CK_SPLIT PERL_ARGS_ASSERT_CK_SUBR -syn keyword xsMacro PERL_ARGS_ASSERT_CK_SUBSTR PERL_ARGS_ASSERT_CK_SVCONST -syn keyword xsMacro PERL_ARGS_ASSERT_CK_TELL PERL_ARGS_ASSERT_CK_TRUNC -syn keyword xsMacro PERL_ARGS_ASSERT_CK_WARNER PERL_ARGS_ASSERT_CK_WARNER_D +syn keyword xsMacro PERL_ARGS_ASSERT_CK_SPLIT PERL_ARGS_ASSERT_CK_STRINGIFY +syn keyword xsMacro PERL_ARGS_ASSERT_CK_SUBR PERL_ARGS_ASSERT_CK_SUBSTR +syn keyword xsMacro PERL_ARGS_ASSERT_CK_SVCONST PERL_ARGS_ASSERT_CK_TELL +syn keyword xsMacro PERL_ARGS_ASSERT_CK_TRUNC PERL_ARGS_ASSERT_CK_WARNER +syn keyword xsMacro PERL_ARGS_ASSERT_CK_WARNER_D syn keyword xsMacro PERL_ARGS_ASSERT_CLEAR_PLACEHOLDERS +syn keyword xsMacro PERL_ARGS_ASSERT_CLEAR_SPECIAL_BLOCKS syn keyword xsMacro PERL_ARGS_ASSERT_CLONE_PARAMS_DEL syn keyword xsMacro PERL_ARGS_ASSERT_CLONE_PARAMS_NEW -syn keyword xsMacro PERL_ARGS_ASSERT_CLOSEST_COP PERL_ARGS_ASSERT_CL_AND -syn keyword xsMacro PERL_ARGS_ASSERT_CL_ANYTHING PERL_ARGS_ASSERT_CL_INIT -syn keyword xsMacro PERL_ARGS_ASSERT_CL_IS_ANYTHING PERL_ARGS_ASSERT_CL_OR +syn keyword xsMacro PERL_ARGS_ASSERT_CLOSEST_COP +syn keyword xsMacro PERL_ARGS_ASSERT_COMPUTE_EXACTISH +syn keyword xsMacro PERL_ARGS_ASSERT_CONSTRUCT_AHOCORASICK_FROM_TRIE syn keyword xsMacro PERL_ARGS_ASSERT_COP_FETCH_LABEL syn keyword xsMacro PERL_ARGS_ASSERT_COP_FREE syn keyword xsMacro PERL_ARGS_ASSERT_COP_STORE_LABEL syn keyword xsMacro PERL_ARGS_ASSERT_CORESUB_OP syn keyword xsMacro PERL_ARGS_ASSERT_CORE_PROTOTYPE -syn keyword xsMacro PERL_ARGS_ASSERT_CORE_REGCLASS_SWASH +syn keyword xsMacro PERL_ARGS_ASSERT_COULD_IT_BE_A_POSIX_CLASS syn keyword xsMacro PERL_ARGS_ASSERT_CROAK_SV PERL_ARGS_ASSERT_CROAK_XS_USAGE syn keyword xsMacro PERL_ARGS_ASSERT_CURSE PERL_ARGS_ASSERT_CUSTOM_OP_DESC +syn keyword xsMacro PERL_ARGS_ASSERT_CUSTOM_OP_GET_FIELD syn keyword xsMacro PERL_ARGS_ASSERT_CUSTOM_OP_NAME syn keyword xsMacro PERL_ARGS_ASSERT_CUSTOM_OP_REGISTER -syn keyword xsMacro PERL_ARGS_ASSERT_CUSTOM_OP_XOP PERL_ARGS_ASSERT_CVGV_SET +syn keyword xsMacro PERL_ARGS_ASSERT_CVGV_FROM_HEK PERL_ARGS_ASSERT_CVGV_SET syn keyword xsMacro PERL_ARGS_ASSERT_CVSTASH_SET syn keyword xsMacro PERL_ARGS_ASSERT_CV_CKPROTO_LEN_FLAGS -syn keyword xsMacro PERL_ARGS_ASSERT_CV_CLONE PERL_ARGS_ASSERT_CV_DUMP +syn keyword xsMacro PERL_ARGS_ASSERT_CV_CLONE PERL_ARGS_ASSERT_CV_CLONE_INTO +syn keyword xsMacro PERL_ARGS_ASSERT_CV_DUMP syn keyword xsMacro PERL_ARGS_ASSERT_CV_GET_CALL_CHECKER +syn keyword xsMacro PERL_ARGS_ASSERT_CV_NAME syn keyword xsMacro PERL_ARGS_ASSERT_CV_SET_CALL_CHECKER -syn keyword xsMacro PERL_ARGS_ASSERT_CV_UNDEF PERL_ARGS_ASSERT_CX_DUMP -syn keyword xsMacro PERL_ARGS_ASSERT_CX_DUP PERL_ARGS_ASSERT_DEB -syn keyword xsMacro PERL_ARGS_ASSERT_DEBOP PERL_ARGS_ASSERT_DEBPROF +syn keyword xsMacro PERL_ARGS_ASSERT_CV_SET_CALL_CHECKER_FLAGS +syn keyword xsMacro PERL_ARGS_ASSERT_CV_UNDEF PERL_ARGS_ASSERT_CV_UNDEF_FLAGS +syn keyword xsMacro PERL_ARGS_ASSERT_CX_DUMP PERL_ARGS_ASSERT_CX_DUP +syn keyword xsMacro PERL_ARGS_ASSERT_DEB PERL_ARGS_ASSERT_DEBOP +syn keyword xsMacro PERL_ARGS_ASSERT_DEBPROF syn keyword xsMacro PERL_ARGS_ASSERT_DEBUG_START_MATCH syn keyword xsMacro PERL_ARGS_ASSERT_DEB_NOCONTEXT -syn keyword xsMacro PERL_ARGS_ASSERT_DEB_STACK_N PERL_ARGS_ASSERT_DELIMCPY +syn keyword xsMacro PERL_ARGS_ASSERT_DEB_STACK_N +syn keyword xsMacro PERL_ARGS_ASSERT_DEFELEM_TARGET PERL_ARGS_ASSERT_DELIMCPY syn keyword xsMacro PERL_ARGS_ASSERT_DEL_SV PERL_ARGS_ASSERT_DESTROY_MATCHER syn keyword xsMacro PERL_ARGS_ASSERT_DIE_SV PERL_ARGS_ASSERT_DIE_UNWIND syn keyword xsMacro PERL_ARGS_ASSERT_DIRP_DUP PERL_ARGS_ASSERT_DIV128 @@ -1645,13 +1863,12 @@ syn keyword xsMacro PERL_ARGS_ASSERT_DO_IPCCTL PERL_ARGS_ASSERT_DO_IPCGET syn keyword xsMacro PERL_ARGS_ASSERT_DO_JOIN PERL_ARGS_ASSERT_DO_MAGIC_DUMP syn keyword xsMacro PERL_ARGS_ASSERT_DO_MSGRCV PERL_ARGS_ASSERT_DO_MSGSND syn keyword xsMacro PERL_ARGS_ASSERT_DO_NCMP PERL_ARGS_ASSERT_DO_ODDBALL -syn keyword xsMacro PERL_ARGS_ASSERT_DO_OPEN PERL_ARGS_ASSERT_DO_OPEN9 -syn keyword xsMacro PERL_ARGS_ASSERT_DO_OPENN PERL_ARGS_ASSERT_DO_OP_DUMP -syn keyword xsMacro PERL_ARGS_ASSERT_DO_OP_XMLDUMP -syn keyword xsMacro PERL_ARGS_ASSERT_DO_PMOP_DUMP -syn keyword xsMacro PERL_ARGS_ASSERT_DO_PMOP_XMLDUMP -syn keyword xsMacro PERL_ARGS_ASSERT_DO_PRINT PERL_ARGS_ASSERT_DO_SEMOP -syn keyword xsMacro PERL_ARGS_ASSERT_DO_SHMIO PERL_ARGS_ASSERT_DO_SPAWN +syn keyword xsMacro PERL_ARGS_ASSERT_DO_OPEN PERL_ARGS_ASSERT_DO_OPEN6 +syn keyword xsMacro PERL_ARGS_ASSERT_DO_OPEN9 PERL_ARGS_ASSERT_DO_OPENN +syn keyword xsMacro PERL_ARGS_ASSERT_DO_OPEN_RAW PERL_ARGS_ASSERT_DO_OP_DUMP +syn keyword xsMacro PERL_ARGS_ASSERT_DO_PMOP_DUMP PERL_ARGS_ASSERT_DO_PRINT +syn keyword xsMacro PERL_ARGS_ASSERT_DO_SEMOP PERL_ARGS_ASSERT_DO_SHMIO +syn keyword xsMacro PERL_ARGS_ASSERT_DO_SPAWN syn keyword xsMacro PERL_ARGS_ASSERT_DO_SPAWN_NOWAIT syn keyword xsMacro PERL_ARGS_ASSERT_DO_SPRINTF PERL_ARGS_ASSERT_DO_SV_DUMP syn keyword xsMacro PERL_ARGS_ASSERT_DO_SYSSEEK PERL_ARGS_ASSERT_DO_TELL @@ -1663,10 +1880,11 @@ syn keyword xsMacro PERL_ARGS_ASSERT_DO_TRANS_COUNT_UTF8 syn keyword xsMacro PERL_ARGS_ASSERT_DO_TRANS_SIMPLE syn keyword xsMacro PERL_ARGS_ASSERT_DO_TRANS_SIMPLE_UTF8 syn keyword xsMacro PERL_ARGS_ASSERT_DO_VECGET PERL_ARGS_ASSERT_DO_VECSET -syn keyword xsMacro PERL_ARGS_ASSERT_DO_VOP PERL_ARGS_ASSERT_DUMPUNTIL -syn keyword xsMacro PERL_ARGS_ASSERT_DUMP_EXEC_POS PERL_ARGS_ASSERT_DUMP_FDS -syn keyword xsMacro PERL_ARGS_ASSERT_DUMP_FORM PERL_ARGS_ASSERT_DUMP_INDENT -syn keyword xsMacro PERL_ARGS_ASSERT_DUMP_MSTATS +syn keyword xsMacro PERL_ARGS_ASSERT_DO_VOP PERL_ARGS_ASSERT_DRAND48_INIT_R +syn keyword xsMacro PERL_ARGS_ASSERT_DRAND48_R PERL_ARGS_ASSERT_DUMPUNTIL +syn keyword xsMacro PERL_ARGS_ASSERT_DUMP_C_BACKTRACE +syn keyword xsMacro PERL_ARGS_ASSERT_DUMP_EXEC_POS PERL_ARGS_ASSERT_DUMP_FORM +syn keyword xsMacro PERL_ARGS_ASSERT_DUMP_INDENT PERL_ARGS_ASSERT_DUMP_MSTATS syn keyword xsMacro PERL_ARGS_ASSERT_DUMP_PACKSUBS syn keyword xsMacro PERL_ARGS_ASSERT_DUMP_PACKSUBS_PERL syn keyword xsMacro PERL_ARGS_ASSERT_DUMP_SUB PERL_ARGS_ASSERT_DUMP_SUB_PERL @@ -1687,12 +1905,15 @@ syn keyword xsMacro PERL_ARGS_ASSERT_FIND_AND_FORGET_PMOPS syn keyword xsMacro PERL_ARGS_ASSERT_FIND_ARRAY_SUBSCRIPT syn keyword xsMacro PERL_ARGS_ASSERT_FIND_BEGINNING syn keyword xsMacro PERL_ARGS_ASSERT_FIND_BYCLASS +syn keyword xsMacro PERL_ARGS_ASSERT_FIND_DEFAULT_STASH syn keyword xsMacro PERL_ARGS_ASSERT_FIND_HASH_SUBSCRIPT syn keyword xsMacro PERL_ARGS_ASSERT_FIND_IN_MY_STASH syn keyword xsMacro PERL_ARGS_ASSERT_FIND_RUNDEFSV2 syn keyword xsMacro PERL_ARGS_ASSERT_FIND_SCRIPT -syn keyword xsMacro PERL_ARGS_ASSERT_FIRST_SYMBOL PERL_ARGS_ASSERT_FOLDEQ -syn keyword xsMacro PERL_ARGS_ASSERT_FOLDEQ_LATIN1 +syn keyword xsMacro PERL_ARGS_ASSERT_FIND_UNINIT_VAR +syn keyword xsMacro PERL_ARGS_ASSERT_FIRST_SYMBOL +syn keyword xsMacro PERL_ARGS_ASSERT_FIXUP_ERRNO_STRING +syn keyword xsMacro PERL_ARGS_ASSERT_FOLDEQ PERL_ARGS_ASSERT_FOLDEQ_LATIN1 syn keyword xsMacro PERL_ARGS_ASSERT_FOLDEQ_LOCALE syn keyword xsMacro PERL_ARGS_ASSERT_FOLDEQ_UTF8_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT_FOLD_CONSTANTS @@ -1701,34 +1922,40 @@ syn keyword xsMacro PERL_ARGS_ASSERT_FORCE_STRICT_VERSION syn keyword xsMacro PERL_ARGS_ASSERT_FORCE_VERSION syn keyword xsMacro PERL_ARGS_ASSERT_FORCE_WORD PERL_ARGS_ASSERT_FORGET_PMOP syn keyword xsMacro PERL_ARGS_ASSERT_FORM PERL_ARGS_ASSERT_FORM_NOCONTEXT +syn keyword xsMacro PERL_ARGS_ASSERT_FORM_SHORT_OCTAL_WARNING syn keyword xsMacro PERL_ARGS_ASSERT_FPRINTF_NOCONTEXT syn keyword xsMacro PERL_ARGS_ASSERT_FP_DUP syn keyword xsMacro PERL_ARGS_ASSERT_FREE_GLOBAL_STRUCT syn keyword xsMacro PERL_ARGS_ASSERT_GETCWD_SV PERL_ARGS_ASSERT_GETENV_LEN +syn keyword xsMacro PERL_ARGS_ASSERT_GET_AND_CHECK_BACKSLASH_N_NAME +syn keyword xsMacro PERL_ARGS_ASSERT_GET_ANYOF_CP_LIST_FOR_SSC syn keyword xsMacro PERL_ARGS_ASSERT_GET_AUX_MG PERL_ARGS_ASSERT_GET_AV syn keyword xsMacro PERL_ARGS_ASSERT_GET_CV PERL_ARGS_ASSERT_GET_CVN_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT_GET_DB_SUB -syn keyword xsMacro PERL_ARGS_ASSERT_GET_DEBUG_OPTS PERL_ARGS_ASSERT_GET_HV +syn keyword xsMacro PERL_ARGS_ASSERT_GET_DEBUG_OPTS +syn keyword xsMacro PERL_ARGS_ASSERT_GET_HASH_SEED PERL_ARGS_ASSERT_GET_HV syn keyword xsMacro PERL_ARGS_ASSERT_GET_INVLIST_ITER_ADDR -syn keyword xsMacro PERL_ARGS_ASSERT_GET_INVLIST_LEN_ADDR -syn keyword xsMacro PERL_ARGS_ASSERT_GET_INVLIST_VERSION_ID_ADDR -syn keyword xsMacro PERL_ARGS_ASSERT_GET_INVLIST_ZERO_ADDR +syn keyword xsMacro PERL_ARGS_ASSERT_GET_INVLIST_OFFSET_ADDR +syn keyword xsMacro PERL_ARGS_ASSERT_GET_INVLIST_PREVIOUS_INDEX_ADDR syn keyword xsMacro PERL_ARGS_ASSERT_GET_MSTATS PERL_ARGS_ASSERT_GET_NUM syn keyword xsMacro PERL_ARGS_ASSERT_GET_SV PERL_ARGS_ASSERT_GLOB_2NUMBER -syn keyword xsMacro PERL_ARGS_ASSERT_GLOB_ASSIGN_GLOB -syn keyword xsMacro PERL_ARGS_ASSERT_GLOB_ASSIGN_REF PERL_ARGS_ASSERT_GP_DUP -syn keyword xsMacro PERL_ARGS_ASSERT_GROK_BIN PERL_ARGS_ASSERT_GROK_BSLASH_O -syn keyword xsMacro PERL_ARGS_ASSERT_GROK_HEX PERL_ARGS_ASSERT_GROK_NUMBER +syn keyword xsMacro PERL_ARGS_ASSERT_GLOB_ASSIGN_GLOB PERL_ARGS_ASSERT_GP_DUP +syn keyword xsMacro PERL_ARGS_ASSERT_GROK_ATOUV PERL_ARGS_ASSERT_GROK_BIN +syn keyword xsMacro PERL_ARGS_ASSERT_GROK_BSLASH_N +syn keyword xsMacro PERL_ARGS_ASSERT_GROK_BSLASH_O +syn keyword xsMacro PERL_ARGS_ASSERT_GROK_BSLASH_X PERL_ARGS_ASSERT_GROK_HEX +syn keyword xsMacro PERL_ARGS_ASSERT_GROK_INFNAN PERL_ARGS_ASSERT_GROK_NUMBER +syn keyword xsMacro PERL_ARGS_ASSERT_GROK_NUMBER_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT_GROK_NUMERIC_RADIX syn keyword xsMacro PERL_ARGS_ASSERT_GROK_OCT PERL_ARGS_ASSERT_GROUP_END syn keyword xsMacro PERL_ARGS_ASSERT_GV_AMUPDATE syn keyword xsMacro PERL_ARGS_ASSERT_GV_AUTOLOAD_PV syn keyword xsMacro PERL_ARGS_ASSERT_GV_AUTOLOAD_PVN syn keyword xsMacro PERL_ARGS_ASSERT_GV_AUTOLOAD_SV PERL_ARGS_ASSERT_GV_CHECK -syn keyword xsMacro PERL_ARGS_ASSERT_GV_CONST_SV PERL_ARGS_ASSERT_GV_DUMP +syn keyword xsMacro PERL_ARGS_ASSERT_GV_CONST_SV syn keyword xsMacro PERL_ARGS_ASSERT_GV_EFULLNAME syn keyword xsMacro PERL_ARGS_ASSERT_GV_EFULLNAME3 -syn keyword xsMacro PERL_ARGS_ASSERT_GV_EFULLNAME4 PERL_ARGS_ASSERT_GV_ENAME +syn keyword xsMacro PERL_ARGS_ASSERT_GV_EFULLNAME4 syn keyword xsMacro PERL_ARGS_ASSERT_GV_FETCHFILE syn keyword xsMacro PERL_ARGS_ASSERT_GV_FETCHFILE_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT_GV_FETCHMETHOD @@ -1746,20 +1973,24 @@ syn keyword xsMacro PERL_ARGS_ASSERT_GV_FETCHPV syn keyword xsMacro PERL_ARGS_ASSERT_GV_FETCHPVN_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT_GV_FETCHSV PERL_ARGS_ASSERT_GV_FULLNAME syn keyword xsMacro PERL_ARGS_ASSERT_GV_FULLNAME3 -syn keyword xsMacro PERL_ARGS_ASSERT_GV_FULLNAME4 -syn keyword xsMacro PERL_ARGS_ASSERT_GV_GET_SUPER_PKG -syn keyword xsMacro PERL_ARGS_ASSERT_GV_INIT_PV PERL_ARGS_ASSERT_GV_INIT_PVN -syn keyword xsMacro PERL_ARGS_ASSERT_GV_INIT_SV +syn keyword xsMacro PERL_ARGS_ASSERT_GV_FULLNAME4 PERL_ARGS_ASSERT_GV_INIT_PV +syn keyword xsMacro PERL_ARGS_ASSERT_GV_INIT_PVN PERL_ARGS_ASSERT_GV_INIT_SV syn keyword xsMacro PERL_ARGS_ASSERT_GV_INIT_SVTYPE +syn keyword xsMacro PERL_ARGS_ASSERT_GV_IS_IN_MAIN +syn keyword xsMacro PERL_ARGS_ASSERT_GV_MAGICALIZE syn keyword xsMacro PERL_ARGS_ASSERT_GV_MAGICALIZE_ISA -syn keyword xsMacro PERL_ARGS_ASSERT_GV_MAGICALIZE_OVERLOAD -syn keyword xsMacro PERL_ARGS_ASSERT_GV_NAME_SET PERL_ARGS_ASSERT_GV_STASHPV -syn keyword xsMacro PERL_ARGS_ASSERT_GV_STASHPVN PERL_ARGS_ASSERT_GV_STASHSV +syn keyword xsMacro PERL_ARGS_ASSERT_GV_NAME_SET PERL_ARGS_ASSERT_GV_OVERRIDE +syn keyword xsMacro PERL_ARGS_ASSERT_GV_SETREF PERL_ARGS_ASSERT_GV_STASHPV +syn keyword xsMacro PERL_ARGS_ASSERT_GV_STASHPVN +syn keyword xsMacro PERL_ARGS_ASSERT_GV_STASHPVN_INTERNAL +syn keyword xsMacro PERL_ARGS_ASSERT_GV_STASHSV syn keyword xsMacro PERL_ARGS_ASSERT_GV_TRY_DOWNGRADE +syn keyword xsMacro PERL_ARGS_ASSERT_HANDLE_REGEX_SETS syn keyword xsMacro PERL_ARGS_ASSERT_HEK_DUP PERL_ARGS_ASSERT_HE_DUP syn keyword xsMacro PERL_ARGS_ASSERT_HFREEENTRIES syn keyword xsMacro PERL_ARGS_ASSERT_HFREE_NEXT_ENTRY PERL_ARGS_ASSERT_HSPLIT syn keyword xsMacro PERL_ARGS_ASSERT_HV_ASSERT PERL_ARGS_ASSERT_HV_AUXINIT +syn keyword xsMacro PERL_ARGS_ASSERT_HV_AUXINIT_INTERNAL syn keyword xsMacro PERL_ARGS_ASSERT_HV_BACKREFERENCES_P syn keyword xsMacro PERL_ARGS_ASSERT_HV_CLEAR_PLACEHOLDERS syn keyword xsMacro PERL_ARGS_ASSERT_HV_COMMON_KEY_LEN @@ -1786,9 +2017,9 @@ syn keyword xsMacro PERL_ARGS_ASSERT_HV_NOTALLOWED syn keyword xsMacro PERL_ARGS_ASSERT_HV_PLACEHOLDERS_GET syn keyword xsMacro PERL_ARGS_ASSERT_HV_PLACEHOLDERS_P syn keyword xsMacro PERL_ARGS_ASSERT_HV_PLACEHOLDERS_SET -syn keyword xsMacro PERL_ARGS_ASSERT_HV_RITER_P PERL_ARGS_ASSERT_HV_RITER_SET -syn keyword xsMacro PERL_ARGS_ASSERT_HV_SCALAR PERL_ARGS_ASSERT_INCLINE -syn keyword xsMacro PERL_ARGS_ASSERT_INCPUSH +syn keyword xsMacro PERL_ARGS_ASSERT_HV_RAND_SET PERL_ARGS_ASSERT_HV_RITER_P +syn keyword xsMacro PERL_ARGS_ASSERT_HV_RITER_SET PERL_ARGS_ASSERT_HV_SCALAR +syn keyword xsMacro PERL_ARGS_ASSERT_INCLINE PERL_ARGS_ASSERT_INCPUSH syn keyword xsMacro PERL_ARGS_ASSERT_INCPUSH_IF_EXISTS syn keyword xsMacro PERL_ARGS_ASSERT_INCPUSH_USE_SEP syn keyword xsMacro PERL_ARGS_ASSERT_INIT_ARGV_SYMBOLS @@ -1799,21 +2030,32 @@ syn keyword xsMacro PERL_ARGS_ASSERT_INTUIT_MORE syn keyword xsMacro PERL_ARGS_ASSERT_INVLIST_ARRAY syn keyword xsMacro PERL_ARGS_ASSERT_INVLIST_CLONE syn keyword xsMacro PERL_ARGS_ASSERT_INVLIST_EXTEND +syn keyword xsMacro PERL_ARGS_ASSERT_INVLIST_HIGHEST +syn keyword xsMacro PERL_ARGS_ASSERT_INVLIST_IS_ITERATING +syn keyword xsMacro PERL_ARGS_ASSERT_INVLIST_ITERFINISH syn keyword xsMacro PERL_ARGS_ASSERT_INVLIST_ITERINIT syn keyword xsMacro PERL_ARGS_ASSERT_INVLIST_ITERNEXT -syn keyword xsMacro PERL_ARGS_ASSERT_INVLIST_LEN PERL_ARGS_ASSERT_INVLIST_MAX -syn keyword xsMacro PERL_ARGS_ASSERT_INVLIST_SEARCH +syn keyword xsMacro PERL_ARGS_ASSERT_INVLIST_MAX +syn keyword xsMacro PERL_ARGS_ASSERT_INVLIST_PREVIOUS_INDEX syn keyword xsMacro PERL_ARGS_ASSERT_INVLIST_SET_LEN +syn keyword xsMacro PERL_ARGS_ASSERT_INVLIST_SET_PREVIOUS_INDEX syn keyword xsMacro PERL_ARGS_ASSERT_INVLIST_TRIM PERL_ARGS_ASSERT_IO_CLOSE -syn keyword xsMacro PERL_ARGS_ASSERT_ISA_LOOKUP PERL_ARGS_ASSERT_IS_AN_INT -syn keyword xsMacro PERL_ARGS_ASSERT_IS_ASCII_STRING +syn keyword xsMacro PERL_ARGS_ASSERT_ISALNUM_LAZY PERL_ARGS_ASSERT_ISA_LOOKUP +syn keyword xsMacro PERL_ARGS_ASSERT_ISFOO_UTF8_LC +syn keyword xsMacro PERL_ARGS_ASSERT_ISIDFIRST_LAZY +syn keyword xsMacro PERL_ARGS_ASSERT_ISINFNANSV PERL_ARGS_ASSERT_ISSB +syn keyword xsMacro PERL_ARGS_ASSERT_ISWB PERL_ARGS_ASSERT_IS_AN_INT syn keyword xsMacro PERL_ARGS_ASSERT_IS_HANDLE_CONSTRUCTOR +syn keyword xsMacro PERL_ARGS_ASSERT_IS_INVARIANT_STRING +syn keyword xsMacro PERL_ARGS_ASSERT_IS_SAFE_SYSCALL +syn keyword xsMacro PERL_ARGS_ASSERT_IS_SSC_WORTH_IT syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_ALNUM +syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_ALNUMC syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_ALPHA syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_ASCII +syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_BLANK syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_CHAR syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_CHAR_BUF -syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_CHAR_SLOW syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_CNTRL syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_COMMON syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_DIGIT @@ -1834,19 +2076,10 @@ syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_STRING_LOCLEN syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_UPPER syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_XDIGIT syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_XIDCONT -syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_XIDFIRST -syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_X_BEGIN -syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_X_EXTEND -syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_X_L -syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_X_LV -syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_X_LVT -syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_X_LV_LVT_V -syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_X_NON_HANGUL -syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_X_PREPEND -syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_X_T PERL_ARGS_ASSERT_IS_UTF8_X_V -syn keyword xsMacro PERL_ARGS_ASSERT_JMAYBE PERL_ARGS_ASSERT_JOIN_EXACT -syn keyword xsMacro PERL_ARGS_ASSERT_KEYWORD +syn keyword xsMacro PERL_ARGS_ASSERT_IS_UTF8_XIDFIRST PERL_ARGS_ASSERT_JMAYBE +syn keyword xsMacro PERL_ARGS_ASSERT_JOIN_EXACT PERL_ARGS_ASSERT_KEYWORD syn keyword xsMacro PERL_ARGS_ASSERT_KEYWORD_PLUGIN_STANDARD +syn keyword xsMacro PERL_ARGS_ASSERT_LEAVE_COMMON syn keyword xsMacro PERL_ARGS_ASSERT_LEX_DISCARD_TO syn keyword xsMacro PERL_ARGS_ASSERT_LEX_READ_TO syn keyword xsMacro PERL_ARGS_ASSERT_LEX_STUFF_PV @@ -1857,6 +2090,7 @@ syn keyword xsMacro PERL_ARGS_ASSERT_LOAD_MODULE_NOCONTEXT syn keyword xsMacro PERL_ARGS_ASSERT_LOCALIZE syn keyword xsMacro PERL_ARGS_ASSERT_LOOKS_LIKE_BOOL syn keyword xsMacro PERL_ARGS_ASSERT_LOOKS_LIKE_NUMBER PERL_ARGS_ASSERT_LOP +syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_CLEARARYLEN_P syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_CLEARENV syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_CLEARHINT syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_CLEARHINTS @@ -1864,11 +2098,13 @@ syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_CLEARISA syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_CLEARPACK syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_CLEARSIG syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_CLEAR_ALL_ENV +syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_COPYCALLCHECKER syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_EXISTSPACK syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_FREEARYLEN_P syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_FREEOVRLD syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_GET syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_GETARYLEN +syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_GETDEBUGVAR syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_GETDEFELEM syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_GETNKEYS syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_GETPACK @@ -1879,7 +2115,6 @@ syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_GETTAINT syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_GETUVAR syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_GETVEC syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_KILLBACKREFS -syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_LEN syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_METHCALL syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_METHCALL1 syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_METHPACK @@ -1889,14 +2124,15 @@ syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_REGDATUM_GET syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_REGDATUM_SET syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_SCALARPACK syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_SET -syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_SETAMAGIC syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_SETARYLEN syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_SETCOLLXFRM syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_SETDBLINE +syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_SETDEBUGVAR syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_SETDEFELEM syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_SETENV syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_SETHINT syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_SETISA +syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_SETLVREF syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_SETMGLOB syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_SETNKEYS syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_SETPACK @@ -1908,27 +2144,27 @@ syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_SETTAINT syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_SETUTF8 syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_SETUVAR syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_SETVEC -syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_SETVSTRING syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_SET_ALL_ENV syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_SIZEPACK syn keyword xsMacro PERL_ARGS_ASSERT_MAGIC_WIPEPACK syn keyword xsMacro PERL_ARGS_ASSERT_MAKE_MATCHER PERL_ARGS_ASSERT_MAKE_TRIE -syn keyword xsMacro PERL_ARGS_ASSERT_MAKE_TRIE_FAILTABLE syn keyword xsMacro PERL_ARGS_ASSERT_MALLOCED_SIZE syn keyword xsMacro PERL_ARGS_ASSERT_MATCHER_MATCHES_SV syn keyword xsMacro PERL_ARGS_ASSERT_MAYBERELOCATE +syn keyword xsMacro PERL_ARGS_ASSERT_MAYBE_MULTIMAGIC_GV syn keyword xsMacro PERL_ARGS_ASSERT_MEASURE_STRUCT syn keyword xsMacro PERL_ARGS_ASSERT_MEM_COLLXFRM syn keyword xsMacro PERL_ARGS_ASSERT_MEM_LOG_COMMON PERL_ARGS_ASSERT_MESS syn keyword xsMacro PERL_ARGS_ASSERT_MESS_NOCONTEXT PERL_ARGS_ASSERT_MESS_SV -syn keyword xsMacro PERL_ARGS_ASSERT_METHOD_COMMON PERL_ARGS_ASSERT_MG_CLEAR -syn keyword xsMacro PERL_ARGS_ASSERT_MG_COPY PERL_ARGS_ASSERT_MG_DUP +syn keyword xsMacro PERL_ARGS_ASSERT_MG_CLEAR PERL_ARGS_ASSERT_MG_COPY +syn keyword xsMacro PERL_ARGS_ASSERT_MG_DUP PERL_ARGS_ASSERT_MG_FIND_MGLOB syn keyword xsMacro PERL_ARGS_ASSERT_MG_FREE PERL_ARGS_ASSERT_MG_FREE_TYPE syn keyword xsMacro PERL_ARGS_ASSERT_MG_GET PERL_ARGS_ASSERT_MG_LENGTH syn keyword xsMacro PERL_ARGS_ASSERT_MG_LOCALIZE PERL_ARGS_ASSERT_MG_MAGICAL syn keyword xsMacro PERL_ARGS_ASSERT_MG_SET PERL_ARGS_ASSERT_MG_SIZE syn keyword xsMacro PERL_ARGS_ASSERT_MINI_MKTIME syn keyword xsMacro PERL_ARGS_ASSERT_MORESWITCHES +syn keyword xsMacro PERL_ARGS_ASSERT_MOVE_PROTO_ATTR syn keyword xsMacro PERL_ARGS_ASSERT_MRO_CLEAN_ISAREV syn keyword xsMacro PERL_ARGS_ASSERT_MRO_GATHER_AND_RENAME syn keyword xsMacro PERL_ARGS_ASSERT_MRO_GET_FROM_NAME @@ -1944,29 +2180,35 @@ syn keyword xsMacro PERL_ARGS_ASSERT_MRO_REGISTER syn keyword xsMacro PERL_ARGS_ASSERT_MRO_SET_MRO syn keyword xsMacro PERL_ARGS_ASSERT_MRO_SET_PRIVATE_DATA syn keyword xsMacro PERL_ARGS_ASSERT_MUL128 -syn keyword xsMacro PERL_ARGS_ASSERT_MUNGE_QWLIST_TO_PAREN_LIST +syn keyword xsMacro PERL_ARGS_ASSERT_MULTIDEREF_STRINGIFY syn keyword xsMacro PERL_ARGS_ASSERT_MY_ATOF PERL_ARGS_ASSERT_MY_ATOF2 syn keyword xsMacro PERL_ARGS_ASSERT_MY_ATTRS PERL_ARGS_ASSERT_MY_BCOPY +syn keyword xsMacro PERL_ARGS_ASSERT_MY_BYTES_TO_UTF8 syn keyword xsMacro PERL_ARGS_ASSERT_MY_BZERO PERL_ARGS_ASSERT_MY_CXT_INDEX syn keyword xsMacro PERL_ARGS_ASSERT_MY_CXT_INIT PERL_ARGS_ASSERT_MY_KID syn keyword xsMacro PERL_ARGS_ASSERT_MY_MEMCMP PERL_ARGS_ASSERT_MY_MEMSET syn keyword xsMacro PERL_ARGS_ASSERT_MY_POPEN PERL_ARGS_ASSERT_MY_POPEN_LIST syn keyword xsMacro PERL_ARGS_ASSERT_MY_SNPRINTF PERL_ARGS_ASSERT_MY_SPRINTF -syn keyword xsMacro PERL_ARGS_ASSERT_MY_STRFTIME PERL_ARGS_ASSERT_MY_SWABN +syn keyword xsMacro PERL_ARGS_ASSERT_MY_STRFTIME syn keyword xsMacro PERL_ARGS_ASSERT_MY_VSNPRINTF PERL_ARGS_ASSERT_NEED_UTF8 syn keyword xsMacro PERL_ARGS_ASSERT_NEWAVREF PERL_ARGS_ASSERT_NEWCONDOP syn keyword xsMacro PERL_ARGS_ASSERT_NEWFOROP PERL_ARGS_ASSERT_NEWGIVENOP syn keyword xsMacro PERL_ARGS_ASSERT_NEWGIVWHENOP PERL_ARGS_ASSERT_NEWGP syn keyword xsMacro PERL_ARGS_ASSERT_NEWGVGEN_FLAGS PERL_ARGS_ASSERT_NEWGVOP syn keyword xsMacro PERL_ARGS_ASSERT_NEWHVREF PERL_ARGS_ASSERT_NEWLOGOP -syn keyword xsMacro PERL_ARGS_ASSERT_NEWLOOPEX PERL_ARGS_ASSERT_NEWMADSV -syn keyword xsMacro PERL_ARGS_ASSERT_NEWPADOP PERL_ARGS_ASSERT_NEWPROG -syn keyword xsMacro PERL_ARGS_ASSERT_NEWRANGE PERL_ARGS_ASSERT_NEWRV -syn keyword xsMacro PERL_ARGS_ASSERT_NEWRV_NOINC PERL_ARGS_ASSERT_NEWSVOP -syn keyword xsMacro PERL_ARGS_ASSERT_NEWSVPVF +syn keyword xsMacro PERL_ARGS_ASSERT_NEWLOOPEX PERL_ARGS_ASSERT_NEWMETHOP +syn keyword xsMacro PERL_ARGS_ASSERT_NEWMETHOP_NAMED +syn keyword xsMacro PERL_ARGS_ASSERT_NEWMYSUB +syn keyword xsMacro PERL_ARGS_ASSERT_NEWPADNAMEOUTER +syn keyword xsMacro PERL_ARGS_ASSERT_NEWPADNAMEPVN PERL_ARGS_ASSERT_NEWPADOP +syn keyword xsMacro PERL_ARGS_ASSERT_NEWPROG PERL_ARGS_ASSERT_NEWRANGE +syn keyword xsMacro PERL_ARGS_ASSERT_NEWRV PERL_ARGS_ASSERT_NEWRV_NOINC +syn keyword xsMacro PERL_ARGS_ASSERT_NEWSTUB PERL_ARGS_ASSERT_NEWSVAVDEFELEM +syn keyword xsMacro PERL_ARGS_ASSERT_NEWSVOP PERL_ARGS_ASSERT_NEWSVPVF syn keyword xsMacro PERL_ARGS_ASSERT_NEWSVPVF_NOCONTEXT syn keyword xsMacro PERL_ARGS_ASSERT_NEWSVREF PERL_ARGS_ASSERT_NEWSVRV syn keyword xsMacro PERL_ARGS_ASSERT_NEWWHENOP PERL_ARGS_ASSERT_NEWXS +syn keyword xsMacro PERL_ARGS_ASSERT_NEWXS_DEFFILE syn keyword xsMacro PERL_ARGS_ASSERT_NEWXS_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT_NEWXS_LEN_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT_NEW_CONSTANT PERL_ARGS_ASSERT_NEW_CTYPE @@ -1974,24 +2216,39 @@ syn keyword xsMacro PERL_ARGS_ASSERT_NEW_LOGOP PERL_ARGS_ASSERT_NEW_VERSION syn keyword xsMacro PERL_ARGS_ASSERT_NEW_WARNINGS_BITFIELD syn keyword xsMacro PERL_ARGS_ASSERT_NEXTARGV PERL_ARGS_ASSERT_NEXTCHAR syn keyword xsMacro PERL_ARGS_ASSERT_NEXT_SYMBOL PERL_ARGS_ASSERT_NINSTR -syn keyword xsMacro PERL_ARGS_ASSERT_NOT_A_NUMBER +syn keyword xsMacro PERL_ARGS_ASSERT_NOPERL_DIE PERL_ARGS_ASSERT_NOT_A_NUMBER +syn keyword xsMacro PERL_ARGS_ASSERT_NOT_INCREMENTABLE syn keyword xsMacro PERL_ARGS_ASSERT_NO_BAREWORD_ALLOWED syn keyword xsMacro PERL_ARGS_ASSERT_NO_FH_ALLOWED PERL_ARGS_ASSERT_NO_OP syn keyword xsMacro PERL_ARGS_ASSERT_OOPSAV PERL_ARGS_ASSERT_OOPSHV -syn keyword xsMacro PERL_ARGS_ASSERT_OPEN_SCRIPT -syn keyword xsMacro PERL_ARGS_ASSERT_OPT_SCALARHV PERL_ARGS_ASSERT_OP_CLEAR +syn keyword xsMacro PERL_ARGS_ASSERT_OPENN_CLEANUP +syn keyword xsMacro PERL_ARGS_ASSERT_OPENN_SETUP PERL_ARGS_ASSERT_OPEN_SCRIPT +syn keyword xsMacro PERL_ARGS_ASSERT_OPMETHOD_STASH +syn keyword xsMacro PERL_ARGS_ASSERT_OPSLAB_FORCE_FREE +syn keyword xsMacro PERL_ARGS_ASSERT_OPSLAB_FREE +syn keyword xsMacro PERL_ARGS_ASSERT_OPSLAB_FREE_NOPAD +syn keyword xsMacro PERL_ARGS_ASSERT_OP_CLEAR syn keyword xsMacro PERL_ARGS_ASSERT_OP_CONTEXTUALIZE syn keyword xsMacro PERL_ARGS_ASSERT_OP_DUMP PERL_ARGS_ASSERT_OP_INTEGERIZE syn keyword xsMacro PERL_ARGS_ASSERT_OP_LINKLIST PERL_ARGS_ASSERT_OP_NULL -syn keyword xsMacro PERL_ARGS_ASSERT_OP_REFCNT_DEC -syn keyword xsMacro PERL_ARGS_ASSERT_OP_STD_INIT PERL_ARGS_ASSERT_OP_XMLDUMP -syn keyword xsMacro PERL_ARGS_ASSERT_PACKAGE PERL_ARGS_ASSERT_PACKAGE_VERSION +syn keyword xsMacro PERL_ARGS_ASSERT_OP_PARENT PERL_ARGS_ASSERT_OP_REFCNT_DEC +syn keyword xsMacro PERL_ARGS_ASSERT_OP_RELOCATE_SV +syn keyword xsMacro PERL_ARGS_ASSERT_OP_STD_INIT PERL_ARGS_ASSERT_PACKAGE +syn keyword xsMacro PERL_ARGS_ASSERT_PACKAGE_VERSION syn keyword xsMacro PERL_ARGS_ASSERT_PACKLIST PERL_ARGS_ASSERT_PACK_CAT syn keyword xsMacro PERL_ARGS_ASSERT_PACK_REC PERL_ARGS_ASSERT_PADLIST_DUP +syn keyword xsMacro PERL_ARGS_ASSERT_PADLIST_STORE +syn keyword xsMacro PERL_ARGS_ASSERT_PADNAMELIST_DUP +syn keyword xsMacro PERL_ARGS_ASSERT_PADNAMELIST_FETCH +syn keyword xsMacro PERL_ARGS_ASSERT_PADNAMELIST_FREE +syn keyword xsMacro PERL_ARGS_ASSERT_PADNAMELIST_STORE +syn keyword xsMacro PERL_ARGS_ASSERT_PADNAME_DUP +syn keyword xsMacro PERL_ARGS_ASSERT_PADNAME_FREE syn keyword xsMacro PERL_ARGS_ASSERT_PAD_ADD_ANON syn keyword xsMacro PERL_ARGS_ASSERT_PAD_ADD_NAME_PV syn keyword xsMacro PERL_ARGS_ASSERT_PAD_ADD_NAME_PVN syn keyword xsMacro PERL_ARGS_ASSERT_PAD_ADD_NAME_SV +syn keyword xsMacro PERL_ARGS_ASSERT_PAD_ADD_WEAKREF syn keyword xsMacro PERL_ARGS_ASSERT_PAD_ALLOC_NAME syn keyword xsMacro PERL_ARGS_ASSERT_PAD_CHECK_DUP syn keyword xsMacro PERL_ARGS_ASSERT_PAD_FINDLEX @@ -1999,11 +2256,14 @@ syn keyword xsMacro PERL_ARGS_ASSERT_PAD_FINDMY_PV syn keyword xsMacro PERL_ARGS_ASSERT_PAD_FINDMY_PVN syn keyword xsMacro PERL_ARGS_ASSERT_PAD_FINDMY_SV syn keyword xsMacro PERL_ARGS_ASSERT_PAD_FIXUP_INNER_ANONS -syn keyword xsMacro PERL_ARGS_ASSERT_PAD_PEG PERL_ARGS_ASSERT_PAD_PUSH -syn keyword xsMacro PERL_ARGS_ASSERT_PAD_SETSV PERL_ARGS_ASSERT_PARSER_DUP -syn keyword xsMacro PERL_ARGS_ASSERT_PARSER_FREE +syn keyword xsMacro PERL_ARGS_ASSERT_PAD_PUSH PERL_ARGS_ASSERT_PAD_SETSV +syn keyword xsMacro PERL_ARGS_ASSERT_PARSER_DUP PERL_ARGS_ASSERT_PARSER_FREE +syn keyword xsMacro PERL_ARGS_ASSERT_PARSER_FREE_NEXTTOKE_OPS +syn keyword xsMacro PERL_ARGS_ASSERT_PARSE_GV_STASH_NAME +syn keyword xsMacro PERL_ARGS_ASSERT_PARSE_IDENT +syn keyword xsMacro PERL_ARGS_ASSERT_PARSE_LPAREN_QUESTION_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT_PARSE_UNICODE_OPTS -syn keyword xsMacro PERL_ARGS_ASSERT_PATH_IS_ABSOLUTE +syn keyword xsMacro PERL_ARGS_ASSERT_PATH_IS_SEARCHABLE syn keyword xsMacro PERL_ARGS_ASSERT_PERLIO_READ syn keyword xsMacro PERL_ARGS_ASSERT_PERLIO_UNREAD syn keyword xsMacro PERL_ARGS_ASSERT_PERLIO_WRITE @@ -2015,6 +2275,7 @@ syn keyword xsMacro PERL_ARGS_ASSERT_PERL_DESTRUCT PERL_ARGS_ASSERT_PERL_FREE syn keyword xsMacro PERL_ARGS_ASSERT_PERL_PARSE PERL_ARGS_ASSERT_PERL_RUN syn keyword xsMacro PERL_ARGS_ASSERT_PMRUNTIME PERL_ARGS_ASSERT_PMTRANS syn keyword xsMacro PERL_ARGS_ASSERT_PM_DESCRIPTION +syn keyword xsMacro PERL_ARGS_ASSERT_POPULATE_ANYOF_FROM_INVLIST syn keyword xsMacro PERL_ARGS_ASSERT_POPULATE_ISA PERL_ARGS_ASSERT_PREGCOMP syn keyword xsMacro PERL_ARGS_ASSERT_PREGEXEC PERL_ARGS_ASSERT_PREGFREE2 syn keyword xsMacro PERL_ARGS_ASSERT_PRESCAN_VERSION @@ -2025,10 +2286,14 @@ syn keyword xsMacro PERL_ARGS_ASSERT_PTR_TABLE_FETCH syn keyword xsMacro PERL_ARGS_ASSERT_PTR_TABLE_FIND syn keyword xsMacro PERL_ARGS_ASSERT_PTR_TABLE_SPLIT syn keyword xsMacro PERL_ARGS_ASSERT_PTR_TABLE_STORE -syn keyword xsMacro PERL_ARGS_ASSERT_PUT_BYTE PERL_ARGS_ASSERT_PV_DISPLAY +syn keyword xsMacro PERL_ARGS_ASSERT_PUT_CHARCLASS_BITMAP_INNARDS +syn keyword xsMacro PERL_ARGS_ASSERT_PUT_CODE_POINT +syn keyword xsMacro PERL_ARGS_ASSERT_PUT_RANGE PERL_ARGS_ASSERT_PV_DISPLAY syn keyword xsMacro PERL_ARGS_ASSERT_PV_ESCAPE PERL_ARGS_ASSERT_PV_PRETTY syn keyword xsMacro PERL_ARGS_ASSERT_PV_UNI_DISPLAY PERL_ARGS_ASSERT_QERROR syn keyword xsMacro PERL_ARGS_ASSERT_QSORTSVU +syn keyword xsMacro PERL_ARGS_ASSERT_QUADMATH_FORMAT_NEEDED +syn keyword xsMacro PERL_ARGS_ASSERT_QUADMATH_FORMAT_SINGLE syn keyword xsMacro PERL_ARGS_ASSERT_REENTRANT_RETRY syn keyword xsMacro PERL_ARGS_ASSERT_REFCOUNTED_HE_FETCH_PV syn keyword xsMacro PERL_ARGS_ASSERT_REFCOUNTED_HE_FETCH_PVN @@ -2038,9 +2303,10 @@ syn keyword xsMacro PERL_ARGS_ASSERT_REFCOUNTED_HE_NEW_PVN syn keyword xsMacro PERL_ARGS_ASSERT_REFCOUNTED_HE_NEW_SV syn keyword xsMacro PERL_ARGS_ASSERT_REFCOUNTED_HE_VALUE syn keyword xsMacro PERL_ARGS_ASSERT_REFTO PERL_ARGS_ASSERT_REG -syn keyword xsMacro PERL_ARGS_ASSERT_REGANODE PERL_ARGS_ASSERT_REGATOM -syn keyword xsMacro PERL_ARGS_ASSERT_REGBRANCH PERL_ARGS_ASSERT_REGCLASS -syn keyword xsMacro PERL_ARGS_ASSERT_REGCLASS_SWASH PERL_ARGS_ASSERT_REGCPPOP +syn keyword xsMacro PERL_ARGS_ASSERT_REG2LANODE PERL_ARGS_ASSERT_REGANODE +syn keyword xsMacro PERL_ARGS_ASSERT_REGATOM PERL_ARGS_ASSERT_REGBRANCH +syn keyword xsMacro PERL_ARGS_ASSERT_REGCLASS PERL_ARGS_ASSERT_REGCLASS_SWASH +syn keyword xsMacro PERL_ARGS_ASSERT_REGCPPOP PERL_ARGS_ASSERT_REGCPPUSH syn keyword xsMacro PERL_ARGS_ASSERT_REGCURLY PERL_ARGS_ASSERT_REGDUMP syn keyword xsMacro PERL_ARGS_ASSERT_REGDUPE_INTERNAL syn keyword xsMacro PERL_ARGS_ASSERT_REGEXEC_FLAGS @@ -2048,13 +2314,12 @@ syn keyword xsMacro PERL_ARGS_ASSERT_REGFREE_INTERNAL syn keyword xsMacro PERL_ARGS_ASSERT_REGHOP3 PERL_ARGS_ASSERT_REGHOP4 syn keyword xsMacro PERL_ARGS_ASSERT_REGHOPMAYBE3 PERL_ARGS_ASSERT_REGINCLASS syn keyword xsMacro PERL_ARGS_ASSERT_REGINSERT PERL_ARGS_ASSERT_REGMATCH +syn keyword xsMacro PERL_ARGS_ASSERT_REGNODE_GUTS PERL_ARGS_ASSERT_REGPATWS syn keyword xsMacro PERL_ARGS_ASSERT_REGPIECE PERL_ARGS_ASSERT_REGPPOSIXCC syn keyword xsMacro PERL_ARGS_ASSERT_REGPROP PERL_ARGS_ASSERT_REGREPEAT syn keyword xsMacro PERL_ARGS_ASSERT_REGTAIL PERL_ARGS_ASSERT_REGTAIL_STUDY -syn keyword xsMacro PERL_ARGS_ASSERT_REGTRY PERL_ARGS_ASSERT_REGUNI -syn keyword xsMacro PERL_ARGS_ASSERT_REGWHITE +syn keyword xsMacro PERL_ARGS_ASSERT_REGTRY syn keyword xsMacro PERL_ARGS_ASSERT_REG_CHECK_NAMED_BUFF_MATCHED -syn keyword xsMacro PERL_ARGS_ASSERT_REG_NAMEDSEQ syn keyword xsMacro PERL_ARGS_ASSERT_REG_NAMED_BUFF syn keyword xsMacro PERL_ARGS_ASSERT_REG_NAMED_BUFF_ALL syn keyword xsMacro PERL_ARGS_ASSERT_REG_NAMED_BUFF_EXISTS @@ -2079,7 +2344,8 @@ syn keyword xsMacro PERL_ARGS_ASSERT_RE_COMPILE PERL_ARGS_ASSERT_RE_CROAK2 syn keyword xsMacro PERL_ARGS_ASSERT_RE_DUP_GUTS syn keyword xsMacro PERL_ARGS_ASSERT_RE_INTUIT_START syn keyword xsMacro PERL_ARGS_ASSERT_RE_INTUIT_STRING -syn keyword xsMacro PERL_ARGS_ASSERT_RNINSTR PERL_ARGS_ASSERT_RSIGNAL_SAVE +syn keyword xsMacro PERL_ARGS_ASSERT_RE_OP_COMPILE PERL_ARGS_ASSERT_RNINSTR +syn keyword xsMacro PERL_ARGS_ASSERT_RSIGNAL_SAVE syn keyword xsMacro PERL_ARGS_ASSERT_RUN_USER_FILTER syn keyword xsMacro PERL_ARGS_ASSERT_RV2CV_OP_CV PERL_ARGS_ASSERT_RVPV_DUP syn keyword xsMacro PERL_ARGS_ASSERT_RXRES_FREE @@ -2088,6 +2354,7 @@ syn keyword xsMacro PERL_ARGS_ASSERT_RXRES_SAVE PERL_ARGS_ASSERT_SAME_DIRENT syn keyword xsMacro PERL_ARGS_ASSERT_SAVESHAREDSVPV PERL_ARGS_ASSERT_SAVESVPV syn keyword xsMacro PERL_ARGS_ASSERT_SAVE_ADELETE syn keyword xsMacro PERL_ARGS_ASSERT_SAVE_AELEM_FLAGS +syn keyword xsMacro PERL_ARGS_ASSERT_SAVE_ALIASED_SV syn keyword xsMacro PERL_ARGS_ASSERT_SAVE_APTR PERL_ARGS_ASSERT_SAVE_ARY syn keyword xsMacro PERL_ARGS_ASSERT_SAVE_BOOL PERL_ARGS_ASSERT_SAVE_CLEARSV syn keyword xsMacro PERL_ARGS_ASSERT_SAVE_DELETE @@ -2103,15 +2370,16 @@ syn keyword xsMacro PERL_ARGS_ASSERT_SAVE_I32 PERL_ARGS_ASSERT_SAVE_I8 syn keyword xsMacro PERL_ARGS_ASSERT_SAVE_INT PERL_ARGS_ASSERT_SAVE_ITEM syn keyword xsMacro PERL_ARGS_ASSERT_SAVE_IV PERL_ARGS_ASSERT_SAVE_LINES syn keyword xsMacro PERL_ARGS_ASSERT_SAVE_LIST PERL_ARGS_ASSERT_SAVE_LONG -syn keyword xsMacro PERL_ARGS_ASSERT_SAVE_MAGIC +syn keyword xsMacro PERL_ARGS_ASSERT_SAVE_MAGIC_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT_SAVE_MORTALIZESV syn keyword xsMacro PERL_ARGS_ASSERT_SAVE_NOGV PERL_ARGS_ASSERT_SAVE_PPTR syn keyword xsMacro PERL_ARGS_ASSERT_SAVE_SCALAR syn keyword xsMacro PERL_ARGS_ASSERT_SAVE_SCALAR_AT syn keyword xsMacro PERL_ARGS_ASSERT_SAVE_SET_SVFLAGS syn keyword xsMacro PERL_ARGS_ASSERT_SAVE_SHARED_PVREF -syn keyword xsMacro PERL_ARGS_ASSERT_SAVE_SPTR PERL_ARGS_ASSERT_SAVE_SVREF -syn keyword xsMacro PERL_ARGS_ASSERT_SAVE_VPTR PERL_ARGS_ASSERT_SCALARBOOLEAN +syn keyword xsMacro PERL_ARGS_ASSERT_SAVE_SPTR PERL_ARGS_ASSERT_SAVE_STRLEN +syn keyword xsMacro PERL_ARGS_ASSERT_SAVE_SVREF PERL_ARGS_ASSERT_SAVE_VPTR +syn keyword xsMacro PERL_ARGS_ASSERT_SCALARBOOLEAN syn keyword xsMacro PERL_ARGS_ASSERT_SCALARVOID PERL_ARGS_ASSERT_SCAN_BIN syn keyword xsMacro PERL_ARGS_ASSERT_SCAN_COMMIT PERL_ARGS_ASSERT_SCAN_CONST syn keyword xsMacro PERL_ARGS_ASSERT_SCAN_FORMLINE @@ -2123,25 +2391,31 @@ syn keyword xsMacro PERL_ARGS_ASSERT_SCAN_PAT PERL_ARGS_ASSERT_SCAN_STR syn keyword xsMacro PERL_ARGS_ASSERT_SCAN_SUBST PERL_ARGS_ASSERT_SCAN_TRANS syn keyword xsMacro PERL_ARGS_ASSERT_SCAN_VERSION syn keyword xsMacro PERL_ARGS_ASSERT_SCAN_VSTRING PERL_ARGS_ASSERT_SCAN_WORD -syn keyword xsMacro PERL_ARGS_ASSERT_SCREAMINSTR -syn keyword xsMacro PERL_ARGS_ASSERT_SEARCH_CONST -syn keyword xsMacro PERL_ARGS_ASSERT_SET_CONTEXT -syn keyword xsMacro PERL_ARGS_ASSERT_SET_REGCLASS_BIT -syn keyword xsMacro PERL_ARGS_ASSERT_SET_REGCLASS_BIT_FOLD +syn keyword xsMacro PERL_ARGS_ASSERT_SEARCH_CONST PERL_ARGS_ASSERT_SETDEFOUT +syn keyword xsMacro PERL_ARGS_ASSERT_SET_ANYOF_ARG +syn keyword xsMacro PERL_ARGS_ASSERT_SET_CONTEXT PERL_ARGS_ASSERT_SET_PADLIST syn keyword xsMacro PERL_ARGS_ASSERT_SHARE_HEK syn keyword xsMacro PERL_ARGS_ASSERT_SHARE_HEK_FLAGS +syn keyword xsMacro PERL_ARGS_ASSERT_SHOULD_WARN_NL syn keyword xsMacro PERL_ARGS_ASSERT_SIMPLIFY_SORT PERL_ARGS_ASSERT_SI_DUP -syn keyword xsMacro PERL_ARGS_ASSERT_SKIPSPACE PERL_ARGS_ASSERT_SKIPSPACE0 -syn keyword xsMacro PERL_ARGS_ASSERT_SKIPSPACE1 PERL_ARGS_ASSERT_SKIPSPACE2 -syn keyword xsMacro PERL_ARGS_ASSERT_SLAB_FREE PERL_ARGS_ASSERT_SLAB_TO_RW -syn keyword xsMacro PERL_ARGS_ASSERT_SOFTREF2XV PERL_ARGS_ASSERT_SORTCV -syn keyword xsMacro PERL_ARGS_ASSERT_SORTCV_STACKED +syn keyword xsMacro PERL_ARGS_ASSERT_SKIPSPACE_FLAGS +syn keyword xsMacro PERL_ARGS_ASSERT_SLAB_FREE PERL_ARGS_ASSERT_SLAB_TO_RO +syn keyword xsMacro PERL_ARGS_ASSERT_SLAB_TO_RW PERL_ARGS_ASSERT_SOFTREF2XV +syn keyword xsMacro PERL_ARGS_ASSERT_SORTCV PERL_ARGS_ASSERT_SORTCV_STACKED syn keyword xsMacro PERL_ARGS_ASSERT_SORTCV_XSUB PERL_ARGS_ASSERT_SORTSV syn keyword xsMacro PERL_ARGS_ASSERT_SORTSV_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT_SPACE_JOIN_NAMES_MORTAL +syn keyword xsMacro PERL_ARGS_ASSERT_SSC_ADD_RANGE PERL_ARGS_ASSERT_SSC_AND +syn keyword xsMacro PERL_ARGS_ASSERT_SSC_ANYTHING +syn keyword xsMacro PERL_ARGS_ASSERT_SSC_CLEAR_LOCALE +syn keyword xsMacro PERL_ARGS_ASSERT_SSC_CP_AND PERL_ARGS_ASSERT_SSC_FINALIZE +syn keyword xsMacro PERL_ARGS_ASSERT_SSC_INIT +syn keyword xsMacro PERL_ARGS_ASSERT_SSC_INTERSECTION +syn keyword xsMacro PERL_ARGS_ASSERT_SSC_IS_ANYTHING +syn keyword xsMacro PERL_ARGS_ASSERT_SSC_IS_CP_POSIXL_INIT +syn keyword xsMacro PERL_ARGS_ASSERT_SSC_OR PERL_ARGS_ASSERT_SSC_UNION syn keyword xsMacro PERL_ARGS_ASSERT_SS_DUP PERL_ARGS_ASSERT_STACK_GROW syn keyword xsMacro PERL_ARGS_ASSERT_START_GLOB -syn keyword xsMacro PERL_ARGS_ASSERT_STASHPV_HVNAME_MATCH syn keyword xsMacro PERL_ARGS_ASSERT_STDIZE_LOCALE syn keyword xsMacro PERL_ARGS_ASSERT_STRIP_RETURN syn keyword xsMacro PERL_ARGS_ASSERT_STR_TO_VERSION @@ -2150,16 +2424,21 @@ syn keyword xsMacro PERL_ARGS_ASSERT_SUB_CRUSH_DEPTH syn keyword xsMacro PERL_ARGS_ASSERT_SV_2BOOL_FLAGS PERL_ARGS_ASSERT_SV_2CV syn keyword xsMacro PERL_ARGS_ASSERT_SV_2IO PERL_ARGS_ASSERT_SV_2IUV_COMMON syn keyword xsMacro PERL_ARGS_ASSERT_SV_2IUV_NON_PRESERVE -syn keyword xsMacro PERL_ARGS_ASSERT_SV_2NUM PERL_ARGS_ASSERT_SV_2PVBYTE +syn keyword xsMacro PERL_ARGS_ASSERT_SV_2IV PERL_ARGS_ASSERT_SV_2IV_FLAGS +syn keyword xsMacro PERL_ARGS_ASSERT_SV_2NUM PERL_ARGS_ASSERT_SV_2NV_FLAGS +syn keyword xsMacro PERL_ARGS_ASSERT_SV_2PV PERL_ARGS_ASSERT_SV_2PVBYTE syn keyword xsMacro PERL_ARGS_ASSERT_SV_2PVBYTE_NOLEN syn keyword xsMacro PERL_ARGS_ASSERT_SV_2PVUTF8 syn keyword xsMacro PERL_ARGS_ASSERT_SV_2PVUTF8_NOLEN -syn keyword xsMacro PERL_ARGS_ASSERT_SV_2PV_NOLEN +syn keyword xsMacro PERL_ARGS_ASSERT_SV_2PV_FLAGS +syn keyword xsMacro PERL_ARGS_ASSERT_SV_2PV_NOLEN PERL_ARGS_ASSERT_SV_2UV +syn keyword xsMacro PERL_ARGS_ASSERT_SV_2UV_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT_SV_ADD_ARENA syn keyword xsMacro PERL_ARGS_ASSERT_SV_ADD_BACKREF syn keyword xsMacro PERL_ARGS_ASSERT_SV_BACKOFF PERL_ARGS_ASSERT_SV_BLESS -syn keyword xsMacro PERL_ARGS_ASSERT_SV_CATPV PERL_ARGS_ASSERT_SV_CATPVF -syn keyword xsMacro PERL_ARGS_ASSERT_SV_CATPVF_MG +syn keyword xsMacro PERL_ARGS_ASSERT_SV_BUF_TO_RO +syn keyword xsMacro PERL_ARGS_ASSERT_SV_BUF_TO_RW PERL_ARGS_ASSERT_SV_CATPV +syn keyword xsMacro PERL_ARGS_ASSERT_SV_CATPVF PERL_ARGS_ASSERT_SV_CATPVF_MG syn keyword xsMacro PERL_ARGS_ASSERT_SV_CATPVF_MG_NOCONTEXT syn keyword xsMacro PERL_ARGS_ASSERT_SV_CATPVF_NOCONTEXT syn keyword xsMacro PERL_ARGS_ASSERT_SV_CATPVN @@ -2168,37 +2447,40 @@ syn keyword xsMacro PERL_ARGS_ASSERT_SV_CATPVN_MG syn keyword xsMacro PERL_ARGS_ASSERT_SV_CATPV_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT_SV_CATPV_MG PERL_ARGS_ASSERT_SV_CATSV syn keyword xsMacro PERL_ARGS_ASSERT_SV_CATSV_FLAGS -syn keyword xsMacro PERL_ARGS_ASSERT_SV_CATSV_MG PERL_ARGS_ASSERT_SV_CATXMLPV -syn keyword xsMacro PERL_ARGS_ASSERT_SV_CATXMLPVN -syn keyword xsMacro PERL_ARGS_ASSERT_SV_CATXMLSV +syn keyword xsMacro PERL_ARGS_ASSERT_SV_CATSV_MG syn keyword xsMacro PERL_ARGS_ASSERT_SV_CAT_DECODE PERL_ARGS_ASSERT_SV_CHOP syn keyword xsMacro PERL_ARGS_ASSERT_SV_CLEAR syn keyword xsMacro PERL_ARGS_ASSERT_SV_COLLXFRM_FLAGS -syn keyword xsMacro PERL_ARGS_ASSERT_SV_COMPILE_2OP -syn keyword xsMacro PERL_ARGS_ASSERT_SV_COMPILE_2OP_IS_BROKEN syn keyword xsMacro PERL_ARGS_ASSERT_SV_COPYPV +syn keyword xsMacro PERL_ARGS_ASSERT_SV_COPYPV_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT_SV_DEL_BACKREF syn keyword xsMacro PERL_ARGS_ASSERT_SV_DERIVED_FROM syn keyword xsMacro PERL_ARGS_ASSERT_SV_DERIVED_FROM_PV syn keyword xsMacro PERL_ARGS_ASSERT_SV_DERIVED_FROM_PVN syn keyword xsMacro PERL_ARGS_ASSERT_SV_DERIVED_FROM_SV -syn keyword xsMacro PERL_ARGS_ASSERT_SV_DOES PERL_ARGS_ASSERT_SV_DOES_PV -syn keyword xsMacro PERL_ARGS_ASSERT_SV_DOES_PVN PERL_ARGS_ASSERT_SV_DOES_SV -syn keyword xsMacro PERL_ARGS_ASSERT_SV_DUMP PERL_ARGS_ASSERT_SV_DUP -syn keyword xsMacro PERL_ARGS_ASSERT_SV_DUP_COMMON +syn keyword xsMacro PERL_ARGS_ASSERT_SV_DISPLAY PERL_ARGS_ASSERT_SV_DOES +syn keyword xsMacro PERL_ARGS_ASSERT_SV_DOES_PV PERL_ARGS_ASSERT_SV_DOES_PVN +syn keyword xsMacro PERL_ARGS_ASSERT_SV_DOES_SV PERL_ARGS_ASSERT_SV_DUMP +syn keyword xsMacro PERL_ARGS_ASSERT_SV_DUP PERL_ARGS_ASSERT_SV_DUP_COMMON syn keyword xsMacro PERL_ARGS_ASSERT_SV_DUP_INC syn keyword xsMacro PERL_ARGS_ASSERT_SV_DUP_INC_MULTIPLE syn keyword xsMacro PERL_ARGS_ASSERT_SV_EXP_GROW syn keyword xsMacro PERL_ARGS_ASSERT_SV_FORCE_NORMAL syn keyword xsMacro PERL_ARGS_ASSERT_SV_FORCE_NORMAL_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT_SV_FREE2 PERL_ARGS_ASSERT_SV_GETS -syn keyword xsMacro PERL_ARGS_ASSERT_SV_GROW PERL_ARGS_ASSERT_SV_INSERT +syn keyword xsMacro PERL_ARGS_ASSERT_SV_GET_BACKREFS PERL_ARGS_ASSERT_SV_GROW +syn keyword xsMacro PERL_ARGS_ASSERT_SV_INSERT syn keyword xsMacro PERL_ARGS_ASSERT_SV_INSERT_FLAGS PERL_ARGS_ASSERT_SV_ISA syn keyword xsMacro PERL_ARGS_ASSERT_SV_IV PERL_ARGS_ASSERT_SV_I_NCMP syn keyword xsMacro PERL_ARGS_ASSERT_SV_KILL_BACKREFS +syn keyword xsMacro PERL_ARGS_ASSERT_SV_LEN_UTF8_NOMG syn keyword xsMacro PERL_ARGS_ASSERT_SV_MAGIC PERL_ARGS_ASSERT_SV_MAGICEXT +syn keyword xsMacro PERL_ARGS_ASSERT_SV_MAGICEXT_MGLOB syn keyword xsMacro PERL_ARGS_ASSERT_SV_NCMP PERL_ARGS_ASSERT_SV_NV +syn keyword xsMacro PERL_ARGS_ASSERT_SV_ONLY_TAINT_GMAGIC +syn keyword xsMacro PERL_ARGS_ASSERT_SV_OR_PV_POS_U2B syn keyword xsMacro PERL_ARGS_ASSERT_SV_POS_B2U +syn keyword xsMacro PERL_ARGS_ASSERT_SV_POS_B2U_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT_SV_POS_B2U_MIDWAY syn keyword xsMacro PERL_ARGS_ASSERT_SV_POS_U2B syn keyword xsMacro PERL_ARGS_ASSERT_SV_POS_U2B_CACHED @@ -2252,23 +2534,22 @@ syn keyword xsMacro PERL_ARGS_ASSERT_SV_UTF8_UPGRADE syn keyword xsMacro PERL_ARGS_ASSERT_SV_UTF8_UPGRADE_FLAGS_GROW syn keyword xsMacro PERL_ARGS_ASSERT_SV_UV PERL_ARGS_ASSERT_SV_VCATPVF syn keyword xsMacro PERL_ARGS_ASSERT_SV_VCATPVFN +syn keyword xsMacro PERL_ARGS_ASSERT_SV_VCATPVFN_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT_SV_VCATPVF_MG syn keyword xsMacro PERL_ARGS_ASSERT_SV_VSETPVF PERL_ARGS_ASSERT_SV_VSETPVFN syn keyword xsMacro PERL_ARGS_ASSERT_SV_VSETPVF_MG -syn keyword xsMacro PERL_ARGS_ASSERT_SV_XMLPEEK PERL_ARGS_ASSERT_SWALLOW_BOM -syn keyword xsMacro PERL_ARGS_ASSERT_SWASH_FETCH PERL_ARGS_ASSERT_SWASH_INIT +syn keyword xsMacro PERL_ARGS_ASSERT_SWALLOW_BOM PERL_ARGS_ASSERT_SWASH_FETCH +syn keyword xsMacro PERL_ARGS_ASSERT_SWASH_INIT +syn keyword xsMacro PERL_ARGS_ASSERT_SWASH_SCAN_LIST_LINE syn keyword xsMacro PERL_ARGS_ASSERT_SWATCH_GET PERL_ARGS_ASSERT_SYS_INIT syn keyword xsMacro PERL_ARGS_ASSERT_SYS_INIT3 syn keyword xsMacro PERL_ARGS_ASSERT_SYS_INTERN_DUP syn keyword xsMacro PERL_ARGS_ASSERT_TAINT_PROPER syn keyword xsMacro PERL_ARGS_ASSERT_TIED_METHOD -syn keyword xsMacro PERL_ARGS_ASSERT_TOKENIZE_USE PERL_ARGS_ASSERT_TOKEN_FREE -syn keyword xsMacro PERL_ARGS_ASSERT_TOKEN_GETMAD PERL_ARGS_ASSERT_TOKEQ +syn keyword xsMacro PERL_ARGS_ASSERT_TOKENIZE_USE PERL_ARGS_ASSERT_TOKEQ syn keyword xsMacro PERL_ARGS_ASSERT_TOKEREPORT syn keyword xsMacro PERL_ARGS_ASSERT_TOO_FEW_ARGUMENTS_PV -syn keyword xsMacro PERL_ARGS_ASSERT_TOO_FEW_ARGUMENTS_SV syn keyword xsMacro PERL_ARGS_ASSERT_TOO_MANY_ARGUMENTS_PV -syn keyword xsMacro PERL_ARGS_ASSERT_TOO_MANY_ARGUMENTS_SV syn keyword xsMacro PERL_ARGS_ASSERT_TO_BYTE_SUBSTR syn keyword xsMacro PERL_ARGS_ASSERT_TO_UNI_LOWER syn keyword xsMacro PERL_ARGS_ASSERT_TO_UNI_TITLE @@ -2296,13 +2577,13 @@ syn keyword xsMacro PERL_ARGS_ASSERT_UTF8_MG_LEN_CACHE_UPDATE syn keyword xsMacro PERL_ARGS_ASSERT_UTF8_MG_POS_CACHE_UPDATE syn keyword xsMacro PERL_ARGS_ASSERT_UTF8_TO_BYTES syn keyword xsMacro PERL_ARGS_ASSERT_UTF8_TO_UVCHR -syn keyword xsMacro PERL_ARGS_ASSERT_UTF8_TO_UVCHR_BUF syn keyword xsMacro PERL_ARGS_ASSERT_UTF8_TO_UVUNI syn keyword xsMacro PERL_ARGS_ASSERT_UTF8_TO_UVUNI_BUF -syn keyword xsMacro PERL_ARGS_ASSERT_UTILIZE PERL_ARGS_ASSERT_UVCHR_TO_UTF8 -syn keyword xsMacro PERL_ARGS_ASSERT_UVCHR_TO_UTF8_FLAGS +syn keyword xsMacro PERL_ARGS_ASSERT_UTILIZE +syn keyword xsMacro PERL_ARGS_ASSERT_UVOFFUNI_TO_UTF8_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT_UVUNI_TO_UTF8 syn keyword xsMacro PERL_ARGS_ASSERT_UVUNI_TO_UTF8_FLAGS +syn keyword xsMacro PERL_ARGS_ASSERT_VALIDATE_PROTO syn keyword xsMacro PERL_ARGS_ASSERT_VALIDATE_SUID syn keyword xsMacro PERL_ARGS_ASSERT_VALID_UTF8_TO_UVCHR syn keyword xsMacro PERL_ARGS_ASSERT_VALID_UTF8_TO_UVUNI @@ -2320,33 +2601,40 @@ syn keyword xsMacro PERL_ARGS_ASSERT_WARN_NOCONTEXT PERL_ARGS_ASSERT_WARN_SV syn keyword xsMacro PERL_ARGS_ASSERT_WATCH PERL_ARGS_ASSERT_WHICHSIG_PV syn keyword xsMacro PERL_ARGS_ASSERT_WHICHSIG_PVN syn keyword xsMacro PERL_ARGS_ASSERT_WHICHSIG_SV +syn keyword xsMacro PERL_ARGS_ASSERT_WIN32_CROAK_NOT_IMPLEMENTED syn keyword xsMacro PERL_ARGS_ASSERT_WITH_QUEUED_ERRORS syn keyword xsMacro PERL_ARGS_ASSERT_WRAP_OP_CHECKER syn keyword xsMacro PERL_ARGS_ASSERT_WRITE_TO_STDERR -syn keyword xsMacro PERL_ARGS_ASSERT_XMLDUMP_ATTR -syn keyword xsMacro PERL_ARGS_ASSERT_XMLDUMP_FORM -syn keyword xsMacro PERL_ARGS_ASSERT_XMLDUMP_INDENT -syn keyword xsMacro PERL_ARGS_ASSERT_XMLDUMP_PACKSUBS -syn keyword xsMacro PERL_ARGS_ASSERT_XMLDUMP_PACKSUBS_PERL -syn keyword xsMacro PERL_ARGS_ASSERT_XMLDUMP_SUB -syn keyword xsMacro PERL_ARGS_ASSERT_XMLDUMP_SUB_PERL -syn keyword xsMacro PERL_ARGS_ASSERT_XMLDUMP_VINDENT -syn keyword xsMacro PERL_ARGS_ASSERT_XS_APIVERSION_BOOTCHECK +syn keyword xsMacro PERL_ARGS_ASSERT_XS_HANDSHAKE syn keyword xsMacro PERL_ARGS_ASSERT_XS_VERSION_BOOTCHECK syn keyword xsMacro PERL_ARGS_ASSERT_YYERROR PERL_ARGS_ASSERT_YYERROR_PV syn keyword xsMacro PERL_ARGS_ASSERT_YYERROR_PVN PERL_ARGS_ASSERT_YYWARN syn keyword xsMacro PERL_ARGS_ASSERT__APPEND_RANGE_TO_INVLIST syn keyword xsMacro PERL_ARGS_ASSERT__CORE_SWASH_INIT +syn keyword xsMacro PERL_ARGS_ASSERT__GET_REGCLASS_NONBITMAP_DATA +syn keyword xsMacro PERL_ARGS_ASSERT__GET_SWASH_INVLIST syn keyword xsMacro PERL_ARGS_ASSERT__INVLIST_ARRAY_INIT +syn keyword xsMacro PERL_ARGS_ASSERT__INVLIST_CONTAINS_CP syn keyword xsMacro PERL_ARGS_ASSERT__INVLIST_CONTENTS +syn keyword xsMacro PERL_ARGS_ASSERT__INVLIST_DUMP syn keyword xsMacro PERL_ARGS_ASSERT__INVLIST_INTERSECTION_MAYBE_COMPLEMENT_2ND syn keyword xsMacro PERL_ARGS_ASSERT__INVLIST_INVERT -syn keyword xsMacro PERL_ARGS_ASSERT__INVLIST_INVERT_PROP +syn keyword xsMacro PERL_ARGS_ASSERT__INVLIST_LEN syn keyword xsMacro PERL_ARGS_ASSERT__INVLIST_POPULATE_SWATCH +syn keyword xsMacro PERL_ARGS_ASSERT__INVLIST_SEARCH syn keyword xsMacro PERL_ARGS_ASSERT__INVLIST_UNION_MAYBE_COMPLEMENT_2ND -syn keyword xsMacro PERL_ARGS_ASSERT__IS_UTF8_QUOTEMETA -syn keyword xsMacro PERL_ARGS_ASSERT__IS_UTF8__PERL_IDSTART +syn keyword xsMacro PERL_ARGS_ASSERT__IS_UTF8_CHAR_SLOW +syn keyword xsMacro PERL_ARGS_ASSERT__IS_UTF8_FOO +syn keyword xsMacro PERL_ARGS_ASSERT__IS_UTF8_IDCONT +syn keyword xsMacro PERL_ARGS_ASSERT__IS_UTF8_IDSTART +syn keyword xsMacro PERL_ARGS_ASSERT__IS_UTF8_MARK +syn keyword xsMacro PERL_ARGS_ASSERT__IS_UTF8_PERL_IDCONT +syn keyword xsMacro PERL_ARGS_ASSERT__IS_UTF8_PERL_IDSTART +syn keyword xsMacro PERL_ARGS_ASSERT__IS_UTF8_XIDCONT +syn keyword xsMacro PERL_ARGS_ASSERT__IS_UTF8_XIDSTART +syn keyword xsMacro PERL_ARGS_ASSERT__MAKE_EXACTF_INVLIST syn keyword xsMacro PERL_ARGS_ASSERT__NEW_INVLIST_C_ARRAY +syn keyword xsMacro PERL_ARGS_ASSERT__SETUP_CANNED_INVLIST syn keyword xsMacro PERL_ARGS_ASSERT__SWASH_INVERSION_HASH syn keyword xsMacro PERL_ARGS_ASSERT__SWASH_TO_INVLIST syn keyword xsMacro PERL_ARGS_ASSERT__TO_FOLD_LATIN1 @@ -2357,59 +2645,62 @@ syn keyword xsMacro PERL_ARGS_ASSERT__TO_UTF8_LOWER_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT__TO_UTF8_TITLE_FLAGS syn keyword xsMacro PERL_ARGS_ASSERT__TO_UTF8_UPPER_FLAGS PERL_ASYNC_CHECK syn keyword xsMacro PERL_BITFIELD16 PERL_BITFIELD32 PERL_BITFIELD8 -syn keyword xsMacro PERL_CALLCONV PERL_CHECK_INITED PERL_CKDEF PERL_DEB -syn keyword xsMacro PERL_DEBUG PERL_DEBUG_PAD PERL_DEBUG_PAD_ZERO +syn keyword xsMacro PERL_CALLCONV PERL_CALLCONV_NO_RET PERL_CHECK_INITED +syn keyword xsMacro PERL_CKDEF PERL_DEB PERL_DEB2 PERL_DEBUG PERL_DEBUG_PAD +syn keyword xsMacro PERL_DEBUG_PAD_ZERO PERL_DECIMAL_VERSION syn keyword xsMacro PERL_DEFAULT_DO_EXEC3_IMPLEMENTATION -syn keyword xsMacro PERL_DONT_CREATE_GVSV +syn keyword xsMacro PERL_DONT_CREATE_GVSV PERL_DRAND48_QUAD syn keyword xsMacro PERL_ENABLE_EXPERIMENTAL_REGEX_OPTIMISATIONS syn keyword xsMacro PERL_ENABLE_EXTENDED_TRIE_OPTIMISATION syn keyword xsMacro PERL_ENABLE_POSITIVE_ASSERTION_STUDY -syn keyword xsMacro PERL_ENABLE_TRIE_OPTIMISATION PERL_EXIT_DESTRUCT_END -syn keyword xsMacro PERL_EXIT_EXPECTED PERL_EXPORT_C PERL_FILE_IS_ABSOLUTE -syn keyword xsMacro PERL_FILTER_EXISTS PERL_FLUSHALL_FOR_CHILD PERL_FPU_INIT -syn keyword xsMacro PERL_FPU_POST_EXEC PERL_FPU_PRE_EXEC PERL_FS_VERSION -syn keyword xsMacro PERL_FS_VER_FMT PERL_GCC_BRACE_GROUPS_FORBIDDEN -syn keyword xsMacro PERL_GET_CONTEXT PERL_GET_INTERP PERL_GET_THX -syn keyword xsMacro PERL_GET_VARS PERL_GIT_UNPUSHED_COMMITS -syn keyword xsMacro PERL_GLOBAL_STRUCT PERL_GPROF_MONCONTROL PERL_HASH -syn keyword xsMacro PERL_HASH_INTERNAL PERL_HASH_INTERNAL_ PERL_HASH_SEED -syn keyword xsMacro PERL_HV_ARRAY_ALLOC_BYTES PERL_IMPLICIT_CONTEXT -syn keyword xsMacro PERL_INTERPRETER_SIZE_UPTO_MEMBER PERL_INT_MAX -syn keyword xsMacro PERL_INT_MIN PERL_LOADMOD_DENY PERL_LOADMOD_IMPORT_OPS -syn keyword xsMacro PERL_LOADMOD_NOIMPORT PERL_LONG_MAX PERL_LONG_MIN -syn keyword xsMacro PERL_MALLOC_WRAP PERL_MG_UFUNC PERL_MY_SNPRINTF_GUARDED -syn keyword xsMacro PERL_MY_VSNPRINTF_GUARDED PERL_NEED_MY_BETOH16 -syn keyword xsMacro PERL_NEED_MY_BETOH32 PERL_NEED_MY_BETOHI -syn keyword xsMacro PERL_NEED_MY_BETOHL PERL_NEED_MY_BETOHS -syn keyword xsMacro PERL_NEED_MY_HTOBE16 PERL_NEED_MY_HTOBE32 -syn keyword xsMacro PERL_NEED_MY_HTOBEI PERL_NEED_MY_HTOBEL -syn keyword xsMacro PERL_NEED_MY_HTOBES PERL_NEED_MY_HTOLE16 -syn keyword xsMacro PERL_NEED_MY_HTOLE32 PERL_NEED_MY_HTOLEI -syn keyword xsMacro PERL_NEED_MY_HTOLEL PERL_NEED_MY_HTOLES -syn keyword xsMacro PERL_NEED_MY_LETOH16 PERL_NEED_MY_LETOH32 -syn keyword xsMacro PERL_NEED_MY_LETOHI PERL_NEED_MY_LETOHL -syn keyword xsMacro PERL_NEED_MY_LETOHS PERL_NO_DEV_RANDOM PERL_OBJECT_THIS -syn keyword xsMacro PERL_OBJECT_THIS_ PERL_PADSEQ_INTRO PERL_PATCHNUM +syn keyword xsMacro PERL_ENABLE_TRIE_OPTIMISATION PERL_EXIT_ABORT +syn keyword xsMacro PERL_EXIT_DESTRUCT_END PERL_EXIT_EXPECTED PERL_EXIT_WARN +syn keyword xsMacro PERL_EXPORT_C PERL_FILE_IS_ABSOLUTE PERL_FILTER_EXISTS +syn keyword xsMacro PERL_FLUSHALL_FOR_CHILD PERL_FPU_INIT PERL_FPU_POST_EXEC +syn keyword xsMacro PERL_FPU_PRE_EXEC PERL_FS_VERSION PERL_FS_VER_FMT +syn keyword xsMacro PERL_GCC_BRACE_GROUPS_FORBIDDEN PERL_GET_CONTEXT +syn keyword xsMacro PERL_GET_INTERP PERL_GET_THX PERL_GET_VARS +syn keyword xsMacro PERL_GIT_UNPUSHED_COMMITS PERL_GLOBAL_STRUCT +syn keyword xsMacro PERL_GPROF_MONCONTROL PERL_HASH PERL_HASH_DEFAULT_HvMAX +syn keyword xsMacro PERL_HASH_FUNC PERL_HASH_FUNC_ONE_AT_A_TIME_HARD +syn keyword xsMacro PERL_HASH_INTERNAL PERL_HASH_ITER_BUCKET +syn keyword xsMacro PERL_HASH_RANDOMIZE_KEYS PERL_HASH_SEED +syn keyword xsMacro PERL_HASH_SEED_BYTES PERL_HASH_WITH_SEED +syn keyword xsMacro PERL_HV_ALLOC_AUX_SIZE PERL_HV_ARRAY_ALLOC_BYTES +syn keyword xsMacro PERL_IMPLICIT_CONTEXT PERL_INTERPRETER_SIZE_UPTO_MEMBER +syn keyword xsMacro PERL_INT_MAX PERL_INT_MIN PERL_LOADMOD_DENY +syn keyword xsMacro PERL_LOADMOD_IMPORT_OPS PERL_LOADMOD_NOIMPORT +syn keyword xsMacro PERL_LONG_MAX PERL_LONG_MIN PERL_MALLOC_WRAP +syn keyword xsMacro PERL_MEMORY_DEBUG_HEADER_SIZE PERL_MG_UFUNC +syn keyword xsMacro PERL_MY_SNPRINTF_GUARDED PERL_MY_SNPRINTF_POST_GUARD +syn keyword xsMacro PERL_MY_VSNPRINTF_GUARDED PERL_MY_VSNPRINTF_POST_GUARD +syn keyword xsMacro PERL_NEW_COPY_ON_WRITE PERL_NO_DEV_RANDOM +syn keyword xsMacro PERL_OBJECT_THIS PERL_OBJECT_THIS_ PERL_PADNAME_MINIMAL +syn keyword xsMacro PERL_PADSEQ_INTRO PERL_PATCHNUM PERL_POISON_EXPR syn keyword xsMacro PERL_PPADDR_INITED PERL_PPDEF PERL_PRESERVE_IVUV syn keyword xsMacro PERL_PRIeldbl PERL_PRIfldbl PERL_PRIgldbl -syn keyword xsMacro PERL_PV_ESCAPE_ALL PERL_PV_ESCAPE_FIRSTCHAR -syn keyword xsMacro PERL_PV_ESCAPE_NOBACKSLASH PERL_PV_ESCAPE_NOCLEAR -syn keyword xsMacro PERL_PV_ESCAPE_NONASCII PERL_PV_ESCAPE_QUOTE -syn keyword xsMacro PERL_PV_ESCAPE_RE PERL_PV_ESCAPE_UNI +syn keyword xsMacro PERL_PV_ESCAPE_ALL PERL_PV_ESCAPE_DWIM +syn keyword xsMacro PERL_PV_ESCAPE_FIRSTCHAR PERL_PV_ESCAPE_NOBACKSLASH +syn keyword xsMacro PERL_PV_ESCAPE_NOCLEAR PERL_PV_ESCAPE_NONASCII +syn keyword xsMacro PERL_PV_ESCAPE_QUOTE PERL_PV_ESCAPE_RE PERL_PV_ESCAPE_UNI syn keyword xsMacro PERL_PV_ESCAPE_UNI_DETECT PERL_PV_PRETTY_DUMP -syn keyword xsMacro PERL_PV_PRETTY_ELLIPSES PERL_PV_PRETTY_LTGT -syn keyword xsMacro PERL_PV_PRETTY_NOCLEAR PERL_PV_PRETTY_QUOTE -syn keyword xsMacro PERL_PV_PRETTY_REGPROP PERL_QUAD_MAX PERL_QUAD_MIN -syn keyword xsMacro PERL_REENTR_API PERL_REGMATCH_SLAB_SLOTS PERL_REVISION +syn keyword xsMacro PERL_PV_PRETTY_ELLIPSES PERL_PV_PRETTY_EXACTSIZE +syn keyword xsMacro PERL_PV_PRETTY_LTGT PERL_PV_PRETTY_NOCLEAR +syn keyword xsMacro PERL_PV_PRETTY_QUOTE PERL_PV_PRETTY_REGPROP PERL_QUAD_MAX +syn keyword xsMacro PERL_QUAD_MIN PERL_REENTR_API PERL_REGMATCH_SLAB_SLOTS +syn keyword xsMacro PERL_RELOCATABLE_INC PERL_REVISION PERL_SAWAMPERSAND syn keyword xsMacro PERL_SCAN_ALLOW_UNDERSCORES PERL_SCAN_DISALLOW_PREFIX syn keyword xsMacro PERL_SCAN_GREATER_THAN_UV_MAX PERL_SCAN_SILENT_ILLDIGIT -syn keyword xsMacro PERL_SCAN_SILENT_NON_PORTABLE PERL_SCNfldbl -syn keyword xsMacro PERL_SCRIPT_MODE PERL_SET_CONTEXT PERL_SET_INTERP -syn keyword xsMacro PERL_SET_PHASE PERL_SET_THX PERL_SHORT_MAX PERL_SHORT_MIN -syn keyword xsMacro PERL_SIGNALS_UNSAFE_FLAG PERL_STACK_OVERFLOW_CHECK -syn keyword xsMacro PERL_STATIC_INLINE PERL_STRLEN_EXPAND_SHIFT -syn keyword xsMacro PERL_STRLEN_ROUNDUP PERL_STRLEN_ROUNDUP_QUANTUM -syn keyword xsMacro PERL_SUBVERSION PERL_SUB_DEPTH_WARN PERL_SYS_INIT +syn keyword xsMacro PERL_SCAN_SILENT_NON_PORTABLE PERL_SCAN_TRAILING +syn keyword xsMacro PERL_SCNfldbl PERL_SCRIPT_MODE PERL_SEEN_HV_FUNC_H +syn keyword xsMacro PERL_SET_CONTEXT PERL_SET_INTERP PERL_SET_PHASE +syn keyword xsMacro PERL_SET_THX PERL_SHORT_MAX PERL_SHORT_MIN +syn keyword xsMacro PERL_SIGNALS_UNSAFE_FLAG PERL_SNPRINTF_CHECK +syn keyword xsMacro PERL_STACK_OVERFLOW_CHECK PERL_STATIC_INLINE +syn keyword xsMacro PERL_STATIC_INLINE_NO_RET PERL_STATIC_NO_RET +syn keyword xsMacro PERL_STRLEN_EXPAND_SHIFT PERL_STRLEN_ROUNDUP +syn keyword xsMacro PERL_STRLEN_ROUNDUP_QUANTUM PERL_SUBVERSION +syn keyword xsMacro PERL_SUB_DEPTH_WARN PERL_SYS_FPU_INIT PERL_SYS_INIT syn keyword xsMacro PERL_SYS_INIT3 PERL_SYS_INIT3_BODY PERL_SYS_INIT_BODY syn keyword xsMacro PERL_SYS_TERM PERL_SYS_TERM_BODY PERL_TARGETARCH syn keyword xsMacro PERL_UCHAR_MAX PERL_UCHAR_MIN PERL_UINT_MAX PERL_UINT_MIN @@ -2427,49 +2718,47 @@ syn keyword xsMacro PERL_UNICODE_STD_FLAG PERL_UNICODE_UTF8CACHEASSERT syn keyword xsMacro PERL_UNICODE_UTF8CACHEASSERT_FLAG syn keyword xsMacro PERL_UNICODE_WIDESYSCALLS PERL_UNICODE_WIDESYSCALLS_FLAG syn keyword xsMacro PERL_UNUSED_ARG PERL_UNUSED_CONTEXT PERL_UNUSED_DECL -syn keyword xsMacro PERL_UNUSED_VAR PERL_UQUAD_MAX PERL_UQUAD_MIN -syn keyword xsMacro PERL_USES_PL_PIDSTATUS PERL_USE_GCC_BRACE_GROUPS -syn keyword xsMacro PERL_USHORT_MAX PERL_USHORT_MIN PERL_VERSION -syn keyword xsMacro PERL_VERSION_STRING PERL_WAIT_FOR_CHILDREN -syn keyword xsMacro PERL_WARNHOOK_FATAL PERL_WRITE_MSG_TO_CONSOLE -syn keyword xsMacro PERL_XS_EXPORT_C PHASE_CHANGE_PROBE PHOSTNAME -syn keyword xsMacro PIPESOCK_MODE PIPE_OPEN_MODE PLUGEXPR PLUGSTMT PLUS -syn keyword xsMacro PL_ASCII PL_AboveLatin1 PL_Argv PL_Cmd PL_DBcv PL_DBgv -syn keyword xsMacro PL_DBline PL_DBsignal PL_DBsingle PL_DBsub PL_DBtrace -syn keyword xsMacro PL_Dir PL_Env PL_Gappctx PL_Gcheck PL_Gcheck_mutex -syn keyword xsMacro PL_Gcsighandlerp PL_Gcurinterp PL_Gdo_undump -syn keyword xsMacro PL_Gdollarzero_mutex PL_Gfold_locale PL_Ghints_mutex -syn keyword xsMacro PL_Gkeyword_plugin PL_Gmalloc_mutex PL_Gmmap_page_size -syn keyword xsMacro PL_Gmy_ctx_mutex PL_Gmy_cxt_index PL_Gop_mutex PL_Gop_seq -syn keyword xsMacro PL_Gop_sequence PL_Gperlio_debug_fd PL_Gperlio_fd_refcnt +syn keyword xsMacro PERL_UNUSED_RESULT PERL_UNUSED_VAR PERL_UQUAD_MAX +syn keyword xsMacro PERL_UQUAD_MIN PERL_USES_PL_PIDSTATUS +syn keyword xsMacro PERL_USE_GCC_BRACE_GROUPS PERL_USHORT_MAX PERL_USHORT_MIN +syn keyword xsMacro PERL_VERSION PERL_VERSION_DECIMAL PERL_VERSION_GE +syn keyword xsMacro PERL_VERSION_LT PERL_VERSION_STRING +syn keyword xsMacro PERL_WAIT_FOR_CHILDREN PERL_WARNHOOK_FATAL +syn keyword xsMacro PERL_WRITE_MSG_TO_CONSOLE PERL_XS_EXPORT_C +syn keyword xsMacro PHASE_CHANGE_PROBE PHOSTNAME PIPESOCK_MODE PIPE_OPEN_MODE +syn keyword xsMacro PLUGEXPR PLUGSTMT PLUS PL_AboveLatin1 PL_Argv PL_Cmd +syn keyword xsMacro PL_DBcontrol PL_DBcv PL_DBgv PL_DBline PL_DBsignal +syn keyword xsMacro PL_DBsignal_iv PL_DBsingle PL_DBsingle_iv PL_DBsub +syn keyword xsMacro PL_DBtrace PL_DBtrace_iv PL_Dir PL_Env PL_GCB_invlist +syn keyword xsMacro PL_Gappctx PL_Gcheck PL_Gcheck_mutex PL_Gcsighandlerp +syn keyword xsMacro PL_Gcurinterp PL_Gdo_undump PL_Gdollarzero_mutex +syn keyword xsMacro PL_Gfold_locale PL_Ghash_seed PL_Ghash_seed_set +syn keyword xsMacro PL_Ghints_mutex PL_Gkeyword_plugin PL_Gmalloc_mutex +syn keyword xsMacro PL_Gmmap_page_size PL_Gmy_ctx_mutex PL_Gmy_cxt_index +syn keyword xsMacro PL_Gop_mutex PL_Gop_seq PL_Gop_sequence +syn keyword xsMacro PL_Gperlio_debug_fd PL_Gperlio_fd_refcnt syn keyword xsMacro PL_Gperlio_fd_refcnt_size PL_Gperlio_mutex PL_Gppaddr syn keyword xsMacro PL_Gsh_path PL_Gsig_defaulting PL_Gsig_handlers_initted syn keyword xsMacro PL_Gsig_ignoring PL_Gsig_trapped PL_Gsigfpe_saved syn keyword xsMacro PL_Gsv_placeholder PL_Gthr_key PL_Gtimesbase syn keyword xsMacro PL_Guse_safe_putenv PL_Gveto_cleanup PL_Gwatch_pvx -syn keyword xsMacro PL_L1Cased PL_L1PosixAlnum PL_L1PosixAlpha -syn keyword xsMacro PL_L1PosixGraph PL_L1PosixLower PL_L1PosixPrint -syn keyword xsMacro PL_L1PosixPunct PL_L1PosixUpper PL_L1PosixWord PL_LIO -syn keyword xsMacro PL_Latin1 PL_Mem PL_MemParse PL_MemShared -syn keyword xsMacro PL_OP_SLAB_ALLOC PL_OpPtr PL_OpSlab PL_OpSpace -syn keyword xsMacro PL_PerlSpace PL_PosixAlnum PL_PosixAlpha PL_PosixBlank -syn keyword xsMacro PL_PosixCntrl PL_PosixDigit PL_PosixGraph PL_PosixLower -syn keyword xsMacro PL_PosixPrint PL_PosixPunct PL_PosixSpace PL_PosixUpper -syn keyword xsMacro PL_PosixWord PL_PosixXDigit PL_Proc PL_Sock PL_StdIO -syn keyword xsMacro PL_Sv PL_VertSpace PL_XPerlSpace PL_XPosixBlank -syn keyword xsMacro PL_XPosixCntrl PL_XPosixSpace PL_XPosixXDigit PL_Xpv -syn keyword xsMacro PL_amagic_generation PL_an PL_apiversion PL_appctx -syn keyword xsMacro PL_argvgv PL_argvout_stack PL_argvoutgv PL_basetime -syn keyword xsMacro PL_beginav PL_beginav_save PL_blockhooks PL_body_arenas -syn keyword xsMacro PL_body_roots PL_bodytarget PL_bostr PL_breakable_sub_gen +syn keyword xsMacro PL_HASH_RAND_BITS_ENABLED PL_HasMultiCharFold PL_InBitmap +syn keyword xsMacro PL_LIO PL_Latin1 PL_Mem PL_MemParse PL_MemShared +syn keyword xsMacro PL_NonL1NonFinalFold PL_Posix_ptrs PL_Proc +syn keyword xsMacro PL_RANDOM_STATE_TYPE PL_SB_invlist PL_Sock PL_StdIO PL_Sv +syn keyword xsMacro PL_UpperLatin1 PL_WB_invlist PL_XPosix_ptrs PL_Xpv +syn keyword xsMacro PL_amagic_generation PL_an PL_appctx PL_argvgv +syn keyword xsMacro PL_argvout_stack PL_argvoutgv PL_basetime PL_beginav +syn keyword xsMacro PL_beginav_save PL_blockhooks PL_body_arenas +syn keyword xsMacro PL_body_roots PL_bodytarget PL_breakable_sub_gen syn keyword xsMacro PL_check_mutex PL_checkav PL_checkav_save PL_chopset syn keyword xsMacro PL_clocktick PL_collation_ix PL_collation_name syn keyword xsMacro PL_collation_standard PL_collxfrm_base PL_collxfrm_mult syn keyword xsMacro PL_colors PL_colorset PL_compcv PL_compiling PL_comppad syn keyword xsMacro PL_comppad_name PL_comppad_name_fill -syn keyword xsMacro PL_comppad_name_floor PL_cop_seqmax PL_cryptseen -syn keyword xsMacro PL_cshlen PL_csighandlerp PL_curcop PL_curcopdb -syn keyword xsMacro PL_curinterp PL_curpad PL_curpm PL_curstack +syn keyword xsMacro PL_comppad_name_floor PL_constpadix PL_cop_seqmax +syn keyword xsMacro PL_cryptseen PL_cshlen PL_csighandlerp PL_curcop +syn keyword xsMacro PL_curcopdb PL_curinterp PL_curpad PL_curpm PL_curstack syn keyword xsMacro PL_curstackinfo PL_curstash PL_curstname syn keyword xsMacro PL_custom_op_descs PL_custom_op_names PL_custom_ops syn keyword xsMacro PL_cv_has_eval PL_dbargs PL_debstash PL_debug @@ -2482,133 +2771,139 @@ syn keyword xsMacro PL_dumpindent PL_e_script PL_efloatbuf PL_efloatsize syn keyword xsMacro PL_encoding PL_endav PL_envgv PL_errgv PL_errors syn keyword xsMacro PL_eval_root PL_eval_start PL_evalseq PL_exit_flags syn keyword xsMacro PL_exitlist PL_exitlistlen PL_fdpid PL_filemode -syn keyword xsMacro PL_firstgv PL_forkprocess PL_formfeed PL_formtarget -syn keyword xsMacro PL_generation PL_gensym PL_glob_index PL_globalstash -syn keyword xsMacro PL_globhook PL_hash_seed PL_hintgv PL_hints -syn keyword xsMacro PL_hints_mutex PL_hv_fetch_ent_mh PL_in_clean_all -syn keyword xsMacro PL_in_clean_objs PL_in_eval PL_in_load_module PL_incgv +syn keyword xsMacro PL_firstgv PL_forkprocess PL_formtarget PL_generation +syn keyword xsMacro PL_gensym PL_globalstash PL_globhook PL_hash_rand_bits +syn keyword xsMacro PL_hash_rand_bits_enabled PL_hash_seed PL_hash_seed_set +syn keyword xsMacro PL_hintgv PL_hints PL_hints_mutex PL_hv_fetch_ent_mh +syn keyword xsMacro PL_in_clean_all PL_in_clean_objs PL_in_eval +syn keyword xsMacro PL_in_load_module PL_in_utf8_CTYPE_locale PL_incgv syn keyword xsMacro PL_initav PL_inplace PL_isarev PL_keyword_plugin syn keyword xsMacro PL_known_layers PL_last_in_gv PL_last_swash_hv syn keyword xsMacro PL_last_swash_key PL_last_swash_klen PL_last_swash_slen syn keyword xsMacro PL_last_swash_tmps PL_lastfd PL_lastgotoprobe -syn keyword xsMacro PL_laststatval PL_laststype PL_localizing PL_localpatches -syn keyword xsMacro PL_lockhook PL_madskills PL_main_cv PL_main_root +syn keyword xsMacro PL_laststatval PL_laststype PL_lex_encoding PL_localizing +syn keyword xsMacro PL_localpatches PL_lockhook PL_main_cv PL_main_root syn keyword xsMacro PL_main_start PL_mainstack PL_malloc_mutex PL_markstack syn keyword xsMacro PL_markstack_max PL_markstack_ptr PL_max_intro_pending syn keyword xsMacro PL_maxo PL_maxsysfd PL_memory_debug_header PL_mess_sv syn keyword xsMacro PL_min_intro_pending PL_minus_E PL_minus_F PL_minus_a syn keyword xsMacro PL_minus_c PL_minus_l PL_minus_n PL_minus_p syn keyword xsMacro PL_mmap_page_size PL_modcount PL_modglobal -syn keyword xsMacro PL_my_ctx_mutex PL_my_cxt_index PL_my_cxt_keys -syn keyword xsMacro PL_my_cxt_list PL_my_cxt_size PL_nomemok PL_nrs +syn keyword xsMacro PL_multideref_pc PL_my_ctx_mutex PL_my_cxt_index +syn keyword xsMacro PL_my_cxt_keys PL_my_cxt_list PL_my_cxt_size PL_nomemok syn keyword xsMacro PL_numeric_local PL_numeric_name PL_numeric_radix_sv -syn keyword xsMacro PL_numeric_standard PL_ofsgv PL_oldname PL_op PL_op_mask -syn keyword xsMacro PL_op_mutex PL_op_seq PL_op_sequence PL_opfreehook -syn keyword xsMacro PL_opsave PL_origalen PL_origargc PL_origargv -syn keyword xsMacro PL_origenviron PL_origfilename PL_ors_sv PL_osname -syn keyword xsMacro PL_pad_reset_pending PL_padix PL_padix_floor PL_parser -syn keyword xsMacro PL_patchlevel PL_peepp PL_perl_destruct_level PL_perldb -syn keyword xsMacro PL_perlio PL_perlio_debug_fd PL_perlio_fd_refcnt -syn keyword xsMacro PL_perlio_fd_refcnt_size PL_perlio_mutex PL_phase -syn keyword xsMacro PL_pidstatus PL_preambleav PL_profiledata PL_psig_name -syn keyword xsMacro PL_psig_pend PL_psig_ptr PL_ptr_table PL_reentrant_buffer -syn keyword xsMacro PL_reentrant_retint PL_reg_curpm PL_reg_eval_set -syn keyword xsMacro PL_reg_flags PL_reg_leftiter PL_reg_magic -syn keyword xsMacro PL_reg_match_utf8 PL_reg_maxiter PL_reg_oldcurpm -syn keyword xsMacro PL_reg_oldpos PL_reg_oldsaved PL_reg_oldsavedlen -syn keyword xsMacro PL_reg_poscache PL_reg_poscache_size PL_reg_start_tmp -syn keyword xsMacro PL_reg_start_tmpl PL_reg_starttry PL_reg_state -syn keyword xsMacro PL_regdummy PL_regeol PL_regex_pad PL_regex_padav -syn keyword xsMacro PL_reginput PL_reginterp_cnt PL_registered_mros -syn keyword xsMacro PL_reglastcloseparen PL_reglastparen PL_regmatch_slab -syn keyword xsMacro PL_regmatch_state PL_regoffs PL_regsize PL_rehash_seed -syn keyword xsMacro PL_rehash_seed_set PL_replgv PL_restartjmpenv -syn keyword xsMacro PL_restartop PL_rpeepp PL_rs PL_runops PL_savebegin -syn keyword xsMacro PL_savestack PL_savestack_ix PL_savestack_max +syn keyword xsMacro PL_numeric_standard PL_ofsgv PL_oldname PL_op +syn keyword xsMacro PL_op_exec_cnt PL_op_mask PL_op_mutex PL_op_seq +syn keyword xsMacro PL_op_sequence PL_opfreehook PL_origalen PL_origargc +syn keyword xsMacro PL_origargv PL_origenviron PL_origfilename PL_ors_sv +syn keyword xsMacro PL_osname PL_pad_reset_pending PL_padix PL_padix_floor +syn keyword xsMacro PL_padlist_generation PL_padname_const PL_padname_undef +syn keyword xsMacro PL_parser PL_patchlevel PL_peepp PL_perl_destruct_level +syn keyword xsMacro PL_perldb PL_perlio PL_perlio_debug_fd +syn keyword xsMacro PL_perlio_fd_refcnt PL_perlio_fd_refcnt_size +syn keyword xsMacro PL_perlio_mutex PL_phase PL_pidstatus PL_preambleav +syn keyword xsMacro PL_profiledata PL_psig_name PL_psig_pend PL_psig_ptr +syn keyword xsMacro PL_ptr_table PL_random_state PL_reentrant_buffer +syn keyword xsMacro PL_reentrant_retint PL_reg_curpm PL_regex_pad +syn keyword xsMacro PL_regex_padav PL_registered_mros PL_regmatch_slab +syn keyword xsMacro PL_regmatch_state PL_replgv PL_restartjmpenv PL_restartop +syn keyword xsMacro PL_rpeepp PL_rs PL_runops PL_savebegin PL_savestack +syn keyword xsMacro PL_savestack_ix PL_savestack_max PL_sawalias syn keyword xsMacro PL_sawampersand PL_scopestack PL_scopestack_ix syn keyword xsMacro PL_scopestack_max PL_scopestack_name PL_secondgv syn keyword xsMacro PL_sharehook PL_sig_defaulting PL_sig_handlers_initted syn keyword xsMacro PL_sig_ignoring PL_sig_pending PL_sig_trapped syn keyword xsMacro PL_sigfpe_saved PL_sighandlerp PL_signalhook PL_signals -syn keyword xsMacro PL_slab_count PL_slabs PL_sort_RealCmp PL_sortcop -syn keyword xsMacro PL_sortstash PL_splitstr PL_srand_called PL_stack_base -syn keyword xsMacro PL_stack_max PL_stack_sp PL_start_env PL_stashcache -syn keyword xsMacro PL_statbuf PL_statcache PL_statgv PL_statname -syn keyword xsMacro PL_statusvalue PL_statusvalue_posix PL_statusvalue_vms -syn keyword xsMacro PL_stderrgv PL_stdingv PL_strtab PL_sub_generation -syn keyword xsMacro PL_subline PL_subname PL_sv_arenaroot PL_sv_count -syn keyword xsMacro PL_sv_no PL_sv_objcount PL_sv_placeholder PL_sv_root -syn keyword xsMacro PL_sv_serial PL_sv_undef PL_sv_yes PL_sys_intern -syn keyword xsMacro PL_taint_warn PL_tainted PL_tainting PL_thr_key -syn keyword xsMacro PL_threadhook PL_timesbase PL_timesbuf PL_tmps_floor -syn keyword xsMacro PL_tmps_ix PL_tmps_max PL_tmps_stack PL_top_env -syn keyword xsMacro PL_toptarget PL_unicode PL_unitcheckav +syn keyword xsMacro PL_sort_RealCmp PL_sortcop PL_sortstash PL_splitstr +syn keyword xsMacro PL_srand_called PL_stack_base PL_stack_max PL_stack_sp +syn keyword xsMacro PL_start_env PL_stashcache PL_stashpad PL_stashpadix +syn keyword xsMacro PL_stashpadmax PL_statbuf PL_statcache PL_statgv +syn keyword xsMacro PL_statname PL_statusvalue PL_statusvalue_posix +syn keyword xsMacro PL_statusvalue_vms PL_stderrgv PL_stdingv PL_strtab +syn keyword xsMacro PL_sub_generation PL_subline PL_subname PL_sv_arenaroot +syn keyword xsMacro PL_sv_consts PL_sv_count PL_sv_no PL_sv_placeholder +syn keyword xsMacro PL_sv_root PL_sv_serial PL_sv_undef PL_sv_yes +syn keyword xsMacro PL_sys_intern PL_taint_warn PL_tainted PL_tainting +syn keyword xsMacro PL_thr_key PL_threadhook PL_timesbase PL_timesbuf +syn keyword xsMacro PL_tmps_floor PL_tmps_ix PL_tmps_max PL_tmps_stack +syn keyword xsMacro PL_top_env PL_toptarget PL_unicode PL_unitcheckav syn keyword xsMacro PL_unitcheckav_save PL_unlockhook PL_unsafe -syn keyword xsMacro PL_use_safe_putenv PL_utf8_X_L PL_utf8_X_LV PL_utf8_X_LVT -syn keyword xsMacro PL_utf8_X_LV_LVT_V PL_utf8_X_T PL_utf8_X_V -syn keyword xsMacro PL_utf8_X_begin PL_utf8_X_extend PL_utf8_X_non_hangul -syn keyword xsMacro PL_utf8_X_prepend PL_utf8_alnum PL_utf8_alpha -syn keyword xsMacro PL_utf8_digit PL_utf8_foldable PL_utf8_foldclosures -syn keyword xsMacro PL_utf8_graph PL_utf8_idcont PL_utf8_idstart -syn keyword xsMacro PL_utf8_lower PL_utf8_mark PL_utf8_perl_idstart -syn keyword xsMacro PL_utf8_print PL_utf8_punct PL_utf8_quotemeta -syn keyword xsMacro PL_utf8_space PL_utf8_tofold PL_utf8_tolower -syn keyword xsMacro PL_utf8_totitle PL_utf8_toupper PL_utf8_upper -syn keyword xsMacro PL_utf8_xdigit PL_utf8_xidcont PL_utf8_xidstart -syn keyword xsMacro PL_utf8cache PL_utf8locale PL_veto_cleanup PL_vtbl_amagic -syn keyword xsMacro PL_vtbl_amagicelem PL_vtbl_arylen PL_vtbl_arylen_p -syn keyword xsMacro PL_vtbl_backref PL_vtbl_bm PL_vtbl_collxfrm -syn keyword xsMacro PL_vtbl_dbline PL_vtbl_defelem PL_vtbl_env -syn keyword xsMacro PL_vtbl_envelem PL_vtbl_fm PL_vtbl_hints -syn keyword xsMacro PL_vtbl_hintselem PL_vtbl_isa PL_vtbl_isaelem -syn keyword xsMacro PL_vtbl_mglob PL_vtbl_nkeys PL_vtbl_ovrld PL_vtbl_pack -syn keyword xsMacro PL_vtbl_packelem PL_vtbl_pos PL_vtbl_regdata -syn keyword xsMacro PL_vtbl_regdatum PL_vtbl_regexp PL_vtbl_sigelem -syn keyword xsMacro PL_vtbl_substr PL_vtbl_sv PL_vtbl_taint PL_vtbl_utf8 -syn keyword xsMacro PL_vtbl_uvar PL_vtbl_vec PL_vtbl_vstring PL_warnhook -syn keyword xsMacro PL_watch_pvx PL_watchaddr PL_watchok PL_xmlfp PMFUNC -syn keyword xsMacro PM_GETRE PM_SETRE PMf_BASE_SHIFT PMf_COMPILETIME -syn keyword xsMacro PMf_CONST PMf_CONTINUE PMf_EVAL PMf_EXTENDED PMf_FOLD -syn keyword xsMacro PMf_GLOBAL PMf_KEEP PMf_KEEPCOPY PMf_MAYBE_CONST -syn keyword xsMacro PMf_MULTILINE PMf_NONDESTRUCT PMf_ONCE PMf_RETAINT -syn keyword xsMacro PMf_SINGLELINE PMf_USED POPBLOCK POPEVAL POPFORMAT +syn keyword xsMacro PL_use_safe_putenv PL_utf8_charname_begin +syn keyword xsMacro PL_utf8_charname_continue PL_utf8_foldable +syn keyword xsMacro PL_utf8_foldclosures PL_utf8_idcont PL_utf8_idstart +syn keyword xsMacro PL_utf8_mark PL_utf8_perl_idcont PL_utf8_perl_idstart +syn keyword xsMacro PL_utf8_swash_ptrs PL_utf8_tofold PL_utf8_tolower +syn keyword xsMacro PL_utf8_totitle PL_utf8_toupper PL_utf8_xidcont +syn keyword xsMacro PL_utf8_xidstart PL_utf8cache PL_utf8locale +syn keyword xsMacro PL_veto_cleanup PL_vtbl_arylen PL_vtbl_arylen_p +syn keyword xsMacro PL_vtbl_backref PL_vtbl_bm PL_vtbl_checkcall +syn keyword xsMacro PL_vtbl_collxfrm PL_vtbl_dbline PL_vtbl_debugvar +syn keyword xsMacro PL_vtbl_defelem PL_vtbl_env PL_vtbl_envelem PL_vtbl_fm +syn keyword xsMacro PL_vtbl_hints PL_vtbl_hintselem PL_vtbl_isa +syn keyword xsMacro PL_vtbl_isaelem PL_vtbl_lvref PL_vtbl_mglob PL_vtbl_nkeys +syn keyword xsMacro PL_vtbl_ovrld PL_vtbl_pack PL_vtbl_packelem PL_vtbl_pos +syn keyword xsMacro PL_vtbl_regdata PL_vtbl_regdatum PL_vtbl_regexp +syn keyword xsMacro PL_vtbl_sigelem PL_vtbl_substr PL_vtbl_sv PL_vtbl_taint +syn keyword xsMacro PL_vtbl_utf8 PL_vtbl_uvar PL_vtbl_vec PL_warn_locale +syn keyword xsMacro PL_warnhook PL_watch_pvx PL_watchaddr PL_watchok +syn keyword xsMacro PL_xsubfilename PMFUNC PM_GETRE PM_SETRE PMf_BASE_SHIFT +syn keyword xsMacro PMf_CHARSET PMf_CODELIST_PRIVATE PMf_CONST PMf_CONTINUE +syn keyword xsMacro PMf_EVAL PMf_EXTENDED PMf_EXTENDED_MORE PMf_FOLD +syn keyword xsMacro PMf_GLOBAL PMf_HAS_CV PMf_IS_QR PMf_KEEP PMf_KEEPCOPY +syn keyword xsMacro PMf_MULTILINE PMf_NOCAPTURE PMf_NONDESTRUCT PMf_ONCE +syn keyword xsMacro PMf_RETAINT PMf_SINGLELINE PMf_SPLIT PMf_STRICT PMf_USED +syn keyword xsMacro PMf_USE_RE_EVAL PNf PNfARG POPBLOCK POPEVAL POPFORMAT syn keyword xsMacro POPLOOP POPMARK POPSTACK POPSTACK_TO POPSUB POPSUBST syn keyword xsMacro POP_MULTICALL POP_SAVEARRAY POPi POPl POPn POPp POPpbytex -syn keyword xsMacro POPpconstx POPpx POPq POPs POPu POPul POPuq POSTDEC -syn keyword xsMacro POSTINC POWOP PP PREC_LOW PREDEC PREGf_CUTGROUP_SEEN -syn keyword xsMacro PREGf_IMPLICIT PREGf_NAUGHTY PREGf_SKIP -syn keyword xsMacro PREGf_VERBARG_SEEN PREINC PREVOPER PRINTF_FORMAT_NULL_OK -syn keyword xsMacro PRIVATEREF PRIVLIB PRIVLIB_EXP PRIVSHIFT PROCSELFEXE_PATH -syn keyword xsMacro PRUNE PSEUDO PTHREAD_ATFORK PTHREAD_ATTR_SETDETACHSTATE +syn keyword xsMacro POPpconstx POPpx POPs POPu POPul POSIXA POSIXD POSIXL +syn keyword xsMacro POSIXU POSIX_CC_COUNT POSIX_SWASH_COUNT POSTDEC POSTINC +syn keyword xsMacro POSTJOIN POWOP PP PREC_LOW PREDEC PREGf_ANCH +syn keyword xsMacro PREGf_ANCH_GPOS PREGf_ANCH_MBOL PREGf_ANCH_SBOL +syn keyword xsMacro PREGf_CANY_SEEN PREGf_CUTGROUP_SEEN PREGf_GPOS_FLOAT +syn keyword xsMacro PREGf_GPOS_SEEN PREGf_IMPLICIT PREGf_NAUGHTY PREGf_NOSCAN +syn keyword xsMacro PREGf_SKIP PREGf_USE_RE_EVAL PREGf_VERBARG_SEEN PREINC +syn keyword xsMacro PRESCAN_VERSION PREVOPER PRINTF_FORMAT_NULL_OK PRIVATEREF +syn keyword xsMacro PRIVLIB PRIVLIB_EXP PRIVSHIFT PROCSELFEXE_PATH PRUNE +syn keyword xsMacro PSEUDO PTHREAD_ATFORK PTHREAD_ATTR_SETDETACHSTATE syn keyword xsMacro PTHREAD_CREATE PTHREAD_CREATE_JOINABLE syn keyword xsMacro PTHREAD_GETSPECIFIC PTHREAD_GETSPECIFIC_INT PTR2IV PTR2NV syn keyword xsMacro PTR2UV PTR2nat PTR2ul PTRSIZE PTRV PUSHBLOCK PUSHEVAL syn keyword xsMacro PUSHFORMAT PUSHGIVEN PUSHLOOP_FOR PUSHLOOP_PLAIN PUSHMARK syn keyword xsMacro PUSHSTACK PUSHSTACKi PUSHSUB PUSHSUBST PUSHSUB_BASE -syn keyword xsMacro PUSHSUB_DB PUSHTARG PUSHWHEN PUSH_MULTICALL PUSHi -syn keyword xsMacro PUSHmortal PUSHn PUSHp PUSHs PUSHu PUTBACK PWGECOS -syn keyword xsMacro PWPASSWD Pause PeRl_CaTiFy PeRl_StGiFy PerlDir_chdir -syn keyword xsMacro PerlDir_close PerlDir_mapA PerlDir_mapW PerlDir_mkdir -syn keyword xsMacro PerlDir_open PerlDir_read PerlDir_rewind PerlDir_rmdir -syn keyword xsMacro PerlDir_seek PerlDir_tell PerlEnv_ENVgetenv -syn keyword xsMacro PerlEnv_ENVgetenv_len PerlEnv_clearenv -syn keyword xsMacro PerlEnv_free_childdir PerlEnv_free_childenv -syn keyword xsMacro PerlEnv_get_child_IO PerlEnv_get_childdir -syn keyword xsMacro PerlEnv_get_childenv PerlEnv_getenv PerlEnv_getenv_len -syn keyword xsMacro PerlEnv_lib_path PerlEnv_os_id PerlEnv_putenv -syn keyword xsMacro PerlEnv_sitelib_path PerlEnv_uname PerlEnv_vendorlib_path -syn keyword xsMacro PerlIOArg PerlIOBase PerlIONext PerlIOSelf PerlIOValid -syn keyword xsMacro PerlIO_canset_cnt PerlIO_exportFILE PerlIO_fast_gets -syn keyword xsMacro PerlIO_fdopen PerlIO_findFILE PerlIO_getc PerlIO_getname +syn keyword xsMacro PUSHSUB_DB PUSHSUB_GET_LVALUE_MASK PUSHTARG PUSHWHEN +syn keyword xsMacro PUSH_MULTICALL PUSH_MULTICALL_FLAGS PUSHi PUSHmortal +syn keyword xsMacro PUSHn PUSHp PUSHs PUSHu PUTBACK PWGECOS PWPASSWD PadARRAY +syn keyword xsMacro PadMAX PadlistARRAY PadlistMAX PadlistNAMES +syn keyword xsMacro PadlistNAMESARRAY PadlistNAMESMAX PadlistREFCNT +syn keyword xsMacro PadnameFLAGS PadnameIsOUR PadnameIsSTATE +syn keyword xsMacro PadnameIsSTATE_on PadnameLEN PadnameLVALUE +syn keyword xsMacro PadnameLVALUE_on PadnameOURSTASH PadnameOURSTASH_set +syn keyword xsMacro PadnameOUTER PadnamePROTOCV PadnamePV PadnameREFCNT +syn keyword xsMacro PadnameREFCNT_dec PadnameSV PadnameTYPE PadnameTYPE_set +syn keyword xsMacro PadnameUTF8 PadnamelistARRAY PadnamelistMAX +syn keyword xsMacro PadnamelistMAXNAMED PadnamelistREFCNT +syn keyword xsMacro PadnamelistREFCNT_dec Pause PeRl_CaTiFy PeRl_INT64_C +syn keyword xsMacro PeRl_StGiFy PeRl_UINT64_C PerlDir_chdir PerlDir_close +syn keyword xsMacro PerlDir_mapA PerlDir_mapW PerlDir_mkdir PerlDir_open +syn keyword xsMacro PerlDir_read PerlDir_rewind PerlDir_rmdir PerlDir_seek +syn keyword xsMacro PerlDir_tell PerlEnv_ENVgetenv PerlEnv_ENVgetenv_len +syn keyword xsMacro PerlEnv_clearenv PerlEnv_free_childdir +syn keyword xsMacro PerlEnv_free_childenv PerlEnv_get_child_IO +syn keyword xsMacro PerlEnv_get_childdir PerlEnv_get_childenv PerlEnv_getenv +syn keyword xsMacro PerlEnv_getenv_len PerlEnv_lib_path PerlEnv_os_id +syn keyword xsMacro PerlEnv_putenv PerlEnv_sitelib_path PerlEnv_uname +syn keyword xsMacro PerlEnv_vendorlib_path PerlIOArg PerlIOBase PerlIONext +syn keyword xsMacro PerlIOSelf PerlIOValid PerlIO_canset_cnt +syn keyword xsMacro PerlIO_exportFILE PerlIO_fast_gets PerlIO_fdopen +syn keyword xsMacro PerlIO_findFILE PerlIO_getc PerlIO_getname syn keyword xsMacro PerlIO_has_base PerlIO_has_cntptr PerlIO_importFILE syn keyword xsMacro PerlIO_isutf8 PerlIO_open PerlIO_printf PerlIO_putc syn keyword xsMacro PerlIO_puts PerlIO_releaseFILE PerlIO_reopen -syn keyword xsMacro PerlIO_rewind PerlIO_sprintf PerlIO_stdoutf -syn keyword xsMacro PerlIO_tmpfile PerlIO_ungetc PerlIO_vprintf -syn keyword xsMacro PerlLIO_access PerlLIO_chmod PerlLIO_chown PerlLIO_chsize -syn keyword xsMacro PerlLIO_close PerlLIO_dup PerlLIO_dup2 PerlLIO_flock -syn keyword xsMacro PerlLIO_fstat PerlLIO_ioctl PerlLIO_isatty PerlLIO_link -syn keyword xsMacro PerlLIO_lseek PerlLIO_lstat PerlLIO_mkstemp +syn keyword xsMacro PerlIO_rewind PerlIO_stdoutf PerlIO_tmpfile PerlIO_ungetc +syn keyword xsMacro PerlIO_vprintf PerlLIO_access PerlLIO_chmod PerlLIO_chown +syn keyword xsMacro PerlLIO_chsize PerlLIO_close PerlLIO_dup PerlLIO_dup2 +syn keyword xsMacro PerlLIO_flock PerlLIO_fstat PerlLIO_ioctl PerlLIO_isatty +syn keyword xsMacro PerlLIO_link PerlLIO_lseek PerlLIO_lstat PerlLIO_mkstemp syn keyword xsMacro PerlLIO_mktemp PerlLIO_open PerlLIO_open3 PerlLIO_read syn keyword xsMacro PerlLIO_rename PerlLIO_setmode PerlLIO_stat syn keyword xsMacro PerlLIO_tmpnam PerlLIO_umask PerlLIO_unlink PerlLIO_utime @@ -2664,18 +2959,21 @@ syn keyword xsMacro PerlSock_recv PerlSock_recvfrom PerlSock_select syn keyword xsMacro PerlSock_send PerlSock_sendto PerlSock_sethostent syn keyword xsMacro PerlSock_setnetent PerlSock_setprotoent syn keyword xsMacro PerlSock_setservent PerlSock_setsockopt PerlSock_shutdown -syn keyword xsMacro PerlSock_socket PerlSock_socketpair Perl_assert -syn keyword xsMacro Perl_atan2 Perl_atof Perl_atof2 Perl_ceil Perl_cos -syn keyword xsMacro Perl_debug_log Perl_error_log Perl_exp Perl_floor -syn keyword xsMacro Perl_fmod Perl_fp_class Perl_fp_class_denorm -syn keyword xsMacro Perl_fp_class_inf Perl_fp_class_nan Perl_fp_class_ndenorm -syn keyword xsMacro Perl_fp_class_ninf Perl_fp_class_nnorm Perl_fp_class_norm +syn keyword xsMacro PerlSock_socket PerlSock_socketpair Perl_acos Perl_asin +syn keyword xsMacro Perl_assert Perl_atan Perl_atan2 Perl_atof Perl_atof2 +syn keyword xsMacro Perl_ceil Perl_cos Perl_cosh Perl_custom_op_xop +syn keyword xsMacro Perl_debug_log Perl_drand48 Perl_drand48_init +syn keyword xsMacro Perl_error_log Perl_exp Perl_floor Perl_fmod +syn keyword xsMacro Perl_fp_class_denorm Perl_fp_class_inf Perl_fp_class_nan +syn keyword xsMacro Perl_fp_class_ndenorm Perl_fp_class_ninf +syn keyword xsMacro Perl_fp_class_nnorm Perl_fp_class_norm syn keyword xsMacro Perl_fp_class_nzero Perl_fp_class_pdenorm syn keyword xsMacro Perl_fp_class_pinf Perl_fp_class_pnorm syn keyword xsMacro Perl_fp_class_pzero Perl_fp_class_qnan Perl_fp_class_snan -syn keyword xsMacro Perl_fp_class_zero Perl_frexp Perl_isfinite Perl_isinf -syn keyword xsMacro Perl_isnan Perl_log Perl_malloc_good_size Perl_modf -syn keyword xsMacro Perl_pow Perl_pp_accept Perl_pp_aelemfast_lex +syn keyword xsMacro Perl_fp_class_zero Perl_free_c_backtrace Perl_frexp +syn keyword xsMacro Perl_isfinite Perl_isfinitel Perl_isinf Perl_isnan +syn keyword xsMacro Perl_ldexp Perl_log Perl_log10 Perl_malloc_good_size +syn keyword xsMacro Perl_modf Perl_pow Perl_pp_accept Perl_pp_aelemfast_lex syn keyword xsMacro Perl_pp_andassign Perl_pp_avalues Perl_pp_bind syn keyword xsMacro Perl_pp_bit_xor Perl_pp_chmod Perl_pp_chomp syn keyword xsMacro Perl_pp_connect Perl_pp_cos Perl_pp_custom @@ -2701,53 +2999,52 @@ syn keyword xsMacro Perl_pp_kill Perl_pp_lcfirst Perl_pp_lineseq syn keyword xsMacro Perl_pp_listen Perl_pp_localtime Perl_pp_log syn keyword xsMacro Perl_pp_lstat Perl_pp_mapstart Perl_pp_msgctl syn keyword xsMacro Perl_pp_msgget Perl_pp_msgrcv Perl_pp_msgsnd -syn keyword xsMacro Perl_pp_orassign Perl_pp_padany Perl_pp_pop -syn keyword xsMacro Perl_pp_postdec Perl_pp_predec Perl_pp_reach Perl_pp_read -syn keyword xsMacro Perl_pp_recv Perl_pp_regcmaybe Perl_pp_rindex -syn keyword xsMacro Perl_pp_rv2hv Perl_pp_rvalues Perl_pp_say Perl_pp_scalar -syn keyword xsMacro Perl_pp_schomp Perl_pp_scope Perl_pp_seek Perl_pp_semop -syn keyword xsMacro Perl_pp_send Perl_pp_sge Perl_pp_sgrent Perl_pp_sgt -syn keyword xsMacro Perl_pp_shmctl Perl_pp_shmget Perl_pp_shmread -syn keyword xsMacro Perl_pp_shutdown Perl_pp_slt Perl_pp_snetent -syn keyword xsMacro Perl_pp_socket Perl_pp_sprotoent Perl_pp_spwent -syn keyword xsMacro Perl_pp_sqrt Perl_pp_sservent Perl_pp_ssockopt -syn keyword xsMacro Perl_pp_symlink Perl_pp_transr Perl_pp_unlink -syn keyword xsMacro Perl_pp_utime Perl_pp_values Perl_safesysmalloc_size -syn keyword xsMacro Perl_sharepvn Perl_signbit Perl_sin Perl_sqrt -syn keyword xsMacro Perl_va_copy PmopSTASH PmopSTASHPV PmopSTASHPV_set -syn keyword xsMacro PmopSTASH_flags PmopSTASH_flags_set PmopSTASH_free -syn keyword xsMacro PmopSTASH_set Poison PoisonFree PoisonNew PoisonWith -syn keyword xsMacro QR_PAT_MODS QUADKIND QUAD_IS_INT QUAD_IS_INT64_T -syn keyword xsMacro QUAD_IS_LONG QUAD_IS_LONG_LONG QUAD_IS___INT64 QWLIST -syn keyword xsMacro RANDBITS RANDOM_R_PROTO RD_NODATA READDIR64_R_PROTO -syn keyword xsMacro READDIR_R_PROTO REENTRANT_PROTO_B_B REENTRANT_PROTO_B_BI -syn keyword xsMacro REENTRANT_PROTO_B_BW REENTRANT_PROTO_B_CCD -syn keyword xsMacro REENTRANT_PROTO_B_CCS REENTRANT_PROTO_B_IBI -syn keyword xsMacro REENTRANT_PROTO_B_IBW REENTRANT_PROTO_B_SB -syn keyword xsMacro REENTRANT_PROTO_B_SBI REENTRANT_PROTO_I_BI -syn keyword xsMacro REENTRANT_PROTO_I_BW REENTRANT_PROTO_I_CCSBWR -syn keyword xsMacro REENTRANT_PROTO_I_CCSD REENTRANT_PROTO_I_CII -syn keyword xsMacro REENTRANT_PROTO_I_CIISD REENTRANT_PROTO_I_CSBI -syn keyword xsMacro REENTRANT_PROTO_I_CSBIR REENTRANT_PROTO_I_CSBWR -syn keyword xsMacro REENTRANT_PROTO_I_CSBWRE REENTRANT_PROTO_I_CSD -syn keyword xsMacro REENTRANT_PROTO_I_CWISBWRE REENTRANT_PROTO_I_CWISD -syn keyword xsMacro REENTRANT_PROTO_I_D REENTRANT_PROTO_I_H -syn keyword xsMacro REENTRANT_PROTO_I_IBI REENTRANT_PROTO_I_IBW -syn keyword xsMacro REENTRANT_PROTO_I_ICBI REENTRANT_PROTO_I_ICSBWR -syn keyword xsMacro REENTRANT_PROTO_I_ICSD REENTRANT_PROTO_I_ID -syn keyword xsMacro REENTRANT_PROTO_I_IISD REENTRANT_PROTO_I_ISBWR -syn keyword xsMacro REENTRANT_PROTO_I_ISD REENTRANT_PROTO_I_LISBI -syn keyword xsMacro REENTRANT_PROTO_I_LISD REENTRANT_PROTO_I_LS +syn keyword xsMacro Perl_pp_nbit_xor Perl_pp_orassign Perl_pp_padany +syn keyword xsMacro Perl_pp_pop Perl_pp_postdec Perl_pp_predec Perl_pp_reach +syn keyword xsMacro Perl_pp_read Perl_pp_recv Perl_pp_regcmaybe +syn keyword xsMacro Perl_pp_rindex Perl_pp_rv2hv Perl_pp_rvalues Perl_pp_say +syn keyword xsMacro Perl_pp_sbit_xor Perl_pp_scalar Perl_pp_schomp +syn keyword xsMacro Perl_pp_scope Perl_pp_seek Perl_pp_semop Perl_pp_send +syn keyword xsMacro Perl_pp_sge Perl_pp_sgrent Perl_pp_sgt Perl_pp_shmctl +syn keyword xsMacro Perl_pp_shmget Perl_pp_shmread Perl_pp_shutdown +syn keyword xsMacro Perl_pp_slt Perl_pp_snetent Perl_pp_socket +syn keyword xsMacro Perl_pp_sprotoent Perl_pp_spwent Perl_pp_sqrt +syn keyword xsMacro Perl_pp_sservent Perl_pp_ssockopt Perl_pp_symlink +syn keyword xsMacro Perl_pp_transr Perl_pp_unlink Perl_pp_utime +syn keyword xsMacro Perl_pp_values Perl_safesysmalloc_size Perl_sharepvn +syn keyword xsMacro Perl_signbit Perl_sin Perl_sinh Perl_sqrt Perl_strtod +syn keyword xsMacro Perl_tan Perl_tanh Perl_va_copy PmopSTASH PmopSTASHPV +syn keyword xsMacro PmopSTASHPV_set PmopSTASH_set Poison PoisonFree PoisonNew +syn keyword xsMacro PoisonPADLIST PoisonWith QR_PAT_MODS QUADKIND QUAD_IS_INT +syn keyword xsMacro QUAD_IS_INT64_T QUAD_IS_LONG QUAD_IS_LONG_LONG +syn keyword xsMacro QUAD_IS___INT64 QUESTION_MARK_CTRL QWLIST RANDBITS +syn keyword xsMacro RANDOM_R_PROTO RD_NODATA READDIR64_R_PROTO +syn keyword xsMacro READDIR_R_PROTO READ_XDIGIT REENTRANT_PROTO_B_B +syn keyword xsMacro REENTRANT_PROTO_B_BI REENTRANT_PROTO_B_BW +syn keyword xsMacro REENTRANT_PROTO_B_CCD REENTRANT_PROTO_B_CCS +syn keyword xsMacro REENTRANT_PROTO_B_IBI REENTRANT_PROTO_B_IBW +syn keyword xsMacro REENTRANT_PROTO_B_SB REENTRANT_PROTO_B_SBI +syn keyword xsMacro REENTRANT_PROTO_I_BI REENTRANT_PROTO_I_BW +syn keyword xsMacro REENTRANT_PROTO_I_CCSBWR REENTRANT_PROTO_I_CCSD +syn keyword xsMacro REENTRANT_PROTO_I_CII REENTRANT_PROTO_I_CIISD +syn keyword xsMacro REENTRANT_PROTO_I_CSBI REENTRANT_PROTO_I_CSBIR +syn keyword xsMacro REENTRANT_PROTO_I_CSBWR REENTRANT_PROTO_I_CSBWRE +syn keyword xsMacro REENTRANT_PROTO_I_CSD REENTRANT_PROTO_I_CWISBWRE +syn keyword xsMacro REENTRANT_PROTO_I_CWISD REENTRANT_PROTO_I_D +syn keyword xsMacro REENTRANT_PROTO_I_H REENTRANT_PROTO_I_IBI +syn keyword xsMacro REENTRANT_PROTO_I_IBW REENTRANT_PROTO_I_ICBI +syn keyword xsMacro REENTRANT_PROTO_I_ICSBWR REENTRANT_PROTO_I_ICSD +syn keyword xsMacro REENTRANT_PROTO_I_ID REENTRANT_PROTO_I_IISD +syn keyword xsMacro REENTRANT_PROTO_I_ISBWR REENTRANT_PROTO_I_ISD +syn keyword xsMacro REENTRANT_PROTO_I_LISBI REENTRANT_PROTO_I_LISD syn keyword xsMacro REENTRANT_PROTO_I_SB REENTRANT_PROTO_I_SBI syn keyword xsMacro REENTRANT_PROTO_I_SBIE REENTRANT_PROTO_I_SBIH syn keyword xsMacro REENTRANT_PROTO_I_SBIR REENTRANT_PROTO_I_SBWR syn keyword xsMacro REENTRANT_PROTO_I_SBWRE REENTRANT_PROTO_I_SD -syn keyword xsMacro REENTRANT_PROTO_I_ST REENTRANT_PROTO_I_St syn keyword xsMacro REENTRANT_PROTO_I_TISD REENTRANT_PROTO_I_TS syn keyword xsMacro REENTRANT_PROTO_I_TSBI REENTRANT_PROTO_I_TSBIR syn keyword xsMacro REENTRANT_PROTO_I_TSBWR REENTRANT_PROTO_I_TSR syn keyword xsMacro REENTRANT_PROTO_I_TsISBWRE REENTRANT_PROTO_I_UISBWRE -syn keyword xsMacro REENTRANT_PROTO_I_iS REENTRANT_PROTO_I_lS syn keyword xsMacro REENTRANT_PROTO_I_uISBWRE REENTRANT_PROTO_S_CBI syn keyword xsMacro REENTRANT_PROTO_S_CCSBI REENTRANT_PROTO_S_CIISBIE syn keyword xsMacro REENTRANT_PROTO_S_CSBI REENTRANT_PROTO_S_CSBIE @@ -2762,160 +3059,201 @@ syn keyword xsMacro REENTRANT_PROTO_V_ID REENTR_H REENTR_MEMZERO REF syn keyword xsMacro REFCOUNTED_HE_EXISTS REFCOUNTED_HE_KEY_UTF8 REFF REFFA syn keyword xsMacro REFFL REFFU REFGEN REF_HE_KEY REGMATCH_STATE_MAX syn keyword xsMacro REGNODE_MAX REGNODE_SIMPLE REGNODE_VARIES REG_ANY -syn keyword xsMacro REG_INFTY REG_MAGIC REG_SEEN_CANY REG_SEEN_CUTGROUP -syn keyword xsMacro REG_SEEN_EVAL REG_SEEN_EXACTF_SHARP_S REG_SEEN_GPOS -syn keyword xsMacro REG_SEEN_LOOKBEHIND REG_SEEN_RECURSE -syn keyword xsMacro REG_SEEN_RUN_ON_COMMENT REG_SEEN_SANY REG_SEEN_VERBARG -syn keyword xsMacro REG_SEEN_ZERO_LEN REG_TOP_LEVEL_BRANCHES RELOP RENUM -syn keyword xsMacro REQUIRE RESTORE_ERRNO RESTORE_NUMERIC_LOCAL +syn keyword xsMacro REG_CANY_SEEN REG_CUTGROUP_SEEN REG_EXTFLAGS_NAME_SIZE +syn keyword xsMacro REG_GOSTART_SEEN REG_GPOS_SEEN REG_INFTY +syn keyword xsMacro REG_INTFLAGS_NAME_SIZE REG_LOOKBEHIND_SEEN REG_MAGIC +syn keyword xsMacro REG_RECURSE_SEEN REG_RUN_ON_COMMENT_SEEN +syn keyword xsMacro REG_TOP_LEVEL_BRANCHES_SEEN REG_UNBOUNDED_QUANTIFIER_SEEN +syn keyword xsMacro REG_UNFOLDED_MULTI_SEEN REG_VERBARG_SEEN +syn keyword xsMacro REG_ZERO_LEN_SEEN RELOP RENUM REQUIRE RESTORE_ERRNO +syn keyword xsMacro RESTORE_LC_NUMERIC RESTORE_LC_NUMERIC_STANDARD +syn keyword xsMacro RESTORE_LC_NUMERIC_UNDERLYING RESTORE_NUMERIC_LOCAL syn keyword xsMacro RESTORE_NUMERIC_STANDARD RETPUSHNO RETPUSHUNDEF -syn keyword xsMacro RETPUSHYES RETSETNO RETSETUNDEF RETSETYES RETURN RETURNOP -syn keyword xsMacro RETURNX RETURN_PROBE REXEC_CHECKED REXEC_COPY_STR -syn keyword xsMacro REXEC_IGNOREPOS REXEC_NOT_FIRST REXEC_SCREAM -syn keyword xsMacro RE_DEBUG_COMPILE_DUMP RE_DEBUG_COMPILE_FLAGS +syn keyword xsMacro RETPUSHYES RETSETNO RETSETTARG RETSETUNDEF RETSETYES +syn keyword xsMacro RETURN RETURNOP RETURNX RETURN_PROBE REXEC_CHECKED +syn keyword xsMacro REXEC_COPY_SKIP_POST REXEC_COPY_SKIP_PRE REXEC_COPY_STR +syn keyword xsMacro REXEC_FAIL_ON_UNDERFLOW REXEC_IGNOREPOS REXEC_NOT_FIRST +syn keyword xsMacro REXEC_SCREAM RE_DEBUG_COMPILE_DUMP RE_DEBUG_COMPILE_FLAGS syn keyword xsMacro RE_DEBUG_COMPILE_MASK RE_DEBUG_COMPILE_OPTIMISE -syn keyword xsMacro RE_DEBUG_COMPILE_PARSE RE_DEBUG_COMPILE_TRIE -syn keyword xsMacro RE_DEBUG_EXECUTE_INTUIT RE_DEBUG_EXECUTE_MASK -syn keyword xsMacro RE_DEBUG_EXECUTE_MATCH RE_DEBUG_EXECUTE_TRIE -syn keyword xsMacro RE_DEBUG_EXTRA_BUFFERS RE_DEBUG_EXTRA_GPOS -syn keyword xsMacro RE_DEBUG_EXTRA_MASK RE_DEBUG_EXTRA_OFFDEBUG -syn keyword xsMacro RE_DEBUG_EXTRA_OFFSETS RE_DEBUG_EXTRA_OPTIMISE -syn keyword xsMacro RE_DEBUG_EXTRA_STACK RE_DEBUG_EXTRA_STATE -syn keyword xsMacro RE_DEBUG_EXTRA_TRIE RE_DEBUG_FLAG RE_DEBUG_FLAGS -syn keyword xsMacro RE_PV_COLOR_DECL RE_PV_QUOTED_DECL RE_SV_DUMPLEN -syn keyword xsMacro RE_SV_ESCAPE RE_SV_TAIL RE_TRACK_PATTERN_OFFSETS -syn keyword xsMacro RE_TRIE_MAXBUF_INIT RE_TRIE_MAXBUF_NAME RMS_DIR RMS_FAC -syn keyword xsMacro RMS_FEX RMS_FNF RMS_IFI RMS_ISI RMS_PRV RUNOPS_DEFAULT -syn keyword xsMacro RV2CVOPCV_MARK_EARLY RV2CVOPCV_RETURN_NAME_GV -syn keyword xsMacro RX_ANCHORED_SUBSTR RX_ANCHORED_UTF8 RX_BUFF_IDX_FULLMATCH +syn keyword xsMacro RE_DEBUG_COMPILE_PARSE RE_DEBUG_COMPILE_TEST +syn keyword xsMacro RE_DEBUG_COMPILE_TRIE RE_DEBUG_EXECUTE_INTUIT +syn keyword xsMacro RE_DEBUG_EXECUTE_MASK RE_DEBUG_EXECUTE_MATCH +syn keyword xsMacro RE_DEBUG_EXECUTE_TRIE RE_DEBUG_EXTRA_BUFFERS +syn keyword xsMacro RE_DEBUG_EXTRA_GPOS RE_DEBUG_EXTRA_MASK +syn keyword xsMacro RE_DEBUG_EXTRA_OFFDEBUG RE_DEBUG_EXTRA_OFFSETS +syn keyword xsMacro RE_DEBUG_EXTRA_OPTIMISE RE_DEBUG_EXTRA_STACK +syn keyword xsMacro RE_DEBUG_EXTRA_STATE RE_DEBUG_EXTRA_TRIE RE_DEBUG_FLAG +syn keyword xsMacro RE_DEBUG_FLAGS RE_PV_COLOR_DECL RE_PV_QUOTED_DECL +syn keyword xsMacro RE_SV_DUMPLEN RE_SV_ESCAPE RE_SV_TAIL +syn keyword xsMacro RE_TRACK_PATTERN_OFFSETS RE_TRIE_MAXBUF_INIT +syn keyword xsMacro RE_TRIE_MAXBUF_NAME RMS_DIR RMS_FAC RMS_FEX RMS_FNF +syn keyword xsMacro RMS_IFI RMS_ISI RMS_PRV ROTL32 ROTL64 ROTL_UV +syn keyword xsMacro RUNOPS_DEFAULT RV2CVOPCV_FLAG_MASK RV2CVOPCV_MARK_EARLY +syn keyword xsMacro RV2CVOPCV_MAYBE_NAME_GV RV2CVOPCV_RETURN_NAME_GV +syn keyword xsMacro RV2CVOPCV_RETURN_STUB RX_ANCHORED_SUBSTR RX_ANCHORED_UTF8 +syn keyword xsMacro RX_BUFF_IDX_CARET_FULLMATCH RX_BUFF_IDX_CARET_POSTMATCH +syn keyword xsMacro RX_BUFF_IDX_CARET_PREMATCH RX_BUFF_IDX_FULLMATCH syn keyword xsMacro RX_BUFF_IDX_POSTMATCH RX_BUFF_IDX_PREMATCH -syn keyword xsMacro RX_CHECK_SUBSTR RX_ENGINE RX_EXTFLAGS RX_FLOAT_SUBSTR -syn keyword xsMacro RX_FLOAT_UTF8 RX_GOFS RX_HAS_CUTGROUP RX_LASTCLOSEPAREN -syn keyword xsMacro RX_LASTPAREN RX_MATCH_COPIED RX_MATCH_COPIED_off -syn keyword xsMacro RX_MATCH_COPIED_on RX_MATCH_COPIED_set RX_MATCH_COPY_FREE -syn keyword xsMacro RX_MATCH_TAINTED RX_MATCH_TAINTED_off RX_MATCH_TAINTED_on +syn keyword xsMacro RX_CHECK_SUBSTR RX_COMPFLAGS RX_ENGINE RX_EXTFLAGS +syn keyword xsMacro RX_FLOAT_SUBSTR RX_FLOAT_UTF8 RX_GOFS RX_HAS_CUTGROUP +syn keyword xsMacro RX_INTFLAGS RX_ISTAINTED RX_LASTCLOSEPAREN RX_LASTPAREN +syn keyword xsMacro RX_MATCH_COPIED RX_MATCH_COPIED_off RX_MATCH_COPIED_on +syn keyword xsMacro RX_MATCH_COPIED_set RX_MATCH_COPY_FREE RX_MATCH_TAINTED +syn keyword xsMacro RX_MATCH_TAINTED_off RX_MATCH_TAINTED_on syn keyword xsMacro RX_MATCH_TAINTED_set RX_MATCH_UTF8 RX_MATCH_UTF8_off syn keyword xsMacro RX_MATCH_UTF8_on RX_MATCH_UTF8_set RX_MINLEN RX_MINLENRET syn keyword xsMacro RX_NPARENS RX_OFFS RX_PRECOMP RX_PRECOMP_const RX_PRELEN -syn keyword xsMacro RX_REFCNT RX_SAVED_COPY RX_SEEN_EVALS RX_SUBBEG RX_SUBLEN -syn keyword xsMacro RX_UTF8 RX_WRAPLEN RX_WRAPPED RX_WRAPPED_const RXapif_ALL -syn keyword xsMacro RXapif_CLEAR RXapif_DELETE RXapif_EXISTS RXapif_FETCH -syn keyword xsMacro RXapif_FIRSTKEY RXapif_NEXTKEY RXapif_ONE RXapif_REGNAME -syn keyword xsMacro RXapif_REGNAMES RXapif_REGNAMES_COUNT RXapif_SCALAR -syn keyword xsMacro RXapif_STORE RXf_ANCH RXf_ANCH_BOL RXf_ANCH_GPOS -syn keyword xsMacro RXf_ANCH_MBOL RXf_ANCH_SBOL RXf_ANCH_SINGLE -syn keyword xsMacro RXf_BASE_SHIFT RXf_CANY_SEEN RXf_CHECK_ALL RXf_COPY_DONE -syn keyword xsMacro RXf_EVAL_SEEN RXf_GPOS_CHECK RXf_GPOS_FLOAT RXf_GPOS_SEEN -syn keyword xsMacro RXf_INTUIT_TAIL RXf_LOOKBEHIND_SEEN RXf_MATCH_UTF8 -syn keyword xsMacro RXf_NOSCAN RXf_NULL RXf_PMf_CHARSET RXf_PMf_COMPILETIME -syn keyword xsMacro RXf_PMf_EXTENDED RXf_PMf_FOLD RXf_PMf_KEEPCOPY -syn keyword xsMacro RXf_PMf_MULTILINE RXf_PMf_SINGLELINE RXf_PMf_STD_PMMOD -syn keyword xsMacro RXf_PMf_STD_PMMOD_SHIFT RXf_SKIPWHITE RXf_SPLIT -syn keyword xsMacro RXf_START_ONLY RXf_TAINTED RXf_TAINTED_SEEN -syn keyword xsMacro RXf_USE_INTUIT RXf_USE_INTUIT_ML RXf_USE_INTUIT_NOML -syn keyword xsMacro RXf_WHITE RXi_GET RXi_GET_DECL RXi_SET RXp_EXTFLAGS -syn keyword xsMacro RXp_MATCH_COPIED RXp_MATCH_COPIED_off RXp_MATCH_COPIED_on -syn keyword xsMacro RXp_MATCH_TAINTED RXp_MATCH_UTF8 RXp_PAREN_NAMES +syn keyword xsMacro RX_REFCNT RX_SAVED_COPY RX_SUBBEG RX_SUBCOFFSET RX_SUBLEN +syn keyword xsMacro RX_SUBOFFSET RX_TAINT_on RX_UTF8 RX_WRAPLEN RX_WRAPPED +syn keyword xsMacro RX_WRAPPED_const RX_ZERO_LEN RXapif_ALL RXapif_CLEAR +syn keyword xsMacro RXapif_DELETE RXapif_EXISTS RXapif_FETCH RXapif_FIRSTKEY +syn keyword xsMacro RXapif_NEXTKEY RXapif_ONE RXapif_REGNAME RXapif_REGNAMES +syn keyword xsMacro RXapif_REGNAMES_COUNT RXapif_SCALAR RXapif_STORE +syn keyword xsMacro RXf_BASE_SHIFT RXf_CHECK_ALL RXf_COPY_DONE RXf_EVAL_SEEN +syn keyword xsMacro RXf_INTUIT_TAIL RXf_IS_ANCHORED RXf_MATCH_UTF8 +syn keyword xsMacro RXf_NO_INPLACE_SUBST RXf_NULL RXf_PMf_CHARSET +syn keyword xsMacro RXf_PMf_COMPILETIME RXf_PMf_EXTENDED +syn keyword xsMacro RXf_PMf_EXTENDED_MORE RXf_PMf_FLAGCOPYMASK RXf_PMf_FOLD +syn keyword xsMacro RXf_PMf_KEEPCOPY RXf_PMf_MULTILINE RXf_PMf_NOCAPTURE +syn keyword xsMacro RXf_PMf_SINGLELINE RXf_PMf_SPLIT RXf_PMf_STD_PMMOD +syn keyword xsMacro RXf_PMf_STD_PMMOD_SHIFT RXf_PMf_STRICT RXf_SKIPWHITE +syn keyword xsMacro RXf_SPLIT RXf_START_ONLY RXf_TAINTED RXf_TAINTED_SEEN +syn keyword xsMacro RXf_UNBOUNDED_QUANTIFIER_SEEN RXf_USE_INTUIT +syn keyword xsMacro RXf_USE_INTUIT_ML RXf_USE_INTUIT_NOML RXf_WHITE RXi_GET +syn keyword xsMacro RXi_GET_DECL RXi_SET RXp_COMPFLAGS RXp_EXTFLAGS +syn keyword xsMacro RXp_INTFLAGS RXp_MATCH_COPIED RXp_MATCH_COPIED_off +syn keyword xsMacro RXp_MATCH_COPIED_on RXp_MATCH_TAINTED +syn keyword xsMacro RXp_MATCH_TAINTED_on RXp_MATCH_UTF8 RXp_PAREN_NAMES ReANY syn keyword xsMacro ReREFCNT_dec ReREFCNT_inc Renew Renewc RsPARA RsRECORD syn keyword xsMacro RsSIMPLE RsSNARF SAFE_TRIE_NODENUM SANY SAVEADELETE syn keyword xsMacro SAVEBOOL SAVECLEARSV SAVECOMPILEWARNINGS SAVECOMPPAD -syn keyword xsMacro SAVECOPFILE SAVECOPFILE_FREE SAVECOPLINE SAVECOPSTASH +syn keyword xsMacro SAVECOPFILE SAVECOPFILE_FREE SAVECOPLINE syn keyword xsMacro SAVECOPSTASH_FREE SAVEDELETE SAVEDESTRUCTOR -syn keyword xsMacro SAVEDESTRUCTOR_X SAVEFREECOPHH SAVEFREEOP SAVEFREEPV -syn keyword xsMacro SAVEFREESV SAVEGENERICPV SAVEGENERICSV SAVEHDELETE -syn keyword xsMacro SAVEHINTS SAVEI16 SAVEI32 SAVEI8 SAVEINT SAVEIV SAVELONG -syn keyword xsMacro SAVEMORTALIZESV SAVEOP SAVEPADSVANDMORTALIZE SAVEPARSER -syn keyword xsMacro SAVEPPTR SAVESETSVFLAGS SAVESHAREDPV SAVESPTR -syn keyword xsMacro SAVESTACK_ALLOC_FOR_RE_SAVE_STATE SAVESTACK_CXPOS -syn keyword xsMacro SAVESTACK_POS SAVESWITCHSTACK SAVETMPS SAVEVPTR -syn keyword xsMacro SAVE_DEFSV SAVE_ERRNO SAVE_MASK SAVE_TIGHT_SHIFT -syn keyword xsMacro SAVEf_KEEPOLDELEM SAVEf_SETMAGIC SAVEt_ADELETE -syn keyword xsMacro SAVEt_AELEM SAVEt_ALLOC SAVEt_APTR SAVEt_AV SAVEt_BOOL -syn keyword xsMacro SAVEt_CLEARSV SAVEt_COMPILE_WARNINGS SAVEt_COMPPAD -syn keyword xsMacro SAVEt_DELETE SAVEt_DESTRUCTOR SAVEt_DESTRUCTOR_X -syn keyword xsMacro SAVEt_FREECOPHH SAVEt_FREEOP SAVEt_FREEPV SAVEt_FREESV +syn keyword xsMacro SAVEDESTRUCTOR_X SAVEFREECOPHH SAVEFREEOP SAVEFREEPADNAME +syn keyword xsMacro SAVEFREEPV SAVEFREESV SAVEGENERICPV SAVEGENERICSV +syn keyword xsMacro SAVEHDELETE SAVEHINTS SAVEI16 SAVEI32 SAVEI8 SAVEINT +syn keyword xsMacro SAVEIV SAVELONG SAVEMORTALIZESV SAVEOP +syn keyword xsMacro SAVEPADSVANDMORTALIZE SAVEPARSER SAVEPPTR SAVESETSVFLAGS +syn keyword xsMacro SAVESHAREDPV SAVESPTR SAVESTACK_POS SAVESWITCHSTACK +syn keyword xsMacro SAVETMPS SAVEVPTR SAVE_DEFSV SAVE_ERRNO SAVE_MASK +syn keyword xsMacro SAVE_TIGHT_SHIFT SAVEf_KEEPOLDELEM SAVEf_SETMAGIC +syn keyword xsMacro SAVEt_ADELETE SAVEt_AELEM SAVEt_ALLOC SAVEt_APTR +syn keyword xsMacro SAVEt_ARG0_MAX SAVEt_ARG1_MAX SAVEt_ARG2_MAX SAVEt_AV +syn keyword xsMacro SAVEt_BOOL SAVEt_CLEARPADRANGE SAVEt_CLEARSV +syn keyword xsMacro SAVEt_COMPILE_WARNINGS SAVEt_COMPPAD SAVEt_DELETE +syn keyword xsMacro SAVEt_DESTRUCTOR SAVEt_DESTRUCTOR_X SAVEt_FREECOPHH +syn keyword xsMacro SAVEt_FREEOP SAVEt_FREEPADNAME SAVEt_FREEPV SAVEt_FREESV syn keyword xsMacro SAVEt_GENERIC_PVREF SAVEt_GENERIC_SVREF SAVEt_GP -syn keyword xsMacro SAVEt_GVSV SAVEt_HELEM SAVEt_HINTS SAVEt_HPTR SAVEt_HV -syn keyword xsMacro SAVEt_I16 SAVEt_I32 SAVEt_I32_SMALL SAVEt_I8 SAVEt_INT -syn keyword xsMacro SAVEt_INT_SMALL SAVEt_ITEM SAVEt_IV SAVEt_LONG -syn keyword xsMacro SAVEt_MORTALIZESV SAVEt_NSTAB SAVEt_OP -syn keyword xsMacro SAVEt_PADSV_AND_MORTALIZE SAVEt_PARSER SAVEt_PPTR -syn keyword xsMacro SAVEt_REGCONTEXT SAVEt_RE_STATE SAVEt_SAVESWITCHSTACK -syn keyword xsMacro SAVEt_SET_SVFLAGS SAVEt_SHARED_PVREF SAVEt_SPTR -syn keyword xsMacro SAVEt_STACK_CXPOS SAVEt_STACK_POS SAVEt_SV SAVEt_SVREF -syn keyword xsMacro SAVEt_VPTR SBOL SCAN_DEF SCAN_REPL SCAN_TR SCHEDULE -syn keyword xsMacro SCHED_YIELD SCOPE_SAVES_SIGNAL_MASK SEEK_CUR SEEK_END -syn keyword xsMacro SEEK_SET SELECT_MIN_BITS SEOL SETERRNO SETGRENT_R_PROTO -syn keyword xsMacro SETHOSTENT_R_PROTO SETLOCALE_R_PROTO SETNETENT_R_PROTO -syn keyword xsMacro SETPROTOENT_R_PROTO SETPWENT_R_PROTO SETSERVENT_R_PROTO -syn keyword xsMacro SETTARG SET_MARK_OFFSET SET_NUMERIC_LOCAL -syn keyword xsMacro SET_NUMERIC_STANDARD SET_THR SET_THREAD_SELF SETi SETn -syn keyword xsMacro SETp SETs SETsv SETsvUN SETu SHARP_S_SKIP SHIFTOP -syn keyword xsMacro SHORTSIZE SH_PATH SIGABRT SIGILL SIG_NAME SIG_NUM -syn keyword xsMacro SIG_SIZE SINGLE_PAT_MOD SITEARCH SITEARCH_EXP SITELIB -syn keyword xsMacro SITELIB_EXP SITELIB_STEM SIZE_ALIGN SIZE_ONLY SKIP -syn keyword xsMacro SKIP_next SKIP_next_fail SLOPPYDIVIDE SOCKET_OPEN_MODE -syn keyword xsMacro SPACE SPACEA SPACEL SPACEU SPAGAIN SPRINTF_RETURNS_STRLEN -syn keyword xsMacro SRAND48_R_PROTO SRANDOM_R_PROTO SSCHECK SSGROW SSNEW -syn keyword xsMacro SSNEWa SSNEWat SSNEWt SSPOPBOOL SSPOPDPTR SSPOPDXPTR -syn keyword xsMacro SSPOPINT SSPOPIV SSPOPLONG SSPOPPTR SSPOPUV SSPTR SSPTRt +syn keyword xsMacro SAVEt_GP_ALIASED_SV SAVEt_GVSLOT SAVEt_GVSV SAVEt_HELEM +syn keyword xsMacro SAVEt_HINTS SAVEt_HPTR SAVEt_HV SAVEt_I16 SAVEt_I32 +syn keyword xsMacro SAVEt_I32_SMALL SAVEt_I8 SAVEt_INT SAVEt_INT_SMALL +syn keyword xsMacro SAVEt_ITEM SAVEt_IV SAVEt_LONG SAVEt_MORTALIZESV +syn keyword xsMacro SAVEt_NSTAB SAVEt_OP SAVEt_PADSV_AND_MORTALIZE +syn keyword xsMacro SAVEt_PARSER SAVEt_PPTR SAVEt_READONLY_OFF +syn keyword xsMacro SAVEt_REGCONTEXT SAVEt_SAVESWITCHSTACK SAVEt_SET_SVFLAGS +syn keyword xsMacro SAVEt_SHARED_PVREF SAVEt_SPTR SAVEt_STACK_POS +syn keyword xsMacro SAVEt_STRLEN SAVEt_SV SAVEt_SVREF SAVEt_VPTR +syn keyword xsMacro SAWAMPERSAND_LEFT SAWAMPERSAND_MIDDLE SAWAMPERSAND_RIGHT +syn keyword xsMacro SBOL SB_ENUM_COUNT SCAN_DEF SCAN_REPL SCAN_TR +syn keyword xsMacro SCAN_VERSION SCHED_YIELD SCOPE_SAVES_SIGNAL_MASK SEEK_CUR +syn keyword xsMacro SEEK_END SEEK_SET SELECT_MIN_BITS SEOL SETERRNO +syn keyword xsMacro SETGRENT_R_PROTO SETHOSTENT_R_PROTO SETLOCALE_R_PROTO +syn keyword xsMacro SETNETENT_R_PROTO SETPROTOENT_R_PROTO SETPWENT_R_PROTO +syn keyword xsMacro SETSERVENT_R_PROTO SETTARG SET_MARK_OFFSET +syn keyword xsMacro SET_NUMERIC_LOCAL SET_NUMERIC_STANDARD +syn keyword xsMacro SET_NUMERIC_UNDERLYING SET_THR SET_THREAD_SELF SETi SETn +syn keyword xsMacro SETp SETs SETu SHARP_S_SKIP SHIFTOP SHORTSIZE SH_PATH +syn keyword xsMacro SIGABRT SIGILL SIG_NAME SIG_NUM SIG_SIZE SINGLE_PAT_MOD +syn keyword xsMacro SIPROUND SITEARCH SITEARCH_EXP SITELIB SITELIB_EXP +syn keyword xsMacro SITELIB_STEM SIZE_ALIGN SIZE_ONLY SKIP SKIP_next +syn keyword xsMacro SKIP_next_fail SLOPPYDIVIDE SOCKET_OPEN_MODE SPAGAIN +syn keyword xsMacro SPRINTF_RETURNS_STRLEN SRAND48_R_PROTO SRANDOM_R_PROTO +syn keyword xsMacro SSCHECK SSC_MATCHES_EMPTY_STRING SSGROW SSNEW SSNEWa +syn keyword xsMacro SSNEWat SSNEWt SSPOPBOOL SSPOPDPTR SSPOPDXPTR SSPOPINT +syn keyword xsMacro SSPOPIV SSPOPLONG SSPOPPTR SSPOPUV SSPTR SSPTRt syn keyword xsMacro SSPUSHBOOL SSPUSHDPTR SSPUSHDXPTR SSPUSHINT SSPUSHIV -syn keyword xsMacro SSPUSHLONG SSPUSHPTR SSPUSHUV SS_ACCVIO SS_DEVOFFLINE -syn keyword xsMacro SS_IVCHAN SS_NORMAL ST STANDARD_C STAR STARTPERL -syn keyword xsMacro START_EXTERN_C START_MY_CXT STATIC STATUS_ALL_FAILURE -syn keyword xsMacro STATUS_ALL_SUCCESS STATUS_CURRENT STATUS_EXIT -syn keyword xsMacro STATUS_EXIT_SET STATUS_NATIVE STATUS_NATIVE_CHILD_SET -syn keyword xsMacro STATUS_UNIX STATUS_UNIX_EXIT_SET STATUS_UNIX_SET STDCHAR -syn keyword xsMacro STDIO_PTR_LVALUE STDIO_PTR_LVAL_SETS_CNT -syn keyword xsMacro STDIO_STREAM_ARRAY STD_PAT_MODS STD_PMMOD_FLAGS_CLEAR -syn keyword xsMacro STMT_END STMT_START STORE_NUMERIC_LOCAL_SET_STANDARD +syn keyword xsMacro SSPUSHLONG SSPUSHPTR SSPUSHUV SS_ACCVIO SS_ADD_BOOL +syn keyword xsMacro SS_ADD_DPTR SS_ADD_DXPTR SS_ADD_END SS_ADD_INT SS_ADD_IV +syn keyword xsMacro SS_ADD_LONG SS_ADD_PTR SS_ADD_UV SS_BUFFEROVF +syn keyword xsMacro SS_DEVOFFLINE SS_IVCHAN SS_MAXPUSH SS_NOPRIV SS_NORMAL +syn keyword xsMacro SSize_t_MAX ST STANDARD_C STAR STARTPERL START_EXTERN_C +syn keyword xsMacro START_MY_CXT STATIC STATIC_ASSERT_1 STATIC_ASSERT_2 +syn keyword xsMacro STATIC_ASSERT_GLOBAL STATIC_ASSERT_STMT +syn keyword xsMacro STATUS_ALL_FAILURE STATUS_ALL_SUCCESS STATUS_CURRENT +syn keyword xsMacro STATUS_EXIT STATUS_EXIT_SET STATUS_NATIVE +syn keyword xsMacro STATUS_NATIVE_CHILD_SET STATUS_UNIX STATUS_UNIX_EXIT_SET +syn keyword xsMacro STATUS_UNIX_SET STDCHAR STDIO_STREAM_ARRAY STD_PAT_MODS +syn keyword xsMacro STD_PMMOD_FLAGS_CLEAR STD_PMMOD_FLAGS_PARSE_X_WARN +syn keyword xsMacro STMT_END STMT_START STORE_LC_NUMERIC_FORCE_TO_UNDERLYING +syn keyword xsMacro STORE_LC_NUMERIC_SET_TO_NEEDED +syn keyword xsMacro STORE_LC_NUMERIC_STANDARD_SET_UNDERLYING +syn keyword xsMacro STORE_LC_NUMERIC_UNDERLYING_SET_STANDARD +syn keyword xsMacro STORE_NUMERIC_LOCAL_SET_STANDARD +syn keyword xsMacro STORE_NUMERIC_STANDARD_FORCE_LOCAL syn keyword xsMacro STORE_NUMERIC_STANDARD_SET_LOCAL STRERROR_R_PROTO STRING syn keyword xsMacro STRINGIFY STRUCT_OFFSET STRUCT_SV STR_LEN STR_SZ syn keyword xsMacro STR_WITH_LEN ST_INO_SIGN ST_INO_SIZE SUB syn keyword xsMacro SUBST_TAINT_BOOLRET SUBST_TAINT_PAT SUBST_TAINT_REPL syn keyword xsMacro SUBST_TAINT_RETAINT SUBST_TAINT_STR SUBVERSION SUCCEED syn keyword xsMacro SUSPEND SVTYPEMASK SV_CATBYTES SV_CATUTF8 -syn keyword xsMacro SV_CHECK_THINKFIRST SV_CHECK_THINKFIRST_COW_DROP -syn keyword xsMacro SV_CONST_RETURN SV_COW_DROP_PV SV_COW_OTHER_PVS +syn keyword xsMacro SV_CHECK_THINKFIRST SV_CHECK_THINKFIRST_COW_DROP SV_CONST +syn keyword xsMacro SV_CONSTS_COUNT SV_CONST_BINMODE SV_CONST_CLEAR +syn keyword xsMacro SV_CONST_CLOSE SV_CONST_DELETE SV_CONST_DESTROY +syn keyword xsMacro SV_CONST_EOF SV_CONST_EXISTS SV_CONST_EXTEND +syn keyword xsMacro SV_CONST_FETCH SV_CONST_FETCHSIZE SV_CONST_FILENO +syn keyword xsMacro SV_CONST_FIRSTKEY SV_CONST_GETC SV_CONST_NEXTKEY +syn keyword xsMacro SV_CONST_OPEN SV_CONST_POP SV_CONST_PRINT SV_CONST_PRINTF +syn keyword xsMacro SV_CONST_PUSH SV_CONST_READ SV_CONST_READLINE +syn keyword xsMacro SV_CONST_RETURN SV_CONST_SCALAR SV_CONST_SEEK +syn keyword xsMacro SV_CONST_SHIFT SV_CONST_SPLICE SV_CONST_STORE +syn keyword xsMacro SV_CONST_STORESIZE SV_CONST_TELL SV_CONST_TIEARRAY +syn keyword xsMacro SV_CONST_TIEHANDLE SV_CONST_TIEHASH SV_CONST_TIESCALAR +syn keyword xsMacro SV_CONST_UNSHIFT SV_CONST_UNTIE SV_CONST_WRITE +syn keyword xsMacro SV_COW_DROP_PV SV_COW_OTHER_PVS SV_COW_REFCNT_MAX syn keyword xsMacro SV_COW_SHARED_HASH_KEYS SV_DO_COW_SVSETSV syn keyword xsMacro SV_FORCE_UTF8_UPGRADE SV_GMAGIC SV_HAS_TRAILING_NUL syn keyword xsMacro SV_IMMEDIATE_UNREF SV_MUTABLE_RETURN SV_NOSTEAL syn keyword xsMacro SV_SAVED_COPY SV_SKIP_OVERLOAD SV_SMAGIC syn keyword xsMacro SV_UNDEF_RETURNS_NULL SV_UTF8_NO_ENCODING SVrepl_EVAL -syn keyword xsMacro SVt_MASK SWITCHSTACK SYMBIAN SYSTEM_GMTIME_MAX +syn keyword xsMacro SVt_FIRST SVt_MASK SWITCHSTACK SYMBIAN SYSTEM_GMTIME_MAX syn keyword xsMacro SYSTEM_GMTIME_MIN SYSTEM_LOCALTIME_MAX syn keyword xsMacro SYSTEM_LOCALTIME_MIN S_IEXEC S_IFIFO S_IFMT S_IREAD syn keyword xsMacro S_IRGRP S_IROTH S_IRUSR S_IRWXG S_IRWXO S_IRWXU S_ISBLK syn keyword xsMacro S_ISCHR S_ISDIR S_ISFIFO S_ISGID S_ISLNK S_ISREG S_ISSOCK syn keyword xsMacro S_ISUID S_IWGRP S_IWOTH S_IWRITE S_IWUSR S_IXGRP S_IXOTH syn keyword xsMacro S_IXUSR S_PAT_MODS Safefree Semctl Sigjmp_buf Siglongjmp -syn keyword xsMacro Sigsetjmp Size_t_size StGiFy StashHANDLER Stat Strerror -syn keyword xsMacro Strtol Strtoul StructCopy SvAMAGIC SvAMAGIC_off -syn keyword xsMacro SvAMAGIC_on SvANY SvCANEXISTDELETE SvCOMPILED -syn keyword xsMacro SvCOMPILED_off SvCOMPILED_on SvCUR SvCUR_set -syn keyword xsMacro SvDESTROYABLE SvEND SvEND_set SvENDx SvEVALED -syn keyword xsMacro SvEVALED_off SvEVALED_on SvFAKE SvFAKE_off SvFAKE_on -syn keyword xsMacro SvFLAGS SvGAMAGIC SvGETMAGIC SvGMAGICAL SvGMAGICAL_off -syn keyword xsMacro SvGMAGICAL_on SvGROW SvGROW_mutable SvIMMORTAL SvIOK -syn keyword xsMacro SvIOK_UV SvIOK_notUV SvIOK_off SvIOK_on SvIOK_only +syn keyword xsMacro Sigsetjmp Size_t_MAX Size_t_size StGiFy StashHANDLER Stat +syn keyword xsMacro Strerror Strtol Strtoul StructCopy SvAMAGIC SvANY +syn keyword xsMacro SvCANCOW SvCANEXISTDELETE SvCOMPILED SvCOMPILED_off +syn keyword xsMacro SvCOMPILED_on SvCUR SvCUR_set SvDESTROYABLE SvEND +syn keyword xsMacro SvEND_set SvENDx SvEVALED SvEVALED_off SvEVALED_on SvFAKE +syn keyword xsMacro SvFAKE_off SvFAKE_on SvFLAGS SvGAMAGIC SvGETMAGIC SvGID +syn keyword xsMacro SvGMAGICAL SvGMAGICAL_off SvGMAGICAL_on SvGROW +syn keyword xsMacro SvGROW_mutable SvIMMORTAL SvIOK SvIOK_UV SvIOK_nog +syn keyword xsMacro SvIOK_nogthink SvIOK_notUV SvIOK_off SvIOK_on SvIOK_only syn keyword xsMacro SvIOK_only_UV SvIOKp SvIOKp_on SvIS_FREED SvIV SvIVX syn keyword xsMacro SvIVXx SvIV_nomg SvIV_please SvIV_please_nomg SvIV_set -syn keyword xsMacro SvIVx SvIsCOW SvIsCOW_normal SvIsCOW_shared_hash SvIsUV -syn keyword xsMacro SvIsUV_off SvIsUV_on SvLEN SvLEN_set SvLENx SvLOCK -syn keyword xsMacro SvMAGIC SvMAGICAL SvMAGICAL_off SvMAGICAL_on SvMAGIC_set -syn keyword xsMacro SvNIOK SvNIOK_off SvNIOKp SvNOK SvNOK_off SvNOK_on -syn keyword xsMacro SvNOK_only SvNOKp SvNOKp_on SvNV SvNVX SvNVXx SvNV_nomg -syn keyword xsMacro SvNV_set SvNVx SvOBJECT SvOBJECT_off SvOBJECT_on SvOK -syn keyword xsMacro SvOK_off SvOK_off_exc_UV SvOKp SvOOK SvOOK_off -syn keyword xsMacro SvOOK_offset SvOOK_on SvOURSTASH SvOURSTASH_set SvPADMY -syn keyword xsMacro SvPADMY_on SvPADSTALE SvPADSTALE_off SvPADSTALE_on -syn keyword xsMacro SvPADTMP SvPADTMP_off SvPADTMP_on SvPAD_OUR SvPAD_OUR_on +syn keyword xsMacro SvIVx SvIsCOW SvIsCOW_normal SvIsCOW_off SvIsCOW_on +syn keyword xsMacro SvIsCOW_shared_hash SvIsUV SvIsUV_off SvIsUV_on SvLEN +syn keyword xsMacro SvLEN_set SvLENx SvLOCK SvMAGIC SvMAGICAL SvMAGICAL_off +syn keyword xsMacro SvMAGICAL_on SvMAGIC_set SvNIOK SvNIOK_nog +syn keyword xsMacro SvNIOK_nogthink SvNIOK_off SvNIOKp SvNOK SvNOK_nog +syn keyword xsMacro SvNOK_nogthink SvNOK_off SvNOK_on SvNOK_only SvNOKp +syn keyword xsMacro SvNOKp_on SvNV SvNVX SvNVXx SvNV_nomg SvNV_set SvNVx +syn keyword xsMacro SvOBJECT SvOBJECT_off SvOBJECT_on SvOK SvOK_off +syn keyword xsMacro SvOK_off_exc_UV SvOKp SvOOK SvOOK_off SvOOK_offset +syn keyword xsMacro SvOOK_on SvOURSTASH SvOURSTASH_set SvPADMY SvPADMY_on +syn keyword xsMacro SvPADSTALE SvPADSTALE_off SvPADSTALE_on SvPADTMP +syn keyword xsMacro SvPADTMP_off SvPADTMP_on SvPAD_OUR SvPAD_OUR_on syn keyword xsMacro SvPAD_STATE SvPAD_STATE_on SvPAD_TYPED SvPAD_TYPED_on syn keyword xsMacro SvPCS_IMPORTED SvPCS_IMPORTED_off SvPCS_IMPORTED_on -syn keyword xsMacro SvPEEK SvPOK SvPOK_off SvPOK_on SvPOK_only -syn keyword xsMacro SvPOK_only_UTF8 SvPOKp SvPOKp_on SvPV SvPVX SvPVX_const -syn keyword xsMacro SvPVX_mutable SvPVXx SvPV_const SvPV_flags -syn keyword xsMacro SvPV_flags_const SvPV_flags_const_nolen +syn keyword xsMacro SvPEEK SvPOK SvPOK_byte_nog SvPOK_byte_nogthink +syn keyword xsMacro SvPOK_byte_pure_nogthink SvPOK_nog SvPOK_nogthink +syn keyword xsMacro SvPOK_off SvPOK_on SvPOK_only SvPOK_only_UTF8 +syn keyword xsMacro SvPOK_pure_nogthink SvPOK_utf8_nog SvPOK_utf8_nogthink +syn keyword xsMacro SvPOK_utf8_pure_nogthink SvPOKp SvPOKp_on SvPV SvPVX +syn keyword xsMacro SvPVX_const SvPVX_mutable SvPVXtrue SvPVXx SvPV_const +syn keyword xsMacro SvPV_flags SvPV_flags_const SvPV_flags_const_nolen syn keyword xsMacro SvPV_flags_mutable SvPV_force SvPV_force_flags syn keyword xsMacro SvPV_force_flags_mutable SvPV_force_flags_nolen syn keyword xsMacro SvPV_force_mutable SvPV_force_nolen SvPV_force_nomg @@ -2927,44 +3265,49 @@ syn keyword xsMacro SvPVbytex SvPVbytex_force SvPVbytex_nolen SvPVutf8 syn keyword xsMacro SvPVutf8_force SvPVutf8_nolen SvPVutf8x SvPVutf8x_force syn keyword xsMacro SvPVx SvPVx_const SvPVx_force SvPVx_nolen syn keyword xsMacro SvPVx_nolen_const SvREADONLY SvREADONLY_off SvREADONLY_on -syn keyword xsMacro SvREFCNT SvREFCNT_dec SvREFCNT_inc SvREFCNT_inc_NN -syn keyword xsMacro SvREFCNT_inc_simple SvREFCNT_inc_simple_NN -syn keyword xsMacro SvREFCNT_inc_simple_void SvREFCNT_inc_simple_void_NN -syn keyword xsMacro SvREFCNT_inc_void SvREFCNT_inc_void_NN SvRELEASE_IVX -syn keyword xsMacro SvRELEASE_IVX_ SvRMAGICAL SvRMAGICAL_off SvRMAGICAL_on -syn keyword xsMacro SvROK SvROK_off SvROK_on SvRV SvRV_const SvRV_set SvRVx -syn keyword xsMacro SvRX SvRXOK SvSCREAM SvSCREAM_off SvSCREAM_on SvSETMAGIC -syn keyword xsMacro SvSHARE SvSHARED_HASH SvSHARED_HEK_FROM_PV SvSMAGICAL +syn keyword xsMacro SvREFCNT SvREFCNT_IMMORTAL SvREFCNT_dec SvREFCNT_dec_NN +syn keyword xsMacro SvREFCNT_inc SvREFCNT_inc_NN SvREFCNT_inc_simple +syn keyword xsMacro SvREFCNT_inc_simple_NN SvREFCNT_inc_simple_void +syn keyword xsMacro SvREFCNT_inc_simple_void_NN SvREFCNT_inc_void +syn keyword xsMacro SvREFCNT_inc_void_NN SvRELEASE_IVX SvRELEASE_IVX_ +syn keyword xsMacro SvRMAGICAL SvRMAGICAL_off SvRMAGICAL_on SvROK SvROK_off +syn keyword xsMacro SvROK_on SvRV SvRV_const SvRV_set SvRVx SvRX SvRXOK +syn keyword xsMacro SvSCREAM SvSCREAM_off SvSCREAM_on SvSETMAGIC SvSHARE +syn keyword xsMacro SvSHARED_HASH SvSHARED_HEK_FROM_PV SvSMAGICAL syn keyword xsMacro SvSMAGICAL_off SvSMAGICAL_on SvSTASH SvSTASH_set syn keyword xsMacro SvSetMagicSV SvSetMagicSV_nosteal SvSetSV SvSetSV_and syn keyword xsMacro SvSetSV_nosteal SvSetSV_nosteal_and SvTAIL SvTAIL_off syn keyword xsMacro SvTAIL_on SvTAINT SvTAINTED SvTAINTED_off SvTAINTED_on syn keyword xsMacro SvTEMP SvTEMP_off SvTEMP_on SvTHINKFIRST SvTIED_mg -syn keyword xsMacro SvTIED_obj SvTRUE SvTRUE_nomg SvTRUEx SvTYPE SvUNLOCK -syn keyword xsMacro SvUOK SvUPGRADE SvUTF8 SvUTF8_off SvUTF8_on SvUV SvUVX -syn keyword xsMacro SvUVXx SvUV_nomg SvUV_set SvUVx SvVALID SvVALID_off -syn keyword xsMacro SvVALID_on SvVOK SvVSTRING_mg SvWEAKREF SvWEAKREF_off -syn keyword xsMacro SvWEAKREF_on Sv_Grow TAIL TAINT TAINT_ENV TAINT_IF -syn keyword xsMacro TAINT_NOT TAINT_PROPER THING THR THREAD_CREATE +syn keyword xsMacro SvTIED_obj SvTRUE SvTRUE_NN SvTRUE_common SvTRUE_nomg +syn keyword xsMacro SvTRUE_nomg_NN SvTRUEx SvTRUEx_nomg SvTYPE SvUID SvUNLOCK +syn keyword xsMacro SvUOK SvUOK_nog SvUOK_nogthink SvUPGRADE SvUTF8 +syn keyword xsMacro SvUTF8_off SvUTF8_on SvUV SvUVX SvUVXx SvUV_nomg SvUV_set +syn keyword xsMacro SvUVx SvVALID SvVALID_off SvVALID_on SvVOK SvVSTRING_mg +syn keyword xsMacro SvWEAKREF SvWEAKREF_off SvWEAKREF_on Sv_Grow TAIL TAINT +syn keyword xsMacro TAINTING_get TAINTING_set TAINT_ENV TAINT_IF TAINT_NOT +syn keyword xsMacro TAINT_PROPER TAINT_WARN_get TAINT_WARN_set TAINT_get +syn keyword xsMacro TAINT_set THING THR THREAD_CREATE syn keyword xsMacro THREAD_CREATE_NEEDS_STACK THREAD_POST_CREATE syn keyword xsMacro THREAD_RET_CAST THREAD_RET_TYPE syn keyword xsMacro TIED_METHOD_ARGUMENTS_ON_STACK syn keyword xsMacro TIED_METHOD_MORTALIZE_NOT_NEEDED TIED_METHOD_SAY syn keyword xsMacro TIME64_CONFIG_H TIME64_H TM TMPNAM_R_PROTO TOO_LATE_FOR syn keyword xsMacro TOO_LATE_FOR_ TOPBLOCK TOPMARK TOPi TOPl TOPm1s TOPn TOPp -syn keyword xsMacro TOPp1s TOPpx TOPq TOPs TOPu TOPul TOPuq TRIE TRIEC -syn keyword xsMacro TRIE_BITMAP TRIE_BITMAP_BYTE TRIE_BITMAP_CLEAR -syn keyword xsMacro TRIE_BITMAP_SET TRIE_BITMAP_TEST TRIE_CHARCOUNT -syn keyword xsMacro TRIE_NODEIDX TRIE_NODENUM TRIE_WORDS_OFFSET TRIE_next -syn keyword xsMacro TRIE_next_fail TTYNAME_R_PROTO TWO_BYTE_UTF8_TO_UNI -syn keyword xsMacro TYPE_CHARS TYPE_DIGITS Timeval U16SIZE U16TYPE U16_CONST -syn keyword xsMacro U16_MAX U16_MIN U32SIZE U32TYPE U32_ALIGNMENT_REQUIRED -syn keyword xsMacro U32_CONST U32_MAX U32_MAX_P1 U32_MAX_P1_HALF U32_MIN -syn keyword xsMacro U64SIZE U64TYPE U64_CONST U8SIZE U8TYPE U8_MAX U8_MIN -syn keyword xsMacro UCHARAT UINT32_MIN UINT64_C UINT64_MIN UMINUS UNDERBAR -syn keyword xsMacro UNICODE_ALLOW_ANY UNICODE_ALLOW_SUPER -syn keyword xsMacro UNICODE_ALLOW_SURROGATE UNICODE_BYTE_ORDER_MARK -syn keyword xsMacro UNICODE_DISALLOW_FE_FF +syn keyword xsMacro TOPp1s TOPpx TOPs TOPu TOPul TRIE TRIEC TRIE_BITMAP +syn keyword xsMacro TRIE_BITMAP_BYTE TRIE_BITMAP_CLEAR TRIE_BITMAP_SET +syn keyword xsMacro TRIE_BITMAP_TEST TRIE_CHARCOUNT TRIE_NODEIDX TRIE_NODENUM +syn keyword xsMacro TRIE_WORDS_OFFSET TRIE_next TRIE_next_fail TRUE +syn keyword xsMacro TTYNAME_R_PROTO TWO_BYTE_UTF8_TO_NATIVE +syn keyword xsMacro TWO_BYTE_UTF8_TO_UNI TYPE_CHARS TYPE_DIGITS Timeval +syn keyword xsMacro U16SIZE U16TYPE U16_CONST U16_MAX U16_MIN U32SIZE U32TYPE +syn keyword xsMacro U32_ALIGNMENT_REQUIRED U32_CONST U32_MAX U32_MAX_P1 +syn keyword xsMacro U32_MAX_P1_HALF U32_MIN U64SIZE U64TYPE U64_CONST U8SIZE +syn keyword xsMacro U8TO16_LE U8TO32_LE U8TO64_LE U8TYPE U8_MAX U8_MIN +syn keyword xsMacro UCHARAT UINT32_MIN UINT64_C UINT64_MIN UMINUS +syn keyword xsMacro UNALIGNED_SAFE UNDERBAR UNICODE_ALLOW_ANY +syn keyword xsMacro UNICODE_ALLOW_SUPER UNICODE_ALLOW_SURROGATE +syn keyword xsMacro UNICODE_BYTE_ORDER_MARK UNICODE_DISALLOW_FE_FF syn keyword xsMacro UNICODE_DISALLOW_ILLEGAL_INTERCHANGE syn keyword xsMacro UNICODE_DISALLOW_NONCHAR UNICODE_DISALLOW_SUPER syn keyword xsMacro UNICODE_DISALLOW_SURROGATE @@ -2983,295 +3326,351 @@ syn keyword xsMacro UNICODE_WARN_ILLEGAL_INTERCHANGE UNICODE_WARN_NONCHAR syn keyword xsMacro UNICODE_WARN_SUPER UNICODE_WARN_SURROGATE UNIOP UNIOPSUB syn keyword xsMacro UNISKIP UNI_DISPLAY_BACKSLASH UNI_DISPLAY_ISPRINT syn keyword xsMacro UNI_DISPLAY_QQ UNI_DISPLAY_REGEX UNI_IS_INVARIANT -syn keyword xsMacro UNI_TO_NATIVE UNLESS UNLESSM UNLIKELY UNLINK -syn keyword xsMacro UNLOCK_DOLLARZERO_MUTEX UNTIL USE USE_64_BIT_ALL -syn keyword xsMacro USE_64_BIT_INT USE_64_BIT_RAWIO USE_64_BIT_STDIO -syn keyword xsMacro USE_BSDPGRP USE_DYNAMIC_LOADING USE_ENVIRON_ARRAY -syn keyword xsMacro USE_HASH_SEED USE_HEAP_INSTEAD_OF_STACK USE_LARGE_FILES -syn keyword xsMacro USE_LEFT USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE -syn keyword xsMacro USE_LOCALE_NUMERIC USE_PERLIO USE_REENTRANT_API +syn keyword xsMacro UNI_TO_NATIVE UNKNOWN_ERRNO_MSG UNLESS UNLESSM UNLIKELY +syn keyword xsMacro UNLINK UNLOCK_DOLLARZERO_MUTEX UNLOCK_LC_NUMERIC_STANDARD +syn keyword xsMacro UNLOCK_NUMERIC_STANDARD UNOP_AUX_item_sv UNTIL +syn keyword xsMacro UPG_VERSION USE USE_64_BIT_ALL USE_64_BIT_INT +syn keyword xsMacro USE_64_BIT_RAWIO USE_64_BIT_STDIO USE_BSDPGRP +syn keyword xsMacro USE_DYNAMIC_LOADING USE_ENVIRON_ARRAY USE_HASH_SEED +syn keyword xsMacro USE_HEAP_INSTEAD_OF_STACK USE_LARGE_FILES USE_LEFT +syn keyword xsMacro USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE +syn keyword xsMacro USE_LOCALE_MESSAGES USE_LOCALE_MONETARY +syn keyword xsMacro USE_LOCALE_NUMERIC USE_LOCALE_TIME USE_PERLIO +syn keyword xsMacro USE_PERL_PERTURB_KEYS USE_REENTRANT_API syn keyword xsMacro USE_SEMCTL_SEMID_DS USE_SEMCTL_SEMUN USE_STAT_BLOCKS -syn keyword xsMacro USE_STAT_RDEV USE_STDIO USE_STDIO_BASE USE_STDIO_PTR -syn keyword xsMacro USE_STRUCT_COPY USE_SYSTEM_GMTIME USE_SYSTEM_LOCALTIME -syn keyword xsMacro USE_THREADS USE_TM64 USE_UTF8_IN_NAMES UTF8SKIP -syn keyword xsMacro UTF8_ACCUMULATE UTF8_ALLOW_ANY UTF8_ALLOW_ANYUV -syn keyword xsMacro UTF8_ALLOW_CONTINUATION UTF8_ALLOW_DEFAULT -syn keyword xsMacro UTF8_ALLOW_EMPTY UTF8_ALLOW_FFFF UTF8_ALLOW_LONG -syn keyword xsMacro UTF8_ALLOW_NON_CONTINUATION UTF8_ALLOW_SHORT -syn keyword xsMacro UTF8_ALLOW_SURROGATE UTF8_CHECK_ONLY UTF8_DISALLOW_FE_FF -syn keyword xsMacro UTF8_DISALLOW_ILLEGAL_INTERCHANGE UTF8_DISALLOW_NONCHAR -syn keyword xsMacro UTF8_DISALLOW_SUPER UTF8_DISALLOW_SURROGATE -syn keyword xsMacro UTF8_EIGHT_BIT_HI UTF8_EIGHT_BIT_LO +syn keyword xsMacro USE_STAT_RDEV USE_STDIO USE_STRUCT_COPY USE_SYSTEM_GMTIME +syn keyword xsMacro USE_SYSTEM_LOCALTIME USE_THREADS USE_TM64 +syn keyword xsMacro USE_UTF8_IN_NAMES USING_MSVC6 UTF8SKIP UTF8_ACCUMULATE +syn keyword xsMacro UTF8_ALLOW_ANY UTF8_ALLOW_ANYUV UTF8_ALLOW_CONTINUATION +syn keyword xsMacro UTF8_ALLOW_DEFAULT UTF8_ALLOW_EMPTY UTF8_ALLOW_FFFF +syn keyword xsMacro UTF8_ALLOW_LONG UTF8_ALLOW_NON_CONTINUATION +syn keyword xsMacro UTF8_ALLOW_SHORT UTF8_ALLOW_SURROGATE UTF8_CHECK_ONLY +syn keyword xsMacro UTF8_DISALLOW_FE_FF UTF8_DISALLOW_ILLEGAL_INTERCHANGE +syn keyword xsMacro UTF8_DISALLOW_NONCHAR UTF8_DISALLOW_SUPER +syn keyword xsMacro UTF8_DISALLOW_SURROGATE UTF8_EIGHT_BIT_HI +syn keyword xsMacro UTF8_EIGHT_BIT_LO syn keyword xsMacro UTF8_FIRST_PROBLEMATIC_CODE_POINT_FIRST_BYTE -syn keyword xsMacro UTF8_IS_CONTINUATION UTF8_IS_CONTINUED -syn keyword xsMacro UTF8_IS_DOWNGRADEABLE_START UTF8_IS_INVARIANT +syn keyword xsMacro UTF8_IS_ABOVE_LATIN1 UTF8_IS_CONTINUATION +syn keyword xsMacro UTF8_IS_CONTINUED UTF8_IS_DOWNGRADEABLE_START +syn keyword xsMacro UTF8_IS_INVARIANT UTF8_IS_NEXT_CHAR_DOWNGRADEABLE syn keyword xsMacro UTF8_IS_NONCHAR_ syn keyword xsMacro UTF8_IS_NONCHAR_GIVEN_THAT_NON_SUPER_AND_GE_PROBLEMATIC -syn keyword xsMacro UTF8_IS_START UTF8_IS_SUPER UTF8_IS_SURROGATE -syn keyword xsMacro UTF8_MAXBYTES UTF8_MAXBYTES_CASE UTF8_MAXLEN -syn keyword xsMacro UTF8_MAX_FOLD_CHAR_EXPAND UTF8_QUAD_MAX UTF8_TWO_BYTE_HI -syn keyword xsMacro UTF8_TWO_BYTE_HI_nocast UTF8_TWO_BYTE_LO +syn keyword xsMacro UTF8_IS_REPLACEMENT UTF8_IS_START UTF8_IS_SUPER +syn keyword xsMacro UTF8_IS_SURROGATE UTF8_MAXBYTES UTF8_MAXBYTES_CASE +syn keyword xsMacro UTF8_MAXLEN UTF8_MAX_FOLD_CHAR_EXPAND UTF8_QUAD_MAX +syn keyword xsMacro UTF8_TWO_BYTE_HI UTF8_TWO_BYTE_HI_nocast UTF8_TWO_BYTE_LO syn keyword xsMacro UTF8_TWO_BYTE_LO_nocast UTF8_WARN_FE_FF syn keyword xsMacro UTF8_WARN_ILLEGAL_INTERCHANGE UTF8_WARN_NONCHAR -syn keyword xsMacro UTF8_WARN_SUPER UTF8_WARN_SURROGATE +syn keyword xsMacro UTF8_WARN_SUPER UTF8_WARN_SURROGATE UTF8f UTF8fARG syn keyword xsMacro UTF_ACCUMULATION_OVERFLOW_MASK UTF_ACCUMULATION_SHIFT syn keyword xsMacro UTF_CONTINUATION_MARK UTF_CONTINUATION_MASK -syn keyword xsMacro UTF_START_MARK UTF_START_MASK UTF_TO_NATIVE UVSIZE UVTYPE -syn keyword xsMacro UVXf UV_DIG UV_MAX UV_MAX_P1 UV_MAX_P1_HALF UV_MIN UVf -syn keyword xsMacro U_32 U_I U_L U_S U_V Uid_t_f Uid_t_sign Uid_t_size -syn keyword xsMacro VAL_EAGAIN VAL_O_NONBLOCK VDf VERB VERTWS VOIDFLAGS -syn keyword xsMacro VOIDUSED VOL VTBL_amagic VTBL_amagicelem VTBL_arylen -syn keyword xsMacro VTBL_bm VTBL_collxfrm VTBL_dbline VTBL_defelem VTBL_env +syn keyword xsMacro UTF_START_MARK UTF_START_MASK UTF_TO_NATIVE +syn keyword xsMacro UVCHR_IS_INVARIANT UVCHR_SKIP UVSIZE UVTYPE UVXf UV_DIG +syn keyword xsMacro UV_MAX UV_MAX_P1 UV_MAX_P1_HALF UV_MIN UVf U_32 U_I U_L +syn keyword xsMacro U_S U_V Uid_t_f Uid_t_sign Uid_t_size VAL_EAGAIN +syn keyword xsMacro VAL_O_NONBLOCK VCMP VERB VNORMAL VNUMIFY VOL VSTRINGIFY +syn keyword xsMacro VTBL_amagic VTBL_amagicelem VTBL_arylen VTBL_bm +syn keyword xsMacro VTBL_collxfrm VTBL_dbline VTBL_defelem VTBL_env syn keyword xsMacro VTBL_envelem VTBL_fm VTBL_glob VTBL_isa VTBL_isaelem syn keyword xsMacro VTBL_mglob VTBL_nkeys VTBL_pack VTBL_packelem VTBL_pos syn keyword xsMacro VTBL_regdata VTBL_regdatum VTBL_regexp VTBL_sigelem syn keyword xsMacro VTBL_substr VTBL_sv VTBL_taint VTBL_uvar VTBL_vec -syn keyword xsMacro WARN_ALL WARN_ALLstring WARN_AMBIGUOUS WARN_BAREWORD -syn keyword xsMacro WARN_CLOSED WARN_CLOSURE WARN_DEBUGGING WARN_DEPRECATED -syn keyword xsMacro WARN_DIGIT WARN_EXEC WARN_EXITING WARN_GLOB +syn keyword xsMacro VT_NATIVE VUTIL_REPLACE_CORE VVERIFY WARN_ALL +syn keyword xsMacro WARN_ALLstring WARN_AMBIGUOUS WARN_BAREWORD WARN_CLOSED +syn keyword xsMacro WARN_CLOSURE WARN_DEBUGGING WARN_DEPRECATED WARN_DIGIT +syn keyword xsMacro WARN_EXEC WARN_EXITING WARN_EXPERIMENTAL +syn keyword xsMacro WARN_EXPERIMENTAL__AUTODEREF WARN_EXPERIMENTAL__BITWISE +syn keyword xsMacro WARN_EXPERIMENTAL__CONST_ATTR +syn keyword xsMacro WARN_EXPERIMENTAL__LEXICAL_SUBS +syn keyword xsMacro WARN_EXPERIMENTAL__LEXICAL_TOPIC +syn keyword xsMacro WARN_EXPERIMENTAL__POSTDEREF +syn keyword xsMacro WARN_EXPERIMENTAL__REFALIASING +syn keyword xsMacro WARN_EXPERIMENTAL__REGEX_SETS +syn keyword xsMacro WARN_EXPERIMENTAL__RE_STRICT +syn keyword xsMacro WARN_EXPERIMENTAL__SIGNATURES +syn keyword xsMacro WARN_EXPERIMENTAL__SMARTMATCH +syn keyword xsMacro WARN_EXPERIMENTAL__WIN32_PERLIO WARN_GLOB syn keyword xsMacro WARN_ILLEGALPROTO WARN_IMPRECISION WARN_INPLACE -syn keyword xsMacro WARN_INTERNAL WARN_IO WARN_LAYER WARN_MALLOC WARN_MISC -syn keyword xsMacro WARN_NEWLINE WARN_NONCHAR WARN_NONEstring -syn keyword xsMacro WARN_NON_UNICODE WARN_NUMERIC WARN_ONCE WARN_OVERFLOW -syn keyword xsMacro WARN_PACK WARN_PARENTHESIS WARN_PIPE WARN_PORTABLE -syn keyword xsMacro WARN_PRECEDENCE WARN_PRINTF WARN_PROTOTYPE WARN_QW -syn keyword xsMacro WARN_RECURSION WARN_REDEFINE WARN_REGEXP WARN_RESERVED -syn keyword xsMacro WARN_SEMICOLON WARN_SEVERE WARN_SIGNAL WARN_SUBSTR -syn keyword xsMacro WARN_SURROGATE WARN_SYNTAX WARN_TAINT WARN_THREADS -syn keyword xsMacro WARN_UNINITIALIZED WARN_UNOPENED WARN_UNPACK WARN_UNTIE -syn keyword xsMacro WARN_UTF8 WARN_VOID WARNshift WARNsize WEXITSTATUS WHEN -syn keyword xsMacro WHILE WHILEM WHILEM_A_max WHILEM_A_max_fail WHILEM_A_min +syn keyword xsMacro WARN_INTERNAL WARN_IO WARN_LAYER WARN_LOCALE WARN_MALLOC +syn keyword xsMacro WARN_MISC WARN_MISSING WARN_NEWLINE WARN_NONCHAR +syn keyword xsMacro WARN_NONEstring WARN_NON_UNICODE WARN_NUMERIC WARN_ONCE +syn keyword xsMacro WARN_OVERFLOW WARN_PACK WARN_PARENTHESIS WARN_PIPE +syn keyword xsMacro WARN_PORTABLE WARN_PRECEDENCE WARN_PRINTF WARN_PROTOTYPE +syn keyword xsMacro WARN_QW WARN_RECURSION WARN_REDEFINE WARN_REDUNDANT +syn keyword xsMacro WARN_REGEXP WARN_RESERVED WARN_SEMICOLON WARN_SEVERE +syn keyword xsMacro WARN_SIGNAL WARN_SUBSTR WARN_SURROGATE WARN_SYNTAX +syn keyword xsMacro WARN_SYSCALLS WARN_TAINT WARN_THREADS WARN_UNINITIALIZED +syn keyword xsMacro WARN_UNOPENED WARN_UNPACK WARN_UNTIE WARN_UTF8 WARN_VOID +syn keyword xsMacro WARNshift WARNsize WB_ENUM_COUNT WEXITSTATUS WHEN WHILE +syn keyword xsMacro WHILEM WHILEM_A_max WHILEM_A_max_fail WHILEM_A_min syn keyword xsMacro WHILEM_A_min_fail WHILEM_A_pre WHILEM_A_pre_fail syn keyword xsMacro WHILEM_B_max WHILEM_B_max_fail WHILEM_B_min syn keyword xsMacro WHILEM_B_min_fail WIDEST_UTYPE WIFEXITED WIFSIGNALED syn keyword xsMacro WIFSTOPPED WIN32SCK_IS_STDSCK WNOHANG WORD WSTOPSIG -syn keyword xsMacro WTERMSIG WUNTRACED XHvTOTALKEYS XOPd_xop_class -syn keyword xsMacro XOPd_xop_desc XOPd_xop_name XOPd_xop_peep XOPf_xop_class -syn keyword xsMacro XOPf_xop_desc XOPf_xop_name XOPf_xop_peep XPUSHTARG -syn keyword xsMacro XPUSHi XPUSHmortal XPUSHn XPUSHp XPUSHs XPUSHu XPUSHundef -syn keyword xsMacro XS XSANY XSINTERFACE_CVT XSINTERFACE_CVT_ANON +syn keyword xsMacro WTERMSIG WUNTRACED XDIGIT_VALUE XHvTOTALKEYS +syn keyword xsMacro XOPd_xop_class XOPd_xop_desc XOPd_xop_name XOPd_xop_peep +syn keyword xsMacro XOPf_xop_class XOPf_xop_desc XOPf_xop_name XOPf_xop_peep +syn keyword xsMacro XPUSHTARG XPUSHi XPUSHmortal XPUSHn XPUSHp XPUSHs XPUSHu +syn keyword xsMacro XPUSHundef XS XSANY XSINTERFACE_CVT XSINTERFACE_CVT_ANON syn keyword xsMacro XSINTERFACE_FUNC XSINTERFACE_FUNC_SET XSPROTO XSRETURN syn keyword xsMacro XSRETURN_EMPTY XSRETURN_IV XSRETURN_NO XSRETURN_NV syn keyword xsMacro XSRETURN_PV XSRETURN_PVN XSRETURN_UNDEF XSRETURN_UV syn keyword xsMacro XSRETURN_YES XST_mIV XST_mNO XST_mNV XST_mPV XST_mPVN syn keyword xsMacro XST_mUNDEF XST_mUV XST_mYES XS_APIVERSION_BOOTCHECK +syn keyword xsMacro XS_APIVERSION_POPMARK_BOOTCHECK +syn keyword xsMacro XS_APIVERSION_SETXSUBFN_POPMARK_BOOTCHECK +syn keyword xsMacro XS_BOTHVERSION_BOOTCHECK XS_BOTHVERSION_POPMARK_BOOTCHECK +syn keyword xsMacro XS_BOTHVERSION_SETXSUBFN_POPMARK_BOOTCHECK syn keyword xsMacro XS_DYNAMIC_FILENAME XS_EXTERNAL XS_INTERNAL -syn keyword xsMacro XS_VERSION_BOOTCHECK XSprePUSH XTENDED_PAT_MOD XopDISABLE -syn keyword xsMacro XopENABLE XopENTRY XopENTRY_set XopFLAGS YADAYADA YIELD +syn keyword xsMacro XS_SETXSUBFN_POPMARK XS_VERSION_BOOTCHECK XSprePUSH +syn keyword xsMacro XTENDED_PAT_MOD XopDISABLE XopENABLE XopENTRY +syn keyword xsMacro XopENTRYCUSTOM XopENTRY_set XopFLAGS YADAYADA YIELD syn keyword xsMacro YYEMPTY YYSTYPE_IS_DECLARED YYSTYPE_IS_TRIVIAL -syn keyword xsMacro YYTOKENTYPE Zero ZeroD _ _CANNOT _CC_ALNUMC_A -syn keyword xsMacro _CC_ALNUMC_L1 _CC_ALPHA_A _CC_ALPHA_L1 _CC_BLANK_A -syn keyword xsMacro _CC_BLANK_L1 _CC_CHARNAME_CONT _CC_CNTRL_A _CC_CNTRL_L1 -syn keyword xsMacro _CC_DIGIT_A _CC_GRAPH_A _CC_GRAPH_L1 _CC_IDFIRST_A -syn keyword xsMacro _CC_IDFIRST_L1 _CC_LOWER_A _CC_LOWER_L1 -syn keyword xsMacro _CC_NONLATIN1_FOLD _CC_OCTAL_A _CC_PRINT_A _CC_PRINT_L1 -syn keyword xsMacro _CC_PSXSPC_A _CC_PSXSPC_L1 _CC_PUNCT_A _CC_PUNCT_L1 -syn keyword xsMacro _CC_QUOTEMETA _CC_SPACE_A _CC_SPACE_L1 _CC_UPPER_A -syn keyword xsMacro _CC_UPPER_L1 _CC_WORDCHAR_A _CC_WORDCHAR_L1 _CC_XDIGIT_A -syn keyword xsMacro _CPERLarg _GNU_SOURCE +syn keyword xsMacro YYTOKENTYPE Zero ZeroD _ _CANNOT _CC_ALPHA +syn keyword xsMacro _CC_ALPHANUMERIC _CC_ASCII _CC_BLANK _CC_CASED +syn keyword xsMacro _CC_CHARNAME_CONT _CC_CNTRL _CC_DIGIT _CC_GRAPH +syn keyword xsMacro _CC_IDFIRST _CC_IS_IN_SOME_FOLD _CC_LOWER +syn keyword xsMacro _CC_MNEMONIC_CNTRL _CC_NONLATIN1_FOLD +syn keyword xsMacro _CC_NONLATIN1_SIMPLE_FOLD _CC_NON_FINAL_FOLD _CC_PRINT +syn keyword xsMacro _CC_PUNCT _CC_QUOTEMETA _CC_SPACE _CC_UPPER _CC_VERTSPACE +syn keyword xsMacro _CC_WORDCHAR _CC_XDIGIT _CC_mask _CC_mask_A +syn keyword xsMacro _CHECK_AND_OUTPUT_WIDE_LOCALE_CP_MSG +syn keyword xsMacro _CHECK_AND_OUTPUT_WIDE_LOCALE_UTF8_MSG +syn keyword xsMacro _CHECK_AND_WARN_PROBLEMATIC_LOCALE +syn keyword xsMacro _CORE_SWASH_INIT_ACCEPT_INVLIST +syn keyword xsMacro _CORE_SWASH_INIT_RETURN_IF_UNDEF +syn keyword xsMacro _CORE_SWASH_INIT_USER_DEFINED_PROPERTY _CPERLarg +syn keyword xsMacro _FIRST_NON_SWASH_CC _GNU_SOURCE syn keyword xsMacro _HAS_NONLATIN1_FOLD_CLOSURE_ONLY_FOR_USE_BY_REGCOMP_DOT_C_AND_REGEXEC_DOT_C -syn keyword xsMacro _INC_PERL_XSUB_H _PERLIOL_H _PERLIO_H _PERL_OBJECT_THIS -syn keyword xsMacro _REGEXP_COMMON _RXf_PMf_CHARSET_SHIFT _RXf_PMf_SHIFT_NEXT -syn keyword xsMacro _SOCKADDR_LEN _STDIO_H _STDIO_INCLUDED _V _XPVCV_COMMON -syn keyword xsMacro _XPV_HEAD __Inc__IPerl___ __PATCHLEVEL_H_INCLUDED__ -syn keyword xsMacro __STDIO_LOADED __attribute__deprecated__ -syn keyword xsMacro __attribute__format__ __attribute__format__null_ok__ -syn keyword xsMacro __attribute__malloc__ __attribute__nonnull__ -syn keyword xsMacro __attribute__noreturn__ __attribute__pure__ -syn keyword xsMacro __attribute__unused__ __attribute__warn_unused_result__ -syn keyword xsMacro __filbuf __flsbuf __perlapi_h__ _config_h_ _exit _filbuf -syn keyword xsMacro _flsbuf _isQUOTEMETA _stdopen _swab_16_ _swab_32_ -syn keyword xsMacro _swab_64_ aTHXo aTHXo_ aTHXx aTHXx_ abort accept access +syn keyword xsMacro _HAS_NONLATIN1_SIMPLE_FOLD_CLOSURE_ONLY_FOR_USE_BY_REGCOMP_DOT_C_AND_REGEXEC_DOT_C +syn keyword xsMacro _HIGHEST_REGCOMP_DOT_H_SYNC _INC_PERL_XSUB_H +syn keyword xsMacro _IS_IN_SOME_FOLD_ONLY_FOR_USE_BY_REGCOMP_DOT_C +syn keyword xsMacro _IS_MNEMONIC_CNTRL_ONLY_FOR_USE_BY_REGCOMP_DOT_C +syn keyword xsMacro _IS_NON_FINAL_FOLD_ONLY_FOR_USE_BY_REGCOMP_DOT_C _LC_CAST +syn keyword xsMacro _MEM_WRAP_NEEDS_RUNTIME_CHECK _MEM_WRAP_WILL_WRAP +syn keyword xsMacro _NOT_IN_NUMERIC_STANDARD _NOT_IN_NUMERIC_UNDERLYING +syn keyword xsMacro _NV_BODYLESS_UNION _OP_SIBPARENT_FIELDNAME _PERLIOL_H +syn keyword xsMacro _PERLIO_H _PERL_OBJECT_THIS _REGEXP_COMMON +syn keyword xsMacro _RXf_PMf_CHARSET_SHIFT _RXf_PMf_SHIFT_COMPILETIME +syn keyword xsMacro _RXf_PMf_SHIFT_NEXT _STDIO_H _STDIO_INCLUDED _V +syn keyword xsMacro _XPVCV_COMMON _XPV_HEAD __ASSERT_ __BASE_TWO_BYTE_HI +syn keyword xsMacro __BASE_TWO_BYTE_LO __Inc__IPerl___ +syn keyword xsMacro __PATCHLEVEL_H_INCLUDED__ __PL_inf_float_int32 +syn keyword xsMacro __PL_nan_float_int32 __STDIO_LOADED +syn keyword xsMacro __attribute__deprecated__ __attribute__format__ +syn keyword xsMacro __attribute__format__null_ok__ __attribute__malloc__ +syn keyword xsMacro __attribute__nonnull__ __attribute__noreturn__ +syn keyword xsMacro __attribute__pure__ __attribute__unused__ +syn keyword xsMacro __attribute__warn_unused_result__ __filbuf __flsbuf +syn keyword xsMacro __has_builtin __perlapi_h__ _config_h_ _exit _filbuf +syn keyword xsMacro _flsbuf _generic_LC _generic_LC_base +syn keyword xsMacro _generic_LC_func_utf8 _generic_LC_swash_utf8 +syn keyword xsMacro _generic_LC_swash_uvchr _generic_LC_underscore +syn keyword xsMacro _generic_LC_utf8 _generic_LC_uvchr _generic_func_utf8 +syn keyword xsMacro _generic_isCC _generic_isCC_A _generic_swash_uni +syn keyword xsMacro _generic_swash_utf8 _generic_toFOLD_LC +syn keyword xsMacro _generic_toLOWER_LC _generic_toUPPER_LC _generic_uni +syn keyword xsMacro _generic_utf8 _generic_utf8_no_upper_latin1 _isQMC +syn keyword xsMacro _isQUOTEMETA _swab_16_ _swab_32_ _swab_64_ aTHXa aTHXo +syn keyword xsMacro aTHXo_ aTHXx aTHXx_ abort accept access syn keyword xsMacro anchored_end_shift anchored_offset anchored_substr -syn keyword xsMacro anchored_utf8 asctime assert assert_not_ROK -syn keyword xsMacro assert_not_glob atoll bcmp bind blk_eval blk_format -syn keyword xsMacro blk_gimme blk_givwhen blk_loop blk_oldcop blk_oldmarksp -syn keyword xsMacro blk_oldpm blk_oldscopesp blk_oldsp blk_sub blk_u16 boolSV -syn keyword xsMacro cBINOP cBINOPo cBINOPx cBOOL cCOP cCOPo cCOPx cGVOP_gv -syn keyword xsMacro cGVOPo_gv cGVOPx_gv cLISTOP cLISTOPo cLISTOPx cLOGOP -syn keyword xsMacro cLOGOPo cLOGOPx cLOOP cLOOPo cLOOPx cPADOP cPADOPo +syn keyword xsMacro anchored_utf8 asctime assert assert_ assert_not_ROK +syn keyword xsMacro assert_not_glob atoll av_tindex bcmp bind blk_eval +syn keyword xsMacro blk_format blk_gimme blk_givwhen blk_loop blk_oldcop +syn keyword xsMacro blk_oldmarksp blk_oldpm blk_oldscopesp blk_oldsp blk_sub +syn keyword xsMacro blk_u16 bool boolSV cBINOP cBINOPo cBINOPx cBOOL cCOP +syn keyword xsMacro cCOPo cCOPx cGVOP_gv cGVOPo_gv cGVOPx_gv cLISTOP cLISTOPo +syn keyword xsMacro cLISTOPx cLOGOP cLOGOPo cLOGOPx cLOOP cLOOPo cLOOPx +syn keyword xsMacro cMETHOPx cMETHOPx_meth cMETHOPx_rclass cPADOP cPADOPo syn keyword xsMacro cPADOPx cPMOP cPMOPo cPMOPx cPVOP cPVOPo cPVOPx cSVOP syn keyword xsMacro cSVOP_sv cSVOPo cSVOPo_sv cSVOPx cSVOPx_sv cSVOPx_svp -syn keyword xsMacro cUNOP cUNOPo cUNOPx chdir check_end_shift -syn keyword xsMacro check_offset_max check_offset_min check_substr check_utf8 -syn keyword xsMacro child_offset_bits chmod chsize ckDEAD ckWARN ckWARN2 -syn keyword xsMacro ckWARN2_d ckWARN3 ckWARN3_d ckWARN4 ckWARN4_d ckWARN_d -syn keyword xsMacro close closedir connect cop_hints_2hv cop_hints_fetch_pv -syn keyword xsMacro cop_hints_fetch_pvn cop_hints_fetch_pvs -syn keyword xsMacro cop_hints_fetch_sv cophh_2hv cophh_copy cophh_delete_pv -syn keyword xsMacro cophh_delete_pvn cophh_delete_pvs cophh_delete_sv -syn keyword xsMacro cophh_fetch_pv cophh_fetch_pvn cophh_fetch_pvs -syn keyword xsMacro cophh_fetch_sv cophh_free cophh_new_empty cophh_store_pv -syn keyword xsMacro cophh_store_pvn cophh_store_pvs cophh_store_sv crypt -syn keyword xsMacro ctermid ctime cv_ckproto cx_type cxstack cxstack_ix -syn keyword xsMacro cxstack_max dATARGET dAX dAXMARK dEXT dEXTCONST dITEMS -syn keyword xsMacro dJMPENV dMARK dMULTICALL dMY_CXT dMY_CXT_INTERP -syn keyword xsMacro dMY_CXT_SV dNOOP dORIGMARK dPOPPOPiirl dPOPPOPnnrl -syn keyword xsMacro dPOPPOPssrl dPOPTOPiirl dPOPTOPiirl_nomg -syn keyword xsMacro dPOPTOPiirl_ul_nomg dPOPTOPnnrl dPOPTOPnnrl_nomg -syn keyword xsMacro dPOPTOPssrl dPOPXiirl dPOPXiirl_ul_nomg dPOPXnnrl -syn keyword xsMacro dPOPXssrl dPOPiv dPOPnv dPOPnv_nomg dPOPqv dPOPss dPOPuqv -syn keyword xsMacro dPOPuv dSAVEDERRNO dSAVE_ERRNO dSP dTARG dTARGET +syn keyword xsMacro cUNOP cUNOP_AUX cUNOP_AUXo cUNOP_AUXx cUNOPo cUNOPx chdir +syn keyword xsMacro check_end_shift check_offset_max check_offset_min +syn keyword xsMacro check_substr check_utf8 child_offset_bits chmod chsize +syn keyword xsMacro ckDEAD ckWARN ckWARN2 ckWARN2_d ckWARN3 ckWARN3_d ckWARN4 +syn keyword xsMacro ckWARN4_d ckWARN_d close closedir connect cop_hints_2hv +syn keyword xsMacro cop_hints_fetch_pv cop_hints_fetch_pvn +syn keyword xsMacro cop_hints_fetch_pvs cop_hints_fetch_sv cophh_2hv +syn keyword xsMacro cophh_copy cophh_delete_pv cophh_delete_pvn +syn keyword xsMacro cophh_delete_pvs cophh_delete_sv cophh_fetch_pv +syn keyword xsMacro cophh_fetch_pvn cophh_fetch_pvs cophh_fetch_sv cophh_free +syn keyword xsMacro cophh_new_empty cophh_store_pv cophh_store_pvn +syn keyword xsMacro cophh_store_pvs cophh_store_sv crypt ctermid ctime +syn keyword xsMacro cv_ckproto cx_type cxstack cxstack_ix cxstack_max +syn keyword xsMacro dATARGET dAX dAXMARK dEXT dEXTCONST dITEMS dJMPENV dMARK +syn keyword xsMacro dMULTICALL dMY_CXT dMY_CXT_INTERP dMY_CXT_SV dNOOP +syn keyword xsMacro dORIGMARK dPOPPOPiirl dPOPPOPnnrl dPOPPOPssrl dPOPTOPiirl +syn keyword xsMacro dPOPTOPiirl_nomg dPOPTOPiirl_ul_nomg dPOPTOPnnrl +syn keyword xsMacro dPOPTOPnnrl_nomg dPOPTOPssrl dPOPXiirl dPOPXiirl_ul_nomg +syn keyword xsMacro dPOPXnnrl dPOPXssrl dPOPiv dPOPnv dPOPnv_nomg dPOPss +syn keyword xsMacro dPOPuv dSAVEDERRNO dSAVE_ERRNO dSP dSS_ADD dTARG dTARGET syn keyword xsMacro dTARGETSTACKED dTHR dTHX dTHXa dTHXo dTHXoa dTHXs dTHXx -syn keyword xsMacro dTOPiv dTOPnv dTOPqv dTOPss dTOPuqv dTOPuv dUNDERBAR dVAR -syn keyword xsMacro dXSARGS dXSFUNCTION dXSI32 dXSTARG dXSUB_SYS deprecate -syn keyword xsMacro djSP do_open drand48 dup dup2 endgrent endhostent -syn keyword xsMacro endnetent endprotoent endpwent endservent environ execl -syn keyword xsMacro execv execvp fcntl fd_set fdopen fileno float_end_shift -syn keyword xsMacro float_max_offset float_min_offset float_substr float_utf8 -syn keyword xsMacro flock flockfile foldEQ_utf8 frewind fscanf fstat ftell -syn keyword xsMacro ftruncate ftrylockfile funlockfile fwrite1 generic_uni -syn keyword xsMacro generic_utf8 get_cvs getc_unlocked getegid geteuid getgid -syn keyword xsMacro getgrent getgrgid getgrnam gethostbyaddr gethostbyname -syn keyword xsMacro gethostent gethostname getlogin getnetbyaddr getnetbyname -syn keyword xsMacro getnetent getpeername getpid getprotobyname -syn keyword xsMacro getprotobynumber getprotoent getpwent getpwnam getpwuid -syn keyword xsMacro getservbyname getservbyport getservent getsockname -syn keyword xsMacro getsockopt getspnam gettimeofday getuid getw gv_AVadd -syn keyword xsMacro gv_HVadd gv_IOadd gv_SVadd gv_autoload4 gv_efullname3 -syn keyword xsMacro gv_fetchmeth gv_fetchmeth_autoload gv_fetchmethod -syn keyword xsMacro gv_fetchmethod_flags gv_fetchpvn gv_fetchpvs -syn keyword xsMacro gv_fetchsv_nomg gv_fullname3 gv_init gv_stashpvs htoni -syn keyword xsMacro htonl htons htovl htovs hv_delete hv_delete_ent hv_exists -syn keyword xsMacro hv_exists_ent hv_fetch hv_fetch_ent hv_fetchs hv_iternext -syn keyword xsMacro hv_magic hv_store hv_store_ent hv_store_flags hv_stores -syn keyword xsMacro hv_undef ibcmp ibcmp_locale ibcmp_utf8 inet_addr -syn keyword xsMacro inet_ntoa init_os_extras init_thread_intern ioctl isALNUM -syn keyword xsMacro isALNUMC isALNUMC_A isALNUMC_L1 isALNUMC_LC -syn keyword xsMacro isALNUMC_LC_utf8 isALNUMU isALNUM_LC isALNUM_LC_utf8 -syn keyword xsMacro isALNUM_LC_uvchr isALNUM_lazy isALNUM_lazy_if isALNUM_uni -syn keyword xsMacro isALNUM_utf8 isALPHA isALPHAU isALPHA_A isALPHA_L1 -syn keyword xsMacro isALPHA_LC isALPHA_LC_utf8 isALPHA_LC_uvchr isALPHA_uni -syn keyword xsMacro isALPHA_utf8 isASCII isASCII_A isASCII_L1 isASCII_LC -syn keyword xsMacro isASCII_uni isASCII_utf8 isBLANK isBLANK_A isBLANK_L1 -syn keyword xsMacro isBLANK_LC isBLANK_LC_uni isBLANK_LC_utf8 isBLANK_uni -syn keyword xsMacro isBLANK_utf8 isCHARNAME_CONT isCNTRL isCNTRL_A isCNTRL_L1 -syn keyword xsMacro isCNTRL_LC isCNTRL_LC_utf8 isCNTRL_LC_uvchr isCNTRL_uni -syn keyword xsMacro isCNTRL_utf8 isDIGIT isDIGIT_A isDIGIT_L1 isDIGIT_LC -syn keyword xsMacro isDIGIT_LC_utf8 isDIGIT_LC_uvchr isDIGIT_uni isDIGIT_utf8 -syn keyword xsMacro isGRAPH isGRAPH_A isGRAPH_L1 isGRAPH_LC isGRAPH_LC_utf8 +syn keyword xsMacro dTOPiv dTOPnv dTOPss dTOPuv dUNDERBAR dVAR dXSARGS +syn keyword xsMacro dXSBOOTARGSAPIVERCHK dXSBOOTARGSNOVERCHK +syn keyword xsMacro dXSBOOTARGSXSAPIVERCHK dXSFUNCTION dXSI32 dXSTARG +syn keyword xsMacro dXSUB_SYS deprecate djSP do_open dup dup2 endgrent +syn keyword xsMacro endhostent endnetent endprotoent endpwent endservent +syn keyword xsMacro environ execl execv execvp fcntl fd_set fdopen fileno +syn keyword xsMacro float_end_shift float_max_offset float_min_offset +syn keyword xsMacro float_substr float_utf8 flock flockfile foldEQ_utf8 +syn keyword xsMacro frewind fscanf fstat ftell ftruncate ftrylockfile +syn keyword xsMacro funlockfile fwrite1 get_cvs getc_unlocked getegid geteuid +syn keyword xsMacro getgid getgrent getgrgid getgrnam gethostbyaddr +syn keyword xsMacro gethostbyname gethostent gethostname getlogin +syn keyword xsMacro getnetbyaddr getnetbyname getnetent getpeername getpid +syn keyword xsMacro getprotobyname getprotobynumber getprotoent getpwent +syn keyword xsMacro getpwnam getpwuid getservbyname getservbyport getservent +syn keyword xsMacro getsockname getsockopt getspnam gettimeofday getuid getw +syn keyword xsMacro gv_AVadd gv_HVadd gv_IOadd gv_SVadd gv_autoload4 +syn keyword xsMacro gv_efullname3 gv_fetchmeth gv_fetchmeth_autoload +syn keyword xsMacro gv_fetchmethod gv_fetchmethod_flags gv_fetchpvn +syn keyword xsMacro gv_fetchpvs gv_fetchsv_nomg gv_fullname3 gv_init +syn keyword xsMacro gv_method_changed gv_stashpvs htoni htonl htons htovl +syn keyword xsMacro htovs hv_delete hv_delete_ent hv_deletehek hv_exists +syn keyword xsMacro hv_exists_ent hv_fetch hv_fetch_ent hv_fetchhek hv_fetchs +syn keyword xsMacro hv_iternext hv_magic hv_store hv_store_ent hv_store_flags +syn keyword xsMacro hv_storehek hv_stores hv_undef ibcmp ibcmp_locale +syn keyword xsMacro ibcmp_utf8 inet_addr inet_ntoa init_os_extras ioctl +syn keyword xsMacro isALNUM isALNUMC isALNUMC_A isALNUMC_L1 isALNUMC_LC +syn keyword xsMacro isALNUMC_LC_utf8 isALNUMC_LC_uvchr isALNUMC_uni +syn keyword xsMacro isALNUMC_utf8 isALNUMU isALNUM_LC isALNUM_LC_utf8 +syn keyword xsMacro isALNUM_LC_uvchr isALNUM_lazy_if isALNUM_uni isALNUM_utf8 +syn keyword xsMacro isALPHA isALPHANUMERIC isALPHANUMERIC_A isALPHANUMERIC_L1 +syn keyword xsMacro isALPHANUMERIC_LC isALPHANUMERIC_LC_utf8 +syn keyword xsMacro isALPHANUMERIC_LC_uvchr isALPHANUMERIC_uni +syn keyword xsMacro isALPHANUMERIC_utf8 isALPHAU isALPHA_A isALPHA_FOLD_EQ +syn keyword xsMacro isALPHA_FOLD_NE isALPHA_L1 isALPHA_LC isALPHA_LC_utf8 +syn keyword xsMacro isALPHA_LC_uvchr isALPHA_uni isALPHA_utf8 isASCII +syn keyword xsMacro isASCII_A isASCII_L1 isASCII_LC isASCII_LC_utf8 +syn keyword xsMacro isASCII_LC_uvchr isASCII_uni isASCII_utf8 isBLANK +syn keyword xsMacro isBLANK_A isBLANK_L1 isBLANK_LC isBLANK_LC_uni +syn keyword xsMacro isBLANK_LC_utf8 isBLANK_LC_uvchr isBLANK_uni isBLANK_utf8 +syn keyword xsMacro isCHARNAME_CONT isCNTRL isCNTRL_A isCNTRL_L1 isCNTRL_LC +syn keyword xsMacro isCNTRL_LC_utf8 isCNTRL_LC_uvchr isCNTRL_uni isCNTRL_utf8 +syn keyword xsMacro isDIGIT isDIGIT_A isDIGIT_L1 isDIGIT_LC isDIGIT_LC_utf8 +syn keyword xsMacro isDIGIT_LC_uvchr isDIGIT_uni isDIGIT_utf8 isGRAPH +syn keyword xsMacro isGRAPH_A isGRAPH_L1 isGRAPH_LC isGRAPH_LC_utf8 syn keyword xsMacro isGRAPH_LC_uvchr isGRAPH_uni isGRAPH_utf8 isGV -syn keyword xsMacro isGV_with_GP isGV_with_GP_off isGV_with_GP_on -syn keyword xsMacro isIDCONT_utf8 isIDFIRST isIDFIRST_A isIDFIRST_L1 -syn keyword xsMacro isIDFIRST_LC isIDFIRST_LC_utf8 isIDFIRST_LC_uvchr -syn keyword xsMacro isIDFIRST_lazy isIDFIRST_lazy_if isIDFIRST_uni +syn keyword xsMacro isGV_with_GP isGV_with_GP_off isGV_with_GP_on isIDCONT +syn keyword xsMacro isIDCONT_A isIDCONT_L1 isIDCONT_LC isIDCONT_LC_utf8 +syn keyword xsMacro isIDCONT_LC_uvchr isIDCONT_uni isIDCONT_utf8 isIDFIRST +syn keyword xsMacro isIDFIRST_A isIDFIRST_L1 isIDFIRST_LC isIDFIRST_LC_utf8 +syn keyword xsMacro isIDFIRST_LC_uvchr isIDFIRST_lazy_if isIDFIRST_uni syn keyword xsMacro isIDFIRST_utf8 isLEXWARN_off isLEXWARN_on isLOWER syn keyword xsMacro isLOWER_A isLOWER_L1 isLOWER_LC isLOWER_LC_utf8 syn keyword xsMacro isLOWER_LC_uvchr isLOWER_uni isLOWER_utf8 isOCTAL syn keyword xsMacro isOCTAL_A isOCTAL_L1 isPRINT isPRINT_A isPRINT_L1 syn keyword xsMacro isPRINT_LC isPRINT_LC_utf8 isPRINT_LC_uvchr isPRINT_uni syn keyword xsMacro isPRINT_utf8 isPSXSPC isPSXSPC_A isPSXSPC_L1 isPSXSPC_LC -syn keyword xsMacro isPSXSPC_LC_uni isPSXSPC_LC_utf8 isPSXSPC_uni +syn keyword xsMacro isPSXSPC_LC_utf8 isPSXSPC_LC_uvchr isPSXSPC_uni syn keyword xsMacro isPSXSPC_utf8 isPUNCT isPUNCT_A isPUNCT_L1 isPUNCT_LC syn keyword xsMacro isPUNCT_LC_utf8 isPUNCT_LC_uvchr isPUNCT_uni isPUNCT_utf8 -syn keyword xsMacro isSPACE isSPACE_A isSPACE_L1 isSPACE_LC isSPACE_LC_utf8 -syn keyword xsMacro isSPACE_LC_uvchr isSPACE_uni isSPACE_utf8 isUPPER -syn keyword xsMacro isUPPER_A isUPPER_L1 isUPPER_LC isUPPER_LC_utf8 -syn keyword xsMacro isUPPER_LC_uvchr isUPPER_uni isUPPER_utf8 isWARN_ONCE -syn keyword xsMacro isWARN_on isWARNf_on isWORDCHAR isWORDCHAR_A -syn keyword xsMacro isWORDCHAR_L1 isXDIGIT isXDIGIT_A isXDIGIT_L1 -syn keyword xsMacro isXDIGIT_uni isXDIGIT_utf8 is_HORIZWS is_HORIZWS_cp -syn keyword xsMacro is_HORIZWS_latin1 is_HORIZWS_latin1_safe is_HORIZWS_safe -syn keyword xsMacro is_HORIZWS_utf8 is_HORIZWS_utf8_safe is_LAX_VERSION -syn keyword xsMacro is_LNBREAK is_LNBREAK_latin1 is_LNBREAK_latin1_safe -syn keyword xsMacro is_LNBREAK_safe is_LNBREAK_utf8 is_LNBREAK_utf8_safe -syn keyword xsMacro is_STRICT_VERSION is_TRICKYFOLD is_TRICKYFOLD_cp -syn keyword xsMacro is_TRICKYFOLD_safe is_VERTWS is_VERTWS_cp -syn keyword xsMacro is_VERTWS_latin1 is_VERTWS_latin1_safe is_VERTWS_safe -syn keyword xsMacro is_VERTWS_utf8 is_VERTWS_utf8_safe is_utf8_string_loc -syn keyword xsMacro isatty kBINOP kCOP kGVOP_gv kLISTOP kLOGOP kLOOP kPADOP -syn keyword xsMacro kPMOP kPVOP kSVOP kSVOP_sv kUNOP kill killpg -syn keyword xsMacro lex_stuff_pvs link listen lockf longjmp lseek lstat -syn keyword xsMacro mPUSHi mPUSHn mPUSHp mPUSHs mPUSHu mXPUSHi mXPUSHn +syn keyword xsMacro isREGEXP isSPACE isSPACE_A isSPACE_L1 isSPACE_LC +syn keyword xsMacro isSPACE_LC_utf8 isSPACE_LC_uvchr isSPACE_uni isSPACE_utf8 +syn keyword xsMacro isUPPER isUPPER_A isUPPER_L1 isUPPER_LC isUPPER_LC_utf8 +syn keyword xsMacro isUPPER_LC_uvchr isUPPER_uni isUPPER_utf8 isUTF8_CHAR +syn keyword xsMacro isVERTWS_uni isVERTWS_utf8 isWARN_ONCE isWARN_on +syn keyword xsMacro isWARNf_on isWORDCHAR isWORDCHAR_A isWORDCHAR_L1 +syn keyword xsMacro isWORDCHAR_LC isWORDCHAR_LC_utf8 isWORDCHAR_LC_uvchr +syn keyword xsMacro isWORDCHAR_lazy_if isWORDCHAR_uni isWORDCHAR_utf8 +syn keyword xsMacro isXDIGIT isXDIGIT_A isXDIGIT_L1 isXDIGIT_LC +syn keyword xsMacro isXDIGIT_LC_utf8 isXDIGIT_LC_uvchr isXDIGIT_uni +syn keyword xsMacro isXDIGIT_utf8 is_ANYOF_SYNTHETIC is_FOLDS_TO_MULTI_utf8 +syn keyword xsMacro is_HORIZWS_cp_high is_HORIZWS_high is_LAX_VERSION +syn keyword xsMacro is_LNBREAK_latin1_safe is_LNBREAK_safe +syn keyword xsMacro is_LNBREAK_utf8_safe is_MULTI_CHAR_FOLD_latin1_safe +syn keyword xsMacro is_MULTI_CHAR_FOLD_utf8_safe +syn keyword xsMacro is_MULTI_CHAR_FOLD_utf8_safe_part0 +syn keyword xsMacro is_MULTI_CHAR_FOLD_utf8_safe_part1 is_NONCHAR_utf8 +syn keyword xsMacro is_PATWS_cp is_PATWS_safe +syn keyword xsMacro is_PROBLEMATIC_LOCALE_FOLDEDS_START_cp +syn keyword xsMacro is_PROBLEMATIC_LOCALE_FOLDEDS_START_utf8 +syn keyword xsMacro is_PROBLEMATIC_LOCALE_FOLD_cp +syn keyword xsMacro is_PROBLEMATIC_LOCALE_FOLD_utf8 is_QUOTEMETA_high +syn keyword xsMacro is_QUOTEMETA_high_part0 is_QUOTEMETA_high_part1 +syn keyword xsMacro is_REPLACEMENT_utf8_safe is_STRICT_VERSION +syn keyword xsMacro is_SURROGATE_utf8 is_UTF8_CHAR_utf8_no_length_checks +syn keyword xsMacro is_VERTWS_cp_high is_VERTWS_high is_XDIGIT_cp_high +syn keyword xsMacro is_XDIGIT_high is_XPERLSPACE_cp_high is_XPERLSPACE_high +syn keyword xsMacro is_ascii_string is_utf8_char_buf is_utf8_string_loc +syn keyword xsMacro isatty isnormal kBINOP kCOP kGVOP_gv kLISTOP kLOGOP kLOOP +syn keyword xsMacro kPADOP kPMOP kPVOP kSVOP kSVOP_sv kUNOP kUNOP_AUX kill +syn keyword xsMacro killpg lex_stuff_pvs link listen lockf longjmp lseek +syn keyword xsMacro lstat mPUSHi mPUSHn mPUSHp mPUSHs mPUSHu mXPUSHi mXPUSHn syn keyword xsMacro mXPUSHp mXPUSHs mXPUSHu memEQ memEQs memNE memNEs memchr -syn keyword xsMacro memcmp memzero mkdir mktemp my my_betoh16 my_betoh32 -syn keyword xsMacro my_betoh64 my_betohi my_betohl my_betohn my_betohs -syn keyword xsMacro my_binmode my_htobe16 my_htobe32 my_htobe64 my_htobei -syn keyword xsMacro my_htobel my_htoben my_htobes my_htole16 my_htole32 -syn keyword xsMacro my_htole64 my_htolei my_htolel my_htolen my_htoles -syn keyword xsMacro my_letoh16 my_letoh32 my_letoh64 my_letohi my_letohl -syn keyword xsMacro my_letohn my_letohs my_lstat my_snprintf my_sprintf -syn keyword xsMacro my_stat my_strlcat my_strlcpy my_vsnprintf newAV newGVgen -syn keyword xsMacro newHV newIO newRV_inc newSUB newSVpvn_utf8 newSVpvs -syn keyword xsMacro newSVpvs_flags newSVpvs_share newXSproto ntohi ntohl -syn keyword xsMacro ntohs opASSIGN op_getmad op_lvalue open opendir pTHX_1 -syn keyword xsMacro pTHX_2 pTHX_3 pTHX_4 pTHX_5 pTHX_6 pTHX_7 pTHX_8 pTHX_9 -syn keyword xsMacro pTHX_FORMAT pTHX_VALUE pTHX_VALUE_ pTHX__FORMAT +syn keyword xsMacro memcmp memzero mkdir mktemp my my_binmode my_lstat +syn keyword xsMacro my_setlocale my_snprintf my_sprintf my_stat my_strlcat +syn keyword xsMacro my_strlcpy my_vsnprintf newATTRSUB newAV newGVgen newHV +syn keyword xsMacro newIO newRV_inc newSUB newSVpadname newSVpvn_utf8 +syn keyword xsMacro newSVpvs newSVpvs_flags newSVpvs_share newXSproto ntohi +syn keyword xsMacro ntohl ntohs opASSIGN op_lvalue open opendir pTHX_1 +syn keyword xsMacro pTHX_12 pTHX_2 pTHX_3 pTHX_4 pTHX_5 pTHX_6 pTHX_7 pTHX_8 +syn keyword xsMacro pTHX_9 pTHX_FORMAT pTHX_VALUE pTHX_VALUE_ pTHX__FORMAT syn keyword xsMacro pTHX__VALUE pTHX__VALUE_ pTHXo pTHXo_ pTHXx pTHXx_ pVAR syn keyword xsMacro pWARN_ALL pWARN_NONE pWARN_STD packWARN packWARN2 syn keyword xsMacro packWARN3 packWARN4 pad_add_name_pvs pad_findmy_pvs -syn keyword xsMacro pad_peg padadd_NO_DUP_CHECK padadd_OUR padadd_STATE -syn keyword xsMacro padadd_UTF8_NAME padnew_CLONE padnew_SAVE padnew_SAVESUB +syn keyword xsMacro pad_peg padadd_NO_DUP_CHECK padadd_OUR padadd_STALEOK +syn keyword xsMacro padadd_STATE padnew_CLONE padnew_SAVE padnew_SAVESUB syn keyword xsMacro panic_write2 pause pclose pipe popen prepare_SV_for_RV syn keyword xsMacro pthread_attr_init pthread_condattr_default pthread_create syn keyword xsMacro pthread_key_create pthread_keycreate syn keyword xsMacro pthread_mutexattr_default pthread_mutexattr_init -syn keyword xsMacro pthread_mutexattr_settype putc_unlocked putenv putw -syn keyword xsMacro random read readdir readdir64 recv recvfrom ref +syn keyword xsMacro pthread_mutexattr_settype putc_unlocked putenv putw read +syn keyword xsMacro readdir readdir64 recv recvfrom ref syn keyword xsMacro refcounted_he_fetch_pvs refcounted_he_new_pvs rename -syn keyword xsMacro rewinddir rmdir sTHX safecalloc safefree safemalloc +syn keyword xsMacro rewinddir rmdir safecalloc safefree safemalloc syn keyword xsMacro saferealloc save_aelem save_freeop save_freepv syn keyword xsMacro save_freesv save_helem save_mortalizesv save_op savepvs syn keyword xsMacro savesharedpvs sb_dstr sb_iters sb_m sb_maxiters syn keyword xsMacro sb_oldsave sb_orig sb_rflags sb_rx sb_rxres sb_rxtainted syn keyword xsMacro sb_s sb_strend sb_targ seedDrand01 seekdir select send -syn keyword xsMacro sendto setbuf setgid setgrent sethostent setjmp -syn keyword xsMacro setlinebuf setlocale setmode setnetent setprotoent -syn keyword xsMacro setpwent setregid setreuid setservent setsockopt setuid -syn keyword xsMacro setvbuf share_hek_hek sharepvn shutdown signal sleep -syn keyword xsMacro socket socketpair specialWARN srand48 srandom stat -syn keyword xsMacro stdoutf strEQ strGE strGT strLE strLT strNE strchr -syn keyword xsMacro strerror stringify stringify_immed strnEQ strnNE strrchr -syn keyword xsMacro strtoll strtoull sv_2bool sv_2iv sv_2nv sv_2pv -syn keyword xsMacro sv_2pv_nolen sv_2pv_nomg sv_2pvbyte_nolen -syn keyword xsMacro sv_2pvutf8_nolen sv_2uv sv_catpv_nomg sv_catpvn -syn keyword xsMacro sv_catpvn_mg sv_catpvn_nomg sv_catpvn_utf8_upgrade -syn keyword xsMacro sv_catpvs sv_catpvs_flags sv_catpvs_mg sv_catpvs_nomg -syn keyword xsMacro sv_catsv sv_catsv_mg sv_catsv_nomg sv_catxmlpvs sv_cmp -syn keyword xsMacro sv_cmp_locale sv_collxfrm sv_eq sv_force_normal sv_insert -syn keyword xsMacro sv_nolocking sv_nounlocking sv_pv sv_pvbyte sv_pvn_force -syn keyword xsMacro sv_pvn_force_nomg sv_pvutf8 sv_setpvs sv_setpvs_mg -syn keyword xsMacro sv_setref_pvs sv_setsv sv_setsv_nomg sv_taint sv_unref -syn keyword xsMacro sv_usepvn sv_usepvn_mg sv_utf8_upgrade -syn keyword xsMacro sv_utf8_upgrade_flags sv_utf8_upgrade_nomg tTHX telldir -syn keyword xsMacro times tmpfile tmpnam toCTRL toFOLD_uni toLOWER -syn keyword xsMacro toLOWER_LATIN1 toLOWER_LC toLOWER_uni toLOWER_utf8 -syn keyword xsMacro toTITLE_uni toTITLE_utf8 toUPPER toUPPER_LATIN1_MOD +syn keyword xsMacro sendto set_ANYOF_SYNTHETIC setbuf setgid setgrent +syn keyword xsMacro sethostent setjmp setlinebuf setlocale setmode setnetent +syn keyword xsMacro setprotoent setpwent setregid setreuid setservent +syn keyword xsMacro setsockopt setuid setvbuf share_hek_hek sharepvn shutdown +syn keyword xsMacro signal sleep socket socketpair specialWARN stat stdoutf +syn keyword xsMacro strEQ strGE strGT strLE strLT strNE strchr strerror +syn keyword xsMacro strnEQ strnNE strrchr strtoll strtoull sv_2bool +syn keyword xsMacro sv_2bool_nomg sv_2iv sv_2nv sv_2pv sv_2pv_nolen +syn keyword xsMacro sv_2pv_nomg sv_2pvbyte_nolen sv_2pvutf8_nolen sv_2uv +syn keyword xsMacro sv_cathek sv_catpv_nomg sv_catpvn sv_catpvn_mg +syn keyword xsMacro sv_catpvn_nomg sv_catpvn_nomg_maybeutf8 +syn keyword xsMacro sv_catpvn_nomg_utf8_upgrade sv_catpvs sv_catpvs_flags +syn keyword xsMacro sv_catpvs_mg sv_catpvs_nomg sv_catsv sv_catsv_mg +syn keyword xsMacro sv_catsv_nomg sv_catxmlpvs sv_cmp sv_cmp_locale +syn keyword xsMacro sv_collxfrm sv_copypv_nomg sv_eq sv_force_normal +syn keyword xsMacro sv_insert sv_mortalcopy sv_nolocking sv_nounlocking +syn keyword xsMacro sv_or_pv_len_utf8 sv_pv sv_pvbyte sv_pvn_force +syn keyword xsMacro sv_pvn_force_nomg sv_pvutf8 sv_setgid sv_setpvs +syn keyword xsMacro sv_setpvs_mg sv_setref_pvs sv_setsv sv_setsv_nomg +syn keyword xsMacro sv_setuid sv_taint sv_unref sv_usepvn sv_usepvn_mg +syn keyword xsMacro sv_utf8_upgrade sv_utf8_upgrade_flags +syn keyword xsMacro sv_utf8_upgrade_nomg tTHX telldir times tmpfile tmpnam +syn keyword xsMacro toCTRL toFOLD toFOLD_A toFOLD_LC toFOLD_uni toFOLD_utf8 +syn keyword xsMacro toLOWER toLOWER_A toLOWER_L1 toLOWER_LATIN1 toLOWER_LC +syn keyword xsMacro toLOWER_uni toLOWER_utf8 toTITLE toTITLE_A toTITLE_uni +syn keyword xsMacro toTITLE_utf8 toUPPER toUPPER_A toUPPER_LATIN1_MOD syn keyword xsMacro toUPPER_LC toUPPER_uni toUPPER_utf8 to_uni_fold syn keyword xsMacro to_utf8_fold to_utf8_lower to_utf8_title to_utf8_upper syn keyword xsMacro truncate tryAMAGICbin_MG tryAMAGICunDEREF -syn keyword xsMacro tryAMAGICunTARGET tryAMAGICun_MG ttyname umask uname +syn keyword xsMacro tryAMAGICunTARGETlist tryAMAGICun_MG ttyname umask uname syn keyword xsMacro unlink unpackWARN1 unpackWARN2 unpackWARN3 unpackWARN4 -syn keyword xsMacro utf8n_to_uvchr utime uvchr_to_utf8 uvuni_to_utf8 vTHX -syn keyword xsMacro vfprintf vtohl vtohs wait want_vtbl_bm want_vtbl_fm -syn keyword xsMacro what_TRICKYFOLD what_TRICKYFOLD_safe what_len_TRICKYFOLD -syn keyword xsMacro what_len_TRICKYFOLD_safe whichsig write xio_any xio_dirp -syn keyword xsMacro xiv_iv xuv_uv yystype +syn keyword xsMacro utf8_to_uvchr_buf utime uvchr_to_utf8 uvchr_to_utf8_flags +syn keyword xsMacro vTHX vfprintf vtohl vtohs wait want_vtbl_bm want_vtbl_fm +syn keyword xsMacro whichsig write xio_any xio_dirp xiv_iv xlv_targoff +syn keyword xsMacro xpv_len xuv_uv yystype " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_xs_syntax_inits") - if version < 508 - let did_xs_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif - - HiLink xsPrivate Error - HiLink xsSuperseded Error - HiLink xsType Type - HiLink xsString String - HiLink xsConstant Constant - HiLink xsException Exception - HiLink xsKeyword Keyword - HiLink xsFunction Function - HiLink xsVariable Identifier - HiLink xsMacro Macro - - delcommand HiLink -endif +hi def link xsPrivate Error +hi def link xsSuperseded Error +hi def link xsType Type +hi def link xsString String +hi def link xsConstant Constant +hi def link xsException Exception +hi def link xsKeyword Keyword +hi def link xsFunction Function +hi def link xsVariable Identifier +hi def link xsMacro Macro let b:current_syntax = "xs" diff --git a/runtime/syntax/xxd.vim b/runtime/syntax/xxd.vim index b2b1e44603..f3c43e816c 100644 --- a/runtime/syntax/xxd.vim +++ b/runtime/syntax/xxd.vim @@ -1,16 +1,13 @@ " Vim syntax file " Language: bin using xxd " Maintainer: Charles E. Campbell -" Last Change: Oct 23, 2014 -" Version: 8 +" Last Change: Aug 31, 2016 +" Version: 10 " Notes: use :help xxd to see how to invoke it " URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_XXD -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -20,21 +17,12 @@ syn match xxdAscii " .\{,16\}\r\=$"hs=s+2 contains=xxdDot syn match xxdDot contained "[.\r]" " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_xxd_syntax_inits") - if version < 508 - let did_xxd_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +if !exists("skip_xxd_syntax_inits") - HiLink xxdAddress Constant - HiLink xxdSep Identifier - HiLink xxdAscii Statement + hi def link xxdAddress Constant + hi def link xxdSep Identifier + hi def link xxdAscii Statement - delcommand HiLink endif let b:current_syntax = "xxd" diff --git a/runtime/syntax/yacc.vim b/runtime/syntax/yacc.vim index 977ffa75e4..8d5eb13071 100644 --- a/runtime/syntax/yacc.vim +++ b/runtime/syntax/yacc.vim @@ -1,18 +1,15 @@ " Vim syntax file " Language: Yacc " Maintainer: Charles E. Campbell -" Last Change: Apr 02, 2015 -" Version: 13 -" URL: http://mysite.verizon.net/astronaut/vim/index.html#vimlinks_syntax +" Last Change: Aug 31, 2016 +" Version: 15 +" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_YACC " " Options: {{{1 " g:yacc_uses_cpp : if this variable exists, then C++ is loaded rather than C " --------------------------------------------------------------------- " this version of syntax/yacc.vim requires 6.0 or later -if version < 600 - finish -endif if exists("b:current_syntax") syntax clear endif @@ -90,7 +87,7 @@ syn sync fromstart " --------------------------------------------------------------------- " Define the default highlighting. {{{1 -if !exists("did_yacc_syn_inits") +if !exists("skip_yacc_syn_inits") hi def link yaccBrkt yaccStmt hi def link yaccComment Comment hi def link yaccCurly Delimiter diff --git a/runtime/syntax/z8a.vim b/runtime/syntax/z8a.vim index a3a8a2bbdf..6809eb98cd 100644 --- a/runtime/syntax/z8a.vim +++ b/runtime/syntax/z8a.vim @@ -3,11 +3,8 @@ " Maintainer: Milan Pikula " Last Change: 2003 May 11 -" For version 5.x: Clear all syntax items -" For version 6.x: Quit when a syntax file was already loaded -if version < 600 - syntax clear -elseif exists("b:current_syntax") +" quit when a syntax file was already loaded +if exists("b:current_syntax") finish endif @@ -85,30 +82,20 @@ syn match z8aComment ";.*" syn case match " Define the default highlighting. -" For version 5.7 and earlier: only when not done already -" For version 5.8 and later: only when an item doesn't have highlighting yet -if version >= 508 || !exists("did_z8a_syntax_inits") - if version < 508 - let did_z8a_syntax_inits = 1 - command -nargs=+ HiLink hi link - else - command -nargs=+ HiLink hi def link - endif +" Only when an item doesn't have highlighting yet - HiLink z8aSection Special - HiLink z8aLabel Label - HiLink z8aSpecialLabel Label - HiLink z8aComment Comment - HiLink z8aInstruction Statement - HiLink z8aSpecInst Statement - HiLink z8aInclude Include - HiLink z8aPreCondit PreCondit - HiLink z8aPreProc PreProc - HiLink z8aNumber Number - HiLink z8aString String +hi def link z8aSection Special +hi def link z8aLabel Label +hi def link z8aSpecialLabel Label +hi def link z8aComment Comment +hi def link z8aInstruction Statement +hi def link z8aSpecInst Statement +hi def link z8aInclude Include +hi def link z8aPreCondit PreCondit +hi def link z8aPreProc PreProc +hi def link z8aNumber Number +hi def link z8aString String - delcommand HiLink -endif let b:current_syntax = "z8a" " vim: ts=8 diff --git a/runtime/syntax/zsh.vim b/runtime/syntax/zsh.vim index 0d385a35d0..e16e74e0c2 100644 --- a/runtime/syntax/zsh.vim +++ b/runtime/syntax/zsh.vim @@ -2,9 +2,9 @@ " Language: Zsh shell script " Maintainer: Christian Brabandt " Previous Maintainer: Nikolai Weibull -" Latest Revision: 2016-02-15 +" Latest Revision: 2017-07-11 " License: Vim (see :h license) -" Repository: https://github.com/chrisbra/vim-zsh +" Repository: https://github.com/chrisbra/vim-zsh if exists("b:current_syntax") finish @@ -24,7 +24,7 @@ endif syn keyword zshTodo contained TODO FIXME XXX NOTE -syn region zshComment oneline start='\%(^\|\s*\)#' end='$' +syn region zshComment oneline start='\%(^\|\s\+\)#' end='$' \ contains=zshTodo,@Spell fold syn region zshComment start='^\s*#' end='^\%(\s*#\)\@!' @@ -88,33 +88,20 @@ syn match zshVariable '\<\h\w*' contained syn match zshVariableDef '\<\h\w*\ze+\==' " XXX: how safe is this? syn region zshVariableDef oneline - \ start='\$\@' -if s:zsh_syntax_variables =~ 'short\|all' - syn match zshShortDeref '\$[!#$*@?_-]\w\@!' - syn match zshShortDeref '\$[=^~]*[#+]*\d\+\>' -endif +syn match zshLongDeref '\$\%(ARGC\|argv\|status\|pipestatus\|CPUTYPE\|EGID\|EUID\|ERRNO\|GID\|HOST\|LINENO\|LOGNAME\)' +syn match zshLongDeref '\$\%(MACHTYPE\|OLDPWD OPTARG\|OPTIND\|OSTYPE\|PPID\|PWD\|RANDOM\|SECONDS\|SHLVL\|signals\)' +syn match zshLongDeref '\$\%(TRY_BLOCK_ERROR\|TTY\|TTYIDLE\|UID\|USERNAME\|VENDOR\|ZSH_NAME\|ZSH_VERSION\|REPLY\|reply\|TERM\)' -if s:zsh_syntax_variables =~ 'long\|all' - syn match zshLongDeref '\$\%(ARGC\|argv\|status\|pipestatus\|CPUTYPE\|EGID\|EUID\|ERRNO\|GID\|HOST\|LINENO\|LOGNAME\)' - syn match zshLongDeref '\$\%(MACHTYPE\|OLDPWD OPTARG\|OPTIND\|OSTYPE\|PPID\|PWD\|RANDOM\|SECONDS\|SHLVL\|signals\)' - syn match zshLongDeref '\$\%(TRY_BLOCK_ERROR\|TTY\|TTYIDLE\|UID\|USERNAME\|VENDOR\|ZSH_NAME\|ZSH_VERSION\|REPLY\|reply\|TERM\)' -endif - -if s:zsh_syntax_variables =~ 'all' - syn match zshDeref '\$[=^~]*[#+]*\h\w*\>' -else - syn match zshDeref transparent contains=NONE '\$[=^~]*[#+]*\h\w*\>' -endif +syn match zshDollarVar '\$\h\w*' +syn match zshDeref '\$[=^~]*[#+]*\h\w*\>' syn match zshCommands '\%(^\|\s\)[.:]\ze\s' syn keyword zshCommands alias autoload bg bindkey break bye cap cd @@ -126,10 +113,10 @@ syn keyword zshCommands alias autoload bg bindkey break bye cap cd \ functions getcap getln getopts hash history \ jobs kill let limit log logout popd print \ printf pushd pushln pwd r read readonly - \ rehash return sched set setcap setopt shift + \ rehash return sched set setcap shift \ source stat suspend test times trap true \ ttyctl type ulimit umask unalias unfunction - \ unhash unlimit unset unsetopt vared wait + \ unhash unlimit unset vared wait \ whence where which zcompile zformat zftp zle \ zmodload zparseopts zprof zpty zregexparse \ zsocket zstyle ztcp @@ -145,163 +132,199 @@ syn keyword zshCommands alias autoload bg bindkey break bye cap cd " done syn case ignore -syn keyword zshOptions aliases allexport all_export alwayslastprompt - \ always_last_prompt always_lastprompt alwaystoend always_to_end appendcreate - \ append_create appendhistory append_history autocd auto_cd autocontinue - \ auto_continue autolist auto_list - \ automenu auto_menu autonamedirs auto_name_dirs - \ autoparamkeys auto_param_keys autoparamslash - \ auto_param_slash autopushd auto_pushd autoremoveslash - \ auto_remove_slash autoresume auto_resume badpattern bad_pattern - \ banghist bang_hist bareglobqual bare_glob_qual - \ bashautolist bash_auto_list bashrematch bash_rematch - \ beep bgnice bg_nice braceccl brace_ccl braceexpand brace_expand - \ bsdecho bsd_echo caseglob case_glob casematch case_match - \ cbases c_bases cdablevars cdable_vars cd_able_vars chasedots chase_dots - \ chaselinks chase_links checkjobs check_jobs - \ clobber combiningchars combining_chars completealiases - \ complete_aliases completeinword complete_in_word - \ continueonerror continue_on_error correct - \ correctall correct_all cprecedences c_precedences - \ cshjunkiehistory csh_junkie_history cshjunkieloops - \ csh_junkie_loops cshjunkiequotes csh_junkie_quotes - \ csh_nullcmd csh_null_cmd cshnullcmd csh_null_cmd cshnullglob csh_null_glob - \ debugbeforecmd debug_before_cmd dotglob dot_glob dvorak - \ emacs equals errexit err_exit errreturn err_return evallineno - \ eval_lineno exec extendedglob extended_glob extendedhistory - \ extended_history flowcontrol flow_control forcefloat - \ force_float functionargzero function_argzero function_arg_zero glob globalexport - \ global_export globalrcs global_rcs globassign glob_assign - \ globcomplete glob_complete globdots glob_dots glob_subst - \ globsubst globstarshort glob_star_short hashall hash_all hashcmds - \ hash_cmds hashdirs hash_dirs hashexecutablesonly hash_executables_only - \ hashlistall hash_list_all histallowclobber hist_allow_clobber histappend - \ hist_append histbeep hist_beep hist_expand hist_expire_dups_first - \ histexpand histexpiredupsfirst histfcntllock hist_fcntl_lock - \ histfindnodups hist_find_no_dups histignorealldups - \ hist_ignore_all_dups histignoredups hist_ignore_dups - \ histignorespace hist_ignore_space histlexwords hist_lex_words - \ histnofunctions hist_no_functions histnostore hist_no_store - \ histreduceblanks hist_reduce_blanks histsavebycopy - \ hist_save_by_copy histsavenodups hist_save_no_dups - \ histsubstpattern hist_subst_pattern histverify hist_verify - \ hup ignorebraces ignore_braces ignoreclosebraces ignore_close_braces - \ ignoreeof ignore_eof incappendhistory inc_append_history - \ incappendhistorytime inc_append_history_time interactive - \ interactivecomments interactive_comments ksharrays ksh_arrays - \ kshautoload ksh_autoload kshglob ksh_glob kshoptionprint - \ ksh_option_print kshtypeset ksh_typeset kshzerosubscript - \ ksh_zero_subscript listambiguous list_ambiguous listbeep - \ list_beep listpacked list_packed listrowsfirst list_rows_first - \ listtypes list_types localloops local_loops localoptions - \ local_options localpatterns local_patterns localtraps - \ local_traps log login longlistjobs long_list_jobs magicequalsubst - \ magic_equal_subst mailwarn mail_warn mail_warning mark_dirs - \ mailwarning markdirs menucomplete menu_complete monitor - \ multibyte multi_byte multifuncdef multi_func_def multios - \ multi_os nomatch no_match notify nullglob null_glob numericglobsort - \ numeric_glob_sort octalzeroes octal_zeroes onecmd one_cmd - \ overstrike over_strike pathdirs path_dirs pathscript - \ path_script physical pipefail pipe_fail posixaliases - \ posix_aliases posixargzero posix_arg_zero posix_argzero posixbuiltins - \ posix_builtins posixcd posix_cd posixidentifiers posix_identifiers - \ posixjobs posix_jobs posixstrings posix_strings posixtraps - \ posix_traps printeightbit print_eight_bit printexitvalue - \ print_exit_value privileged promptbang prompt_bang promptcr - \ prompt_cr promptpercent prompt_percent promptsp prompt_sp - \ promptsubst prompt_subst promptvars prompt_vars pushdignoredups - \ pushd_ignore_dups pushdminus pushd_minus pushdsilent pushd_silent - \ pushdtohome pushd_to_home rcexpandparam rc_expandparam rc_expand_param rcquotes - \ rc_quotes rcs recexact rec_exact rematchpcre re_match_pcre rematch_pcre - \ restricted rmstarsilent rm_star_silent rmstarwait rm_star_wait - \ sharehistory share_history shfileexpansion sh_file_expansion - \ shglob sh_glob shinstdin shin_stdin shnullcmd sh_nullcmd - \ shoptionletters sh_option_letters shortloops short_loops shwordsplit - \ sh_word_split singlecommand single_command singlelinezle single_line_zle - \ sourcetrace source_trace stdin sunkeyboardhack sun_keyboard_hack - \ trackall track_all transientrprompt transient_rprompt - \ trapsasync traps_async typesetsilent type_set_silent typeset_silent unset verbose vi - \ warncreateglobal warn_create_global xtrace zle -syn keyword zshOptions noaliases no_aliases noallexport no_allexport noall_export no_all_export noalwayslastprompt no_alwayslastprompt - \ noalways_lastprompt no_always_lastprompt no_always_last_prompt noalwaystoend no_alwaystoend noalways_to_end no_always_to_end - \ noappendcreate no_appendcreate no_append_create noappendhistory no_appendhistory noappend_history no_append_history noautocd - \ no_autocd no_auto_cd noautocontinue no_autocontinue noauto_continue no_auto_continue noautolist no_autolist noauto_list - \ no_auto_list noautomenu no_automenu noauto_menu no_auto_menu noautonamedirs no_autonamedirs noauto_name_dirs - \ no_auto_name_dirs noautoparamkeys no_autoparamkeys noauto_param_keys no_auto_param_keys noautoparamslash no_autoparamslash - \ noauto_param_slash no_auto_param_slash noautopushd no_autopushd noauto_pushd no_auto_pushd noautoremoveslash no_autoremoveslash - \ noauto_remove_slash no_auto_remove_slash noautoresume no_autoresume noauto_resume no_auto_resume nobadpattern no_badpattern no_bad_pattern - \ nobanghist no_banghist nobang_hist no_bang_hist nobareglobqual no_bareglobqual nobare_glob_qual no_bare_glob_qual - \ nobashautolist no_bashautolist nobash_auto_list no_bash_auto_list nobashrematch no_bashrematch nobash_rematch no_bash_rematch - \ nobeep no_beep nobgnice no_bgnice no_bg_nice nobraceccl no_braceccl nobrace_ccl no_brace_ccl nobraceexpand no_braceexpand nobrace_expand no_brace_expand - \ nobsdecho no_bsdecho nobsd_echo no_bsd_echo nocaseglob no_caseglob nocase_glob no_case_glob nocasematch no_casematch nocase_match no_case_match - \ nocbases no_cbases no_c_bases nocdablevars no_cdablevars no_cdable_vars nocd_able_vars no_cd_able_vars nochasedots no_chasedots nochase_dots no_chase_dots - \ nochaselinks no_chaselinks nochase_links no_chase_links nocheckjobs no_checkjobs nocheck_jobs no_check_jobs - \ noclobber no_clobber nocombiningchars no_combiningchars nocombining_chars no_combining_chars nocompletealiases no_completealiases - \ nocomplete_aliases no_complete_aliases nocompleteinword no_completeinword nocomplete_in_word no_complete_in_word - \ nocontinueonerror no_continueonerror nocontinue_on_error no_continue_on_error nocorrect no_correct - \ nocorrectall no_correctall nocorrect_all no_correct_all nocprecedences no_cprecedences noc_precedences no_c_precedences - \ nocshjunkiehistory no_cshjunkiehistory nocsh_junkie_history no_csh_junkie_history nocshjunkieloops no_cshjunkieloops - \ nocsh_junkie_loops no_csh_junkie_loops nocshjunkiequotes no_cshjunkiequotes nocsh_junkie_quotes no_csh_junkie_quotes - \ nocshnullcmd no_cshnullcmd no_csh_nullcmd nocsh_null_cmd no_csh_null_cmd nocshnullglob no_cshnullglob nocsh_null_glob no_csh_null_glob - \ nodebugbeforecmd no_debugbeforecmd nodebug_before_cmd no_debug_before_cmd nodotglob no_dotglob nodot_glob no_dot_glob nodvorak no_dvorak - \ noemacs no_emacs noequals no_equals noerrexit no_errexit noerr_exit no_err_exit noerrreturn no_errreturn noerr_return no_err_return noevallineno no_evallineno - \ noeval_lineno no_eval_lineno noexec no_exec noextendedglob no_extendedglob noextended_glob no_extended_glob noextendedhistory no_extendedhistory - \ noextended_history no_extended_history noflowcontrol no_flowcontrol noflow_control no_flow_control noforcefloat no_forcefloat - \ noforce_float no_force_float nofunctionargzero no_functionargzero nofunction_arg_zero no_function_argzero no_function_arg_zero noglob no_glob noglobalexport no_globalexport - \ noglobal_export no_global_export noglobalrcs no_globalrcs noglobal_rcs no_global_rcs noglobassign no_globassign noglob_assign no_glob_assign - \ noglobcomplete no_globcomplete noglob_complete no_glob_complete noglobdots no_globdots noglob_dots no_glob_dots - \ noglobstarshort no_glob_star_short noglob_subst no_glob_subst - \ noglobsubst no_globsubst nohashall no_hashall nohash_all no_hash_all nohashcmds no_hashcmds nohash_cmds no_hash_cmds nohashdirs no_hashdirs - \ nohash_dirs no_hash_dirs nohashexecutablesonly no_hashexecutablesonly nohash_executables_only no_hash_executables_only nohashlistall no_hashlistall - \ nohash_list_all no_hash_list_all nohistallowclobber no_histallowclobber nohist_allow_clobber no_hist_allow_clobber nohistappend no_histappend - \ nohist_append no_hist_append nohistbeep no_histbeep nohist_beep no_hist_beep nohist_expand no_hist_expand nohist_expire_dups_first no_hist_expire_dups_first - \ nohistexpand no_histexpand nohistexpiredupsfirst no_histexpiredupsfirst nohistfcntllock no_histfcntllock nohist_fcntl_lock no_hist_fcntl_lock - \ nohistfindnodups no_histfindnodups nohist_find_no_dups no_hist_find_no_dups nohistignorealldups no_histignorealldups - \ nohist_ignore_all_dups no_hist_ignore_all_dups nohistignoredups no_histignoredups nohist_ignore_dups no_hist_ignore_dups - \ nohistignorespace no_histignorespace nohist_ignore_space no_hist_ignore_space nohistlexwords no_histlexwords nohist_lex_words no_hist_lex_words - \ nohistnofunctions no_histnofunctions nohist_no_functions no_hist_no_functions nohistnostore no_histnostore nohist_no_store no_hist_no_store - \ nohistreduceblanks no_histreduceblanks nohist_reduce_blanks no_hist_reduce_blanks nohistsavebycopy no_histsavebycopy - \ nohist_save_by_copy no_hist_save_by_copy nohistsavenodups no_histsavenodups nohist_save_no_dups no_hist_save_no_dups - \ nohistsubstpattern no_histsubstpattern nohist_subst_pattern no_hist_subst_pattern nohistverify no_histverify nohist_verify no_hist_verify - \ nohup no_hup noignorebraces no_ignorebraces noignore_braces no_ignore_braces noignoreclosebraces no_ignoreclosebraces noignore_close_braces no_ignore_close_braces - \ noignoreeof no_ignoreeof noignore_eof no_ignore_eof noincappendhistory no_incappendhistory noinc_append_history no_inc_append_history - \ noincappendhistorytime no_incappendhistorytime noinc_append_history_time no_inc_append_history_time nointeractive no_interactive - \ nointeractivecomments no_interactivecomments nointeractive_comments no_interactive_comments noksharrays no_ksharrays noksh_arrays no_ksh_arrays - \ nokshautoload no_kshautoload noksh_autoload no_ksh_autoload nokshglob no_kshglob noksh_glob no_ksh_glob nokshoptionprint no_kshoptionprint - \ noksh_option_print no_ksh_option_print nokshtypeset no_kshtypeset noksh_typeset no_ksh_typeset nokshzerosubscript no_kshzerosubscript - \ noksh_zero_subscript no_ksh_zero_subscript nolistambiguous no_listambiguous nolist_ambiguous no_list_ambiguous nolistbeep no_listbeep - \ nolist_beep no_list_beep nolistpacked no_listpacked nolist_packed no_list_packed nolistrowsfirst no_listrowsfirst nolist_rows_first no_list_rows_first - \ nolisttypes no_listtypes nolist_types no_list_types nolocalloops no_localloops nolocal_loops no_local_loops nolocaloptions no_localoptions - \ nolocal_options no_local_options nolocalpatterns no_localpatterns nolocal_patterns no_local_patterns nolocaltraps no_localtraps - \ nolocal_traps no_local_traps nolog no_log nologin no_login nolonglistjobs no_longlistjobs nolong_list_jobs no_long_list_jobs nomagicequalsubst no_magicequalsubst - \ nomagic_equal_subst no_magic_equal_subst nomailwarn no_mailwarn nomail_warn no_mail_warn nomail_warning no_mail_warning nomark_dirs no_mark_dirs - \ nomailwarning no_mailwarning nomarkdirs no_markdirs nomenucomplete no_menucomplete nomenu_complete no_menu_complete nomonitor no_monitor - \ nomultibyte no_multibyte nomulti_byte no_multi_byte nomultifuncdef no_multifuncdef nomulti_func_def no_multi_func_def nomultios no_multios - \ nomulti_os no_multi_os nonomatch no_nomatch nono_match no_no_match nonotify no_notify nonullglob no_nullglob nonull_glob no_null_glob nonumericglobsort no_numericglobsort - \ nonumeric_glob_sort no_numeric_glob_sort nooctalzeroes no_octalzeroes nooctal_zeroes no_octal_zeroes noonecmd no_onecmd noone_cmd no_one_cmd - \ nooverstrike no_overstrike noover_strike no_over_strike nopathdirs no_pathdirs nopath_dirs no_path_dirs nopathscript no_pathscript - \ nopath_script no_path_script nophysical no_physical nopipefail no_pipefail nopipe_fail no_pipe_fail noposixaliases no_posixaliases - \ noposix_aliases no_posix_aliases noposixargzero no_posixargzero no_posix_argzero noposix_arg_zero no_posix_arg_zero noposixbuiltins no_posixbuiltins - \ noposix_builtins no_posix_builtins noposixcd no_posixcd noposix_cd no_posix_cd noposixidentifiers no_posixidentifiers noposix_identifiers no_posix_identifiers - \ noposixjobs no_posixjobs noposix_jobs no_posix_jobs noposixstrings no_posixstrings noposix_strings no_posix_strings noposixtraps no_posixtraps - \ noposix_traps no_posix_traps noprinteightbit no_printeightbit noprint_eight_bit no_print_eight_bit noprintexitvalue no_printexitvalue - \ noprint_exit_value no_print_exit_value noprivileged no_privileged nopromptbang no_promptbang noprompt_bang no_prompt_bang nopromptcr no_promptcr - \ noprompt_cr no_prompt_cr nopromptpercent no_promptpercent noprompt_percent no_prompt_percent nopromptsp no_promptsp noprompt_sp no_prompt_sp - \ nopromptsubst no_promptsubst noprompt_subst no_prompt_subst nopromptvars no_promptvars noprompt_vars no_prompt_vars nopushdignoredups no_pushdignoredups - \ nopushd_ignore_dups no_pushd_ignore_dups nopushdminus no_pushdminus nopushd_minus no_pushd_minus nopushdsilent no_pushdsilent nopushd_silent no_pushd_silent - \ nopushdtohome no_pushdtohome nopushd_to_home no_pushd_to_home norcexpandparam no_rcexpandparam norc_expandparam no_rc_expandparam no_rc_expand_param norcquotes no_rcquotes - \ norc_quotes no_rc_quotes norcs no_rcs norecexact no_recexact norec_exact no_rec_exact norematchpcre no_rematchpcre nore_match_pcre no_re_match_pcre no_rematch_pcre - \ norestricted no_restricted normstarsilent no_rmstarsilent norm_star_silent no_rm_star_silent normstarwait no_rmstarwait norm_star_wait no_rm_star_wait - \ nosharehistory no_sharehistory noshare_history no_share_history noshfileexpansion no_shfileexpansion nosh_file_expansion no_sh_file_expansion - \ noshglob no_shglob nosh_glob no_sh_glob noshinstdin no_shinstdin noshin_stdin no_shin_stdin noshnullcmd no_shnullcmd nosh_nullcmd no_sh_nullcmd - \ noshoptionletters no_shoptionletters nosh_option_letters no_sh_option_letters noshortloops no_shortloops noshort_loops no_short_loops noshwordsplit no_shwordsplit - \ nosh_word_split no_sh_word_split nosinglecommand no_singlecommand nosingle_command no_single_command nosinglelinezle no_singlelinezle nosingle_line_zle no_single_line_zle - \ nosourcetrace no_sourcetrace nosource_trace no_source_trace nostdin no_stdin nosunkeyboardhack no_sunkeyboardhack nosun_keyboard_hack no_sun_keyboard_hack - \ notrackall no_trackall notrack_all no_track_all notransientrprompt no_transientrprompt notransient_rprompt no_transient_rprompt - \ notrapsasync no_trapsasync notrapasync no_trapasync no_traps_async notypesetsilent no_typesetsilent notype_set_silent no_type_set_silent no_typeset_silent \nounset no_unset - \ noverbose no_verbose novi no_vi nowarncreateglobal no_warncreateglobal nowarn_create_global no_warn_create_global noxtrace no_xtrace nozle no_zle -syn case match +syn match zshOptStart /^\s*\%(\%(\%(un\)\?setopt\)\|set\s+[-+]o\)/ nextgroup=zshOption skipwhite +syn match zshOption / + \ \%(\%(\\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?all_export\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?always_last_prompt\>\)\|\%(\%(no_\?\)\?always_lastprompt\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?always_to_end\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?append_create\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?append_history\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?auto_cd\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?auto_continue\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?auto_list\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?auto_menu\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?auto_name_dirs\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?auto_param_keys\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?auto_param_slash\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?auto_pushd\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?auto_remove_slash\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?auto_resume\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?bad_pattern\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?bang_hist\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?bare_glob_qual\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?bash_auto_list\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?bash_rematch\>\)\| + \ \%(\%(\\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?bg_nice\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?brace_ccl\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?brace_expand\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?bsd_echo\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?case_glob\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?case_match\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?c_bases\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?cdable_vars\>\)\|\%(\%(no_\?\)\?cd_able_vars\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?chase_dots\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?chase_links\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?check_jobs\>\)\| + \ \%(\%(\\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?combining_chars\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?complete_aliases\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?complete_in_word\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?continue_on_error\>\)\| + \ \%(\%(\\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?correct_all\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?c_precedences\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?csh_junkie_history\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?csh_junkie_loops\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?csh_junkie_quotes\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?csh_null_cmd\>\)\|\%(\%(no_\?\)\?cshnullcmd\>\)\|\%(\%(no_\?\)\?csh_null_cmd\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?csh_null_glob\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?debug_before_cmd\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?dot_glob\>\)\| + \ \%(\%(\\)\| + \ \%(\%(\\)\| + \ \%(\%(\\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?err_exit\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?err_return\>\)\| + \ \%(\%(\\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?extended_glob\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?extended_history\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?flow_control\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?force_float\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?function_argzero\>\)\|\%(\%(no_\?\)\?function_arg_zero\>\)\| + \ \%(\%(\\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?global_export\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?global_rcs\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?glob_assign\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?glob_complete\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?glob_dots\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?globsubst\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?glob_star_short\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?hash_all\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?hash_cmds\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?hash_dirs\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?hash_executables_only\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?hash_list_all\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?hist_allow_clobber\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?hist_append\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?hist_beep\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?histexpand\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?histexpiredupsfirst\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?hist_fcntl_lock\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?hist_find_no_dups\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?hist_ignore_all_dups\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?hist_ignore_dups\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?hist_ignore_space\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?hist_lex_words\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?hist_no_functions\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?hist_no_store\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?hist_reduce_blanks\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?hist_save_by_copy\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?hist_save_no_dups\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?hist_subst_pattern\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?hist_verify\>\)\| + \ \%(\%(\\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?ignore_braces\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?ignore_close_braces\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?ignore_eof\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?inc_append_history\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?inc_append_history_time\>\)\| + \ \%(\%(\\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?interactive_comments\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?ksh_arrays\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?ksh_autoload\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?ksh_glob\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?ksh_option_print\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?ksh_typeset\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?ksh_zero_subscript\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?list_ambiguous\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?list_beep\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?list_packed\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?list_rows_first\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?list_types\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?local_loops\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?local_options\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?local_patterns\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?local_traps\>\)\| + \ \%(\%(\\)\| + \ \%(\%(\\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?long_list_jobs\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?magic_equal_subst\>\)\| + \ \%(\%(\\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?mail_warn\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?mail_warning\>\)\| + \ \%(\%(\\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?menu_complete\>\)\| + \ \%(\%(\\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?multi_byte\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?multi_func_def\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?multi_os\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?no_match\>\)\| + \ \%(\%(\\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?null_glob\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?numeric_glob_sort\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?octal_zeroes\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?one_cmd\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?over_strike\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?path_dirs\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?path_script\>\)\| + \ \%(\%(\\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?pipe_fail\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?posix_aliases\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?posix_arg_zero\>\)\|\%(\%(no_\?\)\?posix_argzero\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?posix_builtins\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?posix_cd\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?posix_identifiers\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?posix_jobs\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?posix_strings\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?posix_traps\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?print_eight_bit\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?print_exit_value\>\)\| + \ \%(\%(\\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?prompt_bang\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?prompt_cr\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?prompt_percent\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?prompt_sp\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?prompt_subst\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?prompt_vars\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?pushd_ignore_dups\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?pushd_minus\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?pushd_silent\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?pushd_to_home\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?rc_expandparam\>\)\|\%(\%(no_\?\)\?rc_expand_param\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?rc_quotes\>\)\| + \ \%(\%(\\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?rec_exact\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?re_match_pcre\>\)\|\%(\%(no_\?\)\?rematch_pcre\>\)\| + \ \%(\%(\\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?rm_star_silent\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?rm_star_wait\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?share_history\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?sh_file_expansion\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?sh_glob\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?shin_stdin\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?sh_nullcmd\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?sh_option_letters\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?short_loops\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?sh_word_split\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?single_command\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?single_line_zle\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?source_trace\>\)\| + \ \%(\%(\\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?sun_keyboard_hack\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?track_all\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?transient_rprompt\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?traps_async\>\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?type_set_silent\>\)\|\%(\%(no_\?\)\?typeset_silent\>\)\| + \ \%(\%(\\)\| + \ \%(\%(\\)\| + \ \%(\%(\\)\| + \ \%(\%(\\)\|\%(\%(no_\?\)\?warn_create_global\>\)\| + \ \%(\%(\\)\| + \ \%(\%(\\)/ nextgroup=zshOption skipwhite contained syn keyword zshTypes float integer local typeset declare private @@ -319,9 +342,9 @@ syn cluster zshSubst contains=zshSubst,zshOldSubst,zshMathSubst syn region zshSubst matchgroup=zshSubstDelim transparent \ start='\$(' skip='\\)' end=')' contains=TOP fold syn region zshParentheses transparent start='(' skip='\\)' end=')' fold +syn region zshGlob start='(#' end=')' syn region zshMathSubst matchgroup=zshSubstDelim transparent - \ start='\$((' skip='\\)' - \ matchgroup=zshSubstDelim end='))' + \ start='\$((' skip='\\)' end='))' \ contains=zshParentheses,@zshSubst,zshNumber, \ @zshDerefs,zshString keepend fold syn region zshBrackets contained transparent start='{' skip='\\}' @@ -359,23 +382,13 @@ hi def link zshRedir Operator hi def link zshVariable None hi def link zshVariableDef zshVariable hi def link zshDereferencing PreProc -if s:zsh_syntax_variables =~ 'short\|all' - hi def link zshShortDeref zshDereferencing -else - hi def link zshShortDeref None -endif -if s:zsh_syntax_variables =~ 'long\|all' - hi def link zshLongDeref zshDereferencing -else - hi def link zshLongDeref None -endif -if s:zsh_syntax_variables =~ 'all' - hi def link zshDeref zshDereferencing -else - hi def link zshDeref None -endif +hi def link zshShortDeref zshDereferencing +hi def link zshLongDeref zshDereferencing +hi def link zshDeref zshDereferencing +hi def link zshDollarVar zshDereferencing hi def link zshCommands Keyword -hi def link zshOptions Constant +hi def link zshOptStart Keyword +hi def link zshOption Constant hi def link zshTypes Type hi def link zshSwitches Special hi def link zshNumber Number @@ -383,6 +396,7 @@ hi def link zshSubst PreProc hi def link zshMathSubst zshSubst hi def link zshOldSubst zshSubst hi def link zshSubstDelim zshSubst +hi def link zshGlob zshSubst let b:current_syntax = "zsh" diff --git a/runtime/tutor/en/vim-01-beginner.tutor b/runtime/tutor/en/vim-01-beginner.tutor index 47d4ed06a1..3f243a18fa 100644 --- a/runtime/tutor/en/vim-01-beginner.tutor +++ b/runtime/tutor/en/vim-01-beginner.tutor @@ -18,12 +18,12 @@ be saved. Don't worry about messing things up; just remember that pressing []() and then [u](u) will undo the latest change. This tutorial is interactive, and there are a few things you should know. -Pressing []() over text highlighted [like this](holy-grail) will take you to some relevant -help (hopefully), and pressing K over any word will try to do so too. Sometimes -you will be required to modify text like ----> this here {expect:this here} +Pressing []() over text highlighted [like this](holy-grail) will take you to some +relevant help (hopefully), and pressing K over any word will try to do so too. +Sometimes you will be required to modify text like +this here Once you have done the changes correctly, the ✗ sign at the left will change -to ✓. I imagine you can already see how neat Vim can be ;) +to ✓. I imagine you can already see how neat Vim can be. ;) Other times, you'll be prompted to run a command (I'll explain this later): ~~~ cmd :help @@ -36,36 +36,36 @@ or press a sequence of keys Text within <'s and >'s (like ``{normal}) describes a key to press instead of text to type. -Now, move to the next lesson (remember, use j). +Now, move to the next lesson (remember, use the `j`{normal} key to scroll down). ## Lesson 1.1: MOVING THE CURSOR ** To move the cursor, press the `h`, `j`, `k`, `l` keys as indicated. ** ↑ - k Hint: The h key is at the left and moves left. - ← h l → The l key is at the right and moves right. - j The j key looks like a down arrow. + k Hint: The `h`{normal} key is at the left and moves left. + ← h l → The `l`{normal} key is at the right and moves right. + j The `j`{normal} key looks like a down arrow. ↓ 1. Move the cursor around the screen until you are comfortable. - 2. Hold down the down key (j) until it repeats. + 2. Hold down the down key (`j`{normal}) until it repeats. Now you know how to move to the next lesson. 3. Using the down key, move to Lesson 1.2. NOTE: If you are ever unsure about something you typed, press to place - you in Normal mode. Then retype the command you wanted. + you in Normal mode. Then retype the command you wanted. -NOTE: The cursor keys should also work. But using hjkl you will be able to - move around much faster, once you get used to it. Really! +NOTE: The cursor keys should also work. But using hjkl you will be able to + move around much faster, once you get used to it. Really! # Lesson 1.2: EXITING VIM !! NOTE: Before executing any of the steps below, read this entire lesson !! - 1. Press the key (to make sure you are in [Normal mode](). + 1. Press the key (to make sure you are in [Normal mode](Normal-mode). 2. Type: @@ -81,7 +81,7 @@ NOTE: The cursor keys should also work. But using hjkl you will be able to 4. If you have these steps memorized and are confident, execute steps 1 through 3 to exit and re-enter the editor. -NOTE: [:q!](:q) discards any changes you made. In a few lessons you +NOTE: [:q!](:q) discards any changes you made. In a few lessons you will learn how to save the changes to a file. 5. Move the cursor down to Lesson 1.3. @@ -90,18 +90,18 @@ NOTE: [:q!](:q) discards any changes you made. In a few lessons you ** Press `x`{normal} to delete the character under the cursor. ** -1. Move the cursor to the line below marked --->. + 1. Move the cursor to the line below marked --->. -2. To fix the errors, move the cursor until it is on top of the - character to be deleted. + 2. To fix the errors, move the cursor until it is on top of the + character to be deleted. -3. Press [the x key](x) to delete the unwanted character. + 3. Press [the x key](x) to delete the unwanted character. -4. Repeat steps 2 through 4 until the sentence is correct. + 4. Repeat steps 2 through 4 until the sentence is correct. ----> The ccow jumpedd ovverr thhe mooon. {expect:The cow jumped over the moon.} +The ccow jumpedd ovverr thhe mooon. -5. Now that the line is correct, go on to Lesson 1.4. + 5. Now that the line is correct, go on to Lesson 1.4. NOTE: As you go through this tutor, do not try to memorize, learn by usage. @@ -114,15 +114,15 @@ NOTE: As you go through this tutor, do not try to memorize, learn by usage. 2. To make the first line the same as the second, move the cursor on top of the first character AFTER where the text is to be inserted. - 3. Press i and type in the necessary additions. + 3. Press `i`{normal} and type in the necessary additions. - 4. As each error is fixed press to return to Normal mode. + 4. As each error is fixed press ``{normal} to return to Normal mode. Repeat steps 2 through 4 to correct the sentence. ----> There is text misng this . {expect:There is some text missing from this line.} ----> There is some text missing from this line. {expect:There is some text missing from this line.} +There is text misng this . +There is some text missing from this line. - 5. When you are comfortable inserting text move to lesson 1.5. + 5. When you are comfortable inserting text move to Lesson 1.5. # Lesson 1.5: TEXT EDITING: APPENDING @@ -131,19 +131,19 @@ NOTE: As you go through this tutor, do not try to memorize, learn by usage. 1. Move the cursor to the first line below marked --->. It does not matter on what character the cursor is in that line. - 2. Press [A](A) and type in the necessary additions. + 2. Press [A](A) and type in the necessary additions. - 3. As the text has been appended press to return to Normal mode. + 3. As the text has been appended press ``{normal} to return to Normal mode. 4. Move the cursor to the second line marked ---> and repeat steps 2 and 3 to correct this sentence. ----> There is some text missing from th {expect:There is some text missing from this line.} ----> There is some text missing from this line. {expect:There is some text missing from this line.} ----> There is also some text miss {expect:There is also some text missing here.} ----> There is also some text missing here. {expect:There is also some text missing here.} +There is some text missing from th +There is some text missing from this line. +There is also some text miss +There is also some text missing here. - 5. When you are comfortable appending text move to lesson 1.6. + 5. When you are comfortable appending text move to Lesson 1.6. # Lesson 1.6: EDITING A FILE @@ -151,7 +151,7 @@ NOTE: As you go through this tutor, do not try to memorize, learn by usage. !! NOTE: Before executing any of the steps below, read this entire lesson !! - 1. Exit this tutor as you did in lesson 1.2: :q! + 1. Exit this tutor as you did in Lesson 1.2: `:q!`{vim} Or, if you have access to another terminal, do the following there. 2. At the shell prompt type this command: @@ -159,7 +159,7 @@ NOTE: As you go through this tutor, do not try to memorize, learn by usage. $ vim tutor ~~~ 'vim' is the command to start the Vim editor, 'tutor' is the name of the - file you wish to edit. Use a file that may be changed. + file you wish to edit. Use a file that may be changed. 3. Insert and delete text as you learned in the previous lessons. @@ -186,14 +186,14 @@ NOTE: As you go through this tutor, do not try to memorize, learn by usage. $ vim FILENAME ~~~ - 3. To exit Vim type: :q! to trash all changes. - OR type: :wq to save the changes. + 3. To exit Vim type: ``{normal} `:q!`{vim} ``{normal} to trash all changes. + OR type: ``{normal} `:wq`{vim} ``{normal} to save the changes. - 4. To delete the character at the cursor type: `x`{normal} + 4. To delete the character at the cursor type: `x`{normal} 5. To insert or append text type: - `i`{normal} type inserted text ``{normal} insert before the cursor - `A`{normal} type appended text ``{normal} append after the line + `i`{normal} insert text ``{normal} insert before the cursor. + `A`{normal} append text ``{normal} append after the line. NOTE: Pressing ``{normal} will place you in Normal mode or will cancel an unwanted and partially completed command. @@ -210,17 +210,17 @@ Now continue with Lesson 2. 3. Move the cursor to the beginning of a word that needs to be deleted. - 4. Type [d](d)[w](w) to make the word disappear. + 4. Type [d](d)[w](w) to make the word disappear. ----> There are a some words fun that don't belong paper in this sentence. {expect:There are some words that don't belong in this sentence.} +There are a some words fun that don't belong paper in this sentence. 5. Repeat steps 3 and 4 until the sentence is correct and go to Lesson 2.2. # Lesson 2.2: MORE DELETION COMMANDS -** Type `d$`{normal} to delete to the end of the line. ** +** Type `d$`{normal} to delete to the end of the line. ** - 1. Press to make sure you are in Normal mode. + 1. Press ``{normal} to make sure you are in Normal mode. 2. Move the cursor to the line below marked --->. @@ -228,7 +228,7 @@ Now continue with Lesson 2. 4. Type `d$`{normal} to delete to the end of the line. ----> Somebody typed the end of this line twice. end of this line twice. {expect:ANYTHING} +Somebody typed the end of this line twice. end of this line twice. 5. Move on to Lesson 2.3 to understand what is happening. @@ -236,7 +236,7 @@ Now continue with Lesson 2. Many commands that change text are made from an [operator](operator) and a [motion](navigation). -The format for a delete command with the [d](d) delete operator is as follows: +The format for a delete command with the [d](d) delete operator is as follows: d motion @@ -249,7 +249,7 @@ The format for a delete command with the [d](d) delete operator is as follows: [e](e) - to the end of the current word, INCLUDING the last character. [$]($) - to the end of the line, INCLUDING the last character. - Thus typing `de`{normal} will delete from the cursor to the end of the word. + Thus typing `de`{normal} will delete from the cursor to the end of the word. NOTE: Pressing just the motion while in Normal mode without an operator will move the cursor as specified. @@ -260,15 +260,15 @@ NOTE: Pressing just the motion while in Normal mode without an operator will 1. Move the cursor to the start of the line marked ---> below. - 2. Type `2w`{normal} to move the cursor two words forward. + 2. Type `2w`{normal} to move the cursor two words forward. - 3. Type `3e`{normal} to move the cursor to the end of the third word forward. + 3. Type `3e`{normal} to move the cursor to the end of the third word forward. - 4. Type `0`{normal} ([zero](0)) to move to the start of the line. + 4. Type `0`{normal} ([zero](0)) to move to the start of the line. 5. Repeat steps 2 and 3 with different numbers. ----> This is just a line with words you can move around in. {expect:ANYTHING} +This is just a line with words you can move around in. 6. Move on to Lesson 2.5. @@ -282,49 +282,49 @@ insert a count before the motion to delete more: 1. Move the cursor to the first UPPER CASE word in the line marked --->. - 2. Type `d2w`{normal} to delete the two UPPER CASE words + 2. Type `d2w`{normal} to delete the two UPPER CASE words 3. Repeat steps 1 and 2 with a different count to delete the consecutive UPPER CASE words with one command ----> this ABC DE line FGHI JK LMN OP of words is Q RS TUV cleaned up. {expect:this line of words is cleaned up.} +This ABC DE line FGHI JK LMN OP of words is Q RS TUV cleaned up. # Lesson 2.6: OPERATING ON LINES -** Type dd to delete a whole line. ** +** Type `dd`{normal} to delete a whole line. ** Due to the frequency of whole line deletion, the designers of Vi decided it would be easier to simply type two d's to delete a line. 1. Move the cursor to the second line in the phrase below. - 2. Type [dd](dd) to delete the line. + 2. Type [dd](dd) to delete the line. 3. Now move to the fourth line. 4. Type `2dd`{normal} to delete two lines. ----> 1) Roses are red, {expect:ANYTHING} ----> 2) Mud is fun, {expect:ANYTHING} ----> 3) Violets are blue, {expect:ANYTHING} ----> 4) I have a car, {expect:ANYTHING} ----> 5) Clocks tell time, {expect:ANYTHING} ----> 6) Sugar is sweet {expect:ANYTHING} ----> 7) And so are you. {expect:ANYTHING} +1) Roses are red, +2) Mud is fun, +3) Violets are blue, +4) I have a car, +5) Clocks tell time, +6) Sugar is sweet +7) And so are you. # Lesson 2.7: THE UNDO COMMAND -** Press u to undo the last commands, U to fix a whole line. ** +** Press `u`{normal} to undo the last commands, `U`{normal} to fix a whole line. ** 1. Move the cursor to the line below marked ---> and place it on the first error. - 2. Type `x`{normal} to delete the first unwanted character. - 3. Now type `u`{normal} to undo the last command executed. - 4. This time fix all the errors on the line using the `x`{normal} command. - 5. Now type a capital `U`{normal} to return the line to its original state. - 6. Now type `u`{normal} a few times to undo the U and preceding commands. - 7. Now type ``{normal} a few times to redo the commands (undo the undo's). + 2. Type `x`{normal} to delete the first unwanted character. + 3. Now type `u`{normal} to undo the last command executed. + 4. This time fix all the errors on the line using the `x`{normal} command. + 5. Now type a capital `U`{normal} to return the line to its original state. + 6. Now type `u`{normal} a few times to undo the `U`{normal} and preceding commands. + 7. Now type ``{normal} a few times to redo the commands (undo the undo's). ----> Fiix the errors oon thhis line and reeplace them witth undo. {expect:Fix the errors on this line and replace them with undo.} +Fiix the errors oon thhis line and reeplace them witth undo. - 8. These are very useful commands. Now move on to the Lesson 2 Summary. + 8. These are very useful commands. Now move on to the Lesson 2 Summary. # Lesson 2 SUMMARY @@ -336,13 +336,13 @@ insert a count before the motion to delete more: 5. The format for a change command is: operator [number] motion where: - operator - is what to do, such as [d](d) for delete + operator - is what to do, such as [d](d) for delete [number] - is an optional count to repeat the motion motion - moves over the text to operate on, such as: [w](w) (word), [$]($) (to the end of line), etc. - 6. To move to the start of the line use a zero: [0](0) + 6. To move to the start of the line use a zero: [0](0) 7. To undo previous actions, type: `u`{normal} (lowercase u) To undo all the changes on a line, type: `U`{normal} (capital U) @@ -350,22 +350,22 @@ insert a count before the motion to delete more: # Lesson 3.1: THE PUT COMMAND -** Type p to put previously deleted text after the cursor. ** +** Type `p`{normal} to put previously deleted text after the cursor. ** 1. Move the cursor to the first ---> line below. - 2. Type `dd`{normal} to delete the line and store it in a Vim register. + 2. Type `dd`{normal} to delete the line and store it in a Vim register. 3. Move the cursor to the c) line, ABOVE where the deleted line should go. - 4. Type `p`{normal} to put the line below the cursor. + 4. Type `p`{normal} to put the line below the cursor. 5. Repeat steps 2 through 4 to put all the lines in correct order. ----> d) Can you learn too? {expect:ANYTHING} ----> b) Violets are blue, {expect:ANYTHING} ----> c) Intelligence is learned, {expect:ANYTHING} ----> a) Roses are red, {expect:ANYTHING} +d) Can you learn too? +b) Violets are blue, +c) Intelligence is learned, +a) Roses are red, # Lesson 3.2: THE REPLACE COMMAND @@ -379,8 +379,8 @@ insert a count before the motion to delete more: 4. Repeat steps 2 and 3 until the first line is equal to the second one. ----> Whan this lime was tuoed in, someone presswd some wrojg keys! {expect:When this line was typed in, someone pressed some wrong keys!} ----> When this line was typed in, someone pressed some wrong keys! {expect:When this line was typed in, someone pressed some wrong keys!} +Whan this lime was tuoed in, someone presswd some wrojg keys! +When this line was typed in, someone pressed some wrong keys! 5. Now move on to Lesson 3.3. @@ -388,11 +388,11 @@ NOTE: Remember that you should be learning by doing, not memorization. # Lesson 3.3: THE CHANGE OPERATOR -** To change until the end of a word, type `ce`{normal} ** +** To change until the end of a word, type `ce`{normal}. ** 1. Move the cursor to the first line below marked --->. - 2. Place the cursor on the "u" in "lubw". + 2. Place the cursor on the "u" in "lubw". 3. Type `ce`{normal} and the correct word (in this case, type "ine" ). @@ -400,16 +400,16 @@ NOTE: Remember that you should be learning by doing, not memorization. 5. Repeat steps 3 and 4 until the first sentence is the same as the second. ----> This lubw has a few wptfd that mrrf changing usf the change operator. {expect:This line has a few words that need changing using the change operator.} ----> This line has a few words that need changing using the change operator. {expect:This line has a few words that need changing using the change operator.} +This lubw has a few wptfd that mrrf changing usf the change operator. +This line has a few words that need changing using the change operator. Notice that [c](c)e deletes the word and places you in Insert mode. -# Lesson 3.4: MORE CHANGES USING c +# Lesson 3.4: MORE CHANGES USING `c`{normal} ** The change operator is used with the same motions as delete. ** - 1. The change operator works in the same way as delete. The format is: + 1. The change operator works in the same way as delete. The format is: c [number] motion @@ -421,14 +421,14 @@ Notice that [c](c)e deletes the word and places you in Insert mode. 5. Type `c$`{normal} and type the rest of the line like the second and press ``{normal}. ----> The end of this line needs some help to make it like the second. {expect:The end of this line needs to be corrected using the c$ command.} ----> The end of this line needs to be corrected using the c$ command. {expect:The end of this line needs to be corrected using the c$ command.} +The end of this line needs some help to make it like the second. +The end of this line needs to be corrected using the `c$`{normal} command. -NOTE: You can use the Backspace key to correct mistakes while typing. +NOTE: You can use the Backspace key to correct mistakes while typing. # Lesson 3 SUMMARY - 1. To put back text that has just been deleted, type [p](p). This puts the + 1. To put back text that has just been deleted, type [p](p). This puts the deleted text AFTER the cursor (if a line was deleted it will go on the line below the cursor). @@ -436,8 +436,8 @@ NOTE: You can use the Backspace key to correct mistakes while typing. character you want to have there. 3. The [change operator](c) allows you to change from the cursor to where the - motion takes you. eg. Type `ce`{normal} to change from the cursor to the end of - the word, `c$`{normal} to change to the end of a line. + motion takes you. Type `ce`{normal} to change from the cursor to the end of + the word, `c$`{normal} to change to the end of a line. 4. The format for change is: @@ -448,21 +448,21 @@ Now go on to the next lesson. # Lesson 4.1: CURSOR LOCATION AND FILE STATUS ** Type ``{normal} to show your location in the file and the file status. - Type `G`{normal} to move to a line in the file. ** + Type `G`{normal} to move to a line in the file. ** NOTE: Read this entire lesson before executing any of the steps!! - 1. Hold down the ``{normal} key and press `g`{normal}. We call this ``{normal}. + 1. Hold down the ``{normal} key and press `g`{normal}. We call this ``{normal}. A message will appear at the bottom of the page with the filename and the - position in the file. Remember the line number for Step 3. + position in the file. Remember the line number for Step 3. -NOTE: You may see the cursor position in the lower right corner of the screen - This happens when the ['ruler']('ruler') option is set (see :help 'ruler' ) +NOTE: You may see the cursor position in the lower right corner of the screen + This happens when the ['ruler']('ruler') option is set (see `:help 'ruler'`{vim} ). - 2. Press [G](G) to move you to the bottom of the file. - Type [gg](gg) to move you to the start of the file. + 2. Press [G](G) to move you to the bottom of the file. + Type [gg](gg) to move you to the start of the file. - 3. Type the number of the line you were on and then `G`{normal} . This will + 3. Type the number of the line you were on and then `G`{normal}. This will return you to the line you were on when you first pressed ``{normal}. 4. If you feel confident to do this, execute steps 1 through 3. @@ -471,20 +471,20 @@ NOTE: You may see the cursor position in the lower right corner of the screen ** Type `/`{normal} followed by a phrase to search for the phrase. ** - 1. In Normal mode type the `/`{normal} character. Notice that it and the cursor - appear at the bottom of the screen as with the : command. + 1. In Normal mode type the `/`{normal} character. Notice that it and the cursor + appear at the bottom of the screen as with the `:`{normal} command. - 2. Now type 'errroor' ``{normal}. This is the word you want to search for. + 2. Now type 'errroor' ``{normal}. This is the word you want to search for. - 3. To search for the same phrase again, simply type [n](n) . - To search for the same phrase in the opposite direction, type [N](N) . + 3. To search for the same phrase again, simply type [n](n). + To search for the same phrase in the opposite direction, type [N](N). - 4. To search for a phrase in the backward direction, use [?](?) instead of / . + 4. To search for a phrase in the backward direction, use [?](?) instead of `/`{normal}. - 5. To go back to where you came from press ``{normal} (Keep Ctrl down while - pressing the letter o). Repeat to go back further. ``{normal} goes forward. + 5. To go back to where you came from press ``{normal} (keep ``{normal} pressed down while + pressing the letter `o`{normal}). Repeat to go back further. ``{normal} goes forward. ----> "errroor" is not the way to spell error; errroor is an error. {expect:ANYTHING} +"errroor" is not the way to spell error; errroor is an error. NOTE: When the search reaches the end of the file it will continue at the start, unless the ['wrapscan']('wrapscan') option has been reset. @@ -495,7 +495,7 @@ NOTE: When the search reaches the end of the file it will continue at the 1. Place the cursor on any (, [, or { in the line below marked --->. - 2. Now type the [%](%) character. + 2. Now type the [%](%) character. 3. The cursor will move to the matching parenthesis or bracket. @@ -503,7 +503,7 @@ NOTE: When the search reaches the end of the file it will continue at the 5. Move the cursor to another (,),[,],{ or } and see what `%`{normal} does. ----> This ( is a test line with ('s, ['s ] and {'s } in it. )) {expect:ANYTHING} +This ( is a test line with ('s, ['s ] and {'s } in it. )) NOTE: This is very useful in debugging a program with unmatched parentheses! @@ -528,7 +528,7 @@ NOTE: This is very useful in debugging a program with unmatched parentheses! Adding the g [flag](:s_flags) means to substitute globally in the line, change all occurrences of "thee" in the line. ----> thee best time to see thee flowers is in thee spring. {expect:the best time to see the flowers is in the spring.} +Usually thee best time to see thee flowers is in thee spring. 4. To change every occurrence of a character string between two lines, type ~~~ cmd @@ -589,20 +589,20 @@ NOTE: This is very useful in debugging a program with unmatched parentheses! ** Type `:!`{vim} followed by an external command to execute that command. ** 1. Type the familiar command `:`{normal} to set the cursor at the bottom of the - screen. This allows you to enter a command-line command. + screen. This allows you to enter a command-line command. - 2. Now type the [!](!cmd) (exclamation point) character. This allows you to + 2. Now type the [!](!cmd) (exclamation point) character. This allows you to execute any external shell command. - 3. As an example type "ls" following the "!" and then hit ``{normal}. This + 3. As an example type "ls" following the "!" and then hit ``{normal}. This will show you a listing of your directory, just as if you were at the shell prompt. -NOTE: It is possible to execute any external command this way, also with - arguments. +NOTE: It is possible to execute any external command this way, also with + arguments. -NOTE: All : commands must be finished by hitting - From here on we will not always mention it. +NOTE: All `:`{vim} commands must be finished by hitting ``{normal}. + From here on we will not always mention it. # Lesson 5.2: MORE ON WRITING FILES @@ -622,7 +622,7 @@ NOTE: All : commands must be finished by hitting 4. This saves the whole file (the Vim Tutor) under the name TEST. To verify this, type `:!ls`{vim} again to see your directory. -NOTE: If you were to exit Vim and start it again with vim TEST , the file +NOTE: If you were to exit Vim and start it again with `nvim TEST`, the file would be an exact copy of the tutor when you saved it. 5. Now remove the file by typing: @@ -632,14 +632,14 @@ NOTE: If you were to exit Vim and start it again with vim TEST , the file # Lesson 5.3: SELECTING TEXT TO WRITE -** To save part of the file, type `v`{normal} motion `:w FILENAME`{vim} ** +** To save part of the file, type `v`{normal} motion `:w FILENAME`{vim}. ** 1. Move the cursor to this line. - 2. Press [v](v) and move the cursor to the fifth item below. Notice that the + 2. Press [v](v) and move the cursor to the fifth item below. Notice that the text is highlighted. - 3. Press the `:`{normal} character. At the bottom of the screen + 3. Press the `:`{normal} character. At the bottom of the screen :'<,'> @@ -649,27 +649,27 @@ NOTE: If you were to exit Vim and start it again with vim TEST , the file `:w TEST`{vim} - where TEST is a filename that does not exist yet. Verify that you see + where TEST is a filename that does not exist yet. Verify that you see `:'<,'>w TEST`{vim} before you press ``{normal}. - 5. Vim will write the selected lines to the file TEST. Use `:!ls`{vim} to see it. - Do not remove it yet! We will use it in the next lesson. + 5. Vim will write the selected lines to the file TEST. Use `:!ls`{vim} to see it. + Do not remove it yet! We will use it in the next lesson. -NOTE: Pressing [v](v) starts [Visual selection](visual-mode). You can move - the cursor around to make the selection bigger or smaller. Then you can - use an operator to do something with the text. For example, `d`{normal} deletes - the text. +NOTE: Pressing [v](v) starts [Visual selection](visual-mode). You can move + the cursor around to make the selection bigger or smaller. Then you can + use an operator to do something with the text. For example, `d`{normal} deletes + the text. # Lesson 5.4: RETRIEVING AND MERGING FILES -** To insert the contents of a file, type `:r FILENAME`{vim} ** +** To insert the contents of a file, type `:r FILENAME`{vim}. ** 1. Place the cursor just above this line. -NOTE: After executing Step 2 you will see text from Lesson 5.3. Then move +NOTE: After executing Step 2 you will see text from Lesson 5.3. Then move DOWN to see this lesson again. 2. Now retrieve your TEST file using the command @@ -682,31 +682,31 @@ NOTE: After executing Step 2 you will see text from Lesson 5.3. Then move 3. To verify that a file was retrieved, cursor back and notice that there are now two copies of Lesson 5.3, the original and the file version. -NOTE: You can also read the output of an external command. For example, +NOTE: You can also read the output of an external command. For example, - `:r !ls`{vim} + `:r !ls`{vim} - reads the output of the `ls` command and puts it below the cursor. + reads the output of the `ls` command and puts it below the cursor. # Lesson 5 SUMMARY - 1. [:!command](:!cmd) executes an external command. + 1. [:!command](:!cmd) executes an external command. - Some useful examples are: - `:!ls`{vim} - shows a directory listing - `:!rm FILENAME`{vim} - removes file FILENAME + Some useful examples are: + `:!ls`{vim} - shows a directory listing + `:!rm FILENAME`{vim} - removes file FILENAME - 2. [:w](:w) FILENAME writes the current Vim file to disk with - name FILENAME. + 2. [:w](:w) FILENAME writes the current Vim file to disk with + name FILENAME. - 3. [v](v) motion :w FILENAME saves the Visually selected lines in file - FILENAME. + 3. [v](v) motion :w FILENAME saves the Visually selected lines in file + FILENAME. - 4. [:r](:r) FILENAME retrieves disk file FILENAME and puts it - below the cursor position. + 4. [:r](:r) FILENAME retrieves disk file FILENAME and puts it + below the cursor position. - 5. [:r !dir](:r!) reads the output of the dir command and - puts it below the cursor position. + 5. [:r !dir](:r!) reads the output of the dir command and + puts it below the cursor position. # Lesson 6.1: THE OPEN COMMAND @@ -719,12 +719,12 @@ NOTE: You can also read the output of an external command. For example, 3. Now type some text and press ``{normal} to exit Insert mode. ----> After typing o the cursor is placed on the open line in Insert mode. {expect:ANYTHING} +After typing `o`{normal} the cursor is placed on the open line in Insert mode. 4. To open up a line ABOVE the cursor, simply type a [capital O](O), rather - than a lowercase `o`{normal}. Try this on the line below. + than a lowercase `o`{normal}. Try this on the line below. ----> Open up a line above this by typing O while the cursor is on this line. {expect:ANYTHING} +Open up a line above this by typing O while the cursor is on this line. # Lesson 6.2: THE APPEND COMMAND @@ -734,43 +734,43 @@ NOTE: You can also read the output of an external command. For example, 2. Press `e`{normal} until the cursor is on the end of "li". - 3. Type an `a`{normal} (lowercase) to [append](a) text AFTER the cursor. + 3. Type the lowercase letter `a`{normal} to [append](a) text AFTER the cursor. - 4. Complete the word like the line below it. Press ``{normal} to exit Insert + 4. Complete the word like the line below it. Press ``{normal} to exit Insert mode. 5. Use `e`{normal} to move to the next incomplete word and repeat steps 3 and 4. ----> This li will allow you to pract appendi text to a line. {expect:This line will allow you to practice appending text to a line.} ----> This line will allow you to practice appending text to a line. {expect:This line will allow you to practice appending text to a line.} +This li will allow you to pract appendi text to a line. +This line will allow you to practice appending text to a line. -NOTE: [a](a), [i](i) and [A](A) all go to the same Insert mode, the only difference is where - the characters are inserted. +NOTE: [a](a), [i](i) and [A](A) all go to the same Insert mode, the only difference is where + the characters are inserted. # Lesson 6.3: ANOTHER WAY TO REPLACE ** Type a capital `R`{normal} to replace more than one character. ** - 1. Move the cursor to the first line below marked --->. Move the cursor to + 1. Move the cursor to the first line below marked --->. Move the cursor to the beginning of the first "xxx". 2. Now press `R`{normal} ([capital R](R)) and type the number below it in the second line, so that it replaces the "xxx". - 3. Press ``{normal} to leave [Replace mode](mode-replace). Notice that the rest of the line + 3. Press ``{normal} to leave [Replace mode](mode-replace). Notice that the rest of the line remains unmodified. 4. Repeat the steps to replace the remaining "xxx". ----> Adding 123 to xxx gives you xxx. {expect:Adding 123 to 456 gives you 579.} ----> Adding 123 to 456 gives you 579. {expect:Adding 123 to 456 gives you 579.} +Adding 123 to xxx gives you xxx. +Adding 123 to 456 gives you 579. -NOTE: Replace mode is like Insert mode, but every typed character deletes an - existing character. +NOTE: Replace mode is like Insert mode, but every typed character deletes an + existing character. # Lesson 6.4: COPY AND PASTE TEXT -** Use the `y`{normal} operator to copy text and `p`{normal} to paste it ** +** Use the `y`{normal} operator to copy text and `p`{normal} to paste it. ** 1. Go to the line marked with ---> below and place the cursor after "a)". @@ -780,35 +780,37 @@ NOTE: Replace mode is like Insert mode, but every typed character deletes an 4. Move the cursor to the end of the next line: `j$`{normal} - 5. Type `p`{normal} to [put](put) (paste) the text. Then type: "a second"``{normal}. + 5. Type `p`{normal} to [put](put) (paste) the text. - 6. Use Visual mode to select " item.", yank it with `y`{normal}, move to the end of + 6. Press `a`{normal} and then type "second". Press ``{normal} to leave Insert mode. + + 7. Use Visual mode to select " item.", yank it with `y`{normal}, move to the end of the next line with `j$`{normal} and put the text there with `p`{normal}. ----> a) this is the first item. ----> b) {expect: b) this is the second item} +a) This is the first item. + b) - NOTE: you can also use `y`{normal} as an operator; `yw`{normal} yanks one word. +NOTE: you can also use `y`{normal} as an operator; `yw`{normal} yanks one word. # Lesson 6.5: SET OPTION -** Set an option so a search or substitute ignores case ** +** Set an option so a search or substitute ignores case. ** - 1. Search for 'ignore' by entering: `/ignore` + 1. Search for 'ignore' by entering: `/ignore` Repeat several times by pressing `n`{normal}. 2. Set the 'ic' (Ignore case) option by entering: ~~~ cmd :set ic ~~~ - 3. Now search for 'ignore' again by pressing n + 3. Now search for 'ignore' again by pressing `n`{normal}. Notice that Ignore and IGNORE are now also found. 4. Set the 'hlsearch' and 'incsearch' options: ~~~ cmd :set hls is ~~~ - 5. Now type the search command again and see what happens: /ignore + 5. Now type the search command again and see what happens: /ignore 6. To disable ignoring case enter: ~~~ cmd @@ -818,12 +820,12 @@ NOTE: Replace mode is like Insert mode, but every typed character deletes an ~~~ cmd :set invic ~~~ -NOTE: To remove the highlighting of matches enter: +NOTE: To remove the highlighting of matches enter: ~~~ cmd :nohlsearch ~~~ -NOTE: If you want to ignore case for just one search command, use [\c](/\c) - in the phrase: /ignore\c +NOTE: If you want to ignore case for just one search command, use [\c](/\c) + in the phrase: /ignore\c # Lesson 6 SUMMARY @@ -839,7 +841,7 @@ NOTE: If you want to ignore case for just one search command, use [\c](/\c) 5. Typing a capital `R`{normal} enters Replace mode until ``{normal} is pressed. - 6. Typing "[:set](:set) xxx" sets the option "xxx". Some options are: + 6. Typing "[:set](:set) xxx" sets the option "xxx". Some options are: 'ic' 'ignorecase' ignore upper/lower case when searching 'is' 'incsearch' show partial matches for a search phrase @@ -858,9 +860,9 @@ NOTE: If you want to ignore case for just one search command, use [\c](/\c) # Lesson 7.1: GETTING HELP -** Use the on-line help system ** +** Use the on-line help system. ** -Vim has a comprehensive on-line help system. To get started, try one of +Vim has a comprehensive on-line help system. To get started, try one of these three: - press the ``{normal} key (if you have one) - press the ``{normal} key (if you have one) @@ -872,7 +874,7 @@ Type ``{normal} to jump from one window to another. Type `:q`{vim} to close the help window. You can find help on just about any subject, by giving an argument to the -":help" command. Try these (don't forget pressing ): +":help" command. Try these (don't forget pressing ): ~~~ cmd :help w :help c_CTRL-D @@ -881,13 +883,13 @@ You can find help on just about any subject, by giving an argument to the ~~~ # Lesson 7.2: CREATE A STARTUP SCRIPT -** Enable Vim features ** +** Enable Vim features. ** Vim has many more features than Vi, but most of them are disabled by -default. To start using more features you have to create a "vimrc" file. +default. To start using more features you have to create a "vimrc" file. - 1. Start editing the "vimrc" file. This depends on your system: - `:e ~/.config/nvim/init.vim`{vim} for Unix-like systems + 1. Start editing the "vimrc" file. This depends on your system: + `:e ~/.config/nvim/init.vim`{vim} for Unix-like systems 2. Now read the example "vimrc" file contents: `:r $VIMRUNTIME/vimrc_example.vim`{vim} @@ -897,15 +899,15 @@ default. To start using more features you have to create a "vimrc" file. The next time you start Vim it will use syntax highlighting. You can add all your preferred settings to this "vimrc" file. - For more information type :help vimrc-intro + For more information type `:help vimrc-intro`{vim}. # Lesson 7.3: COMPLETION -** Command line completion with ``{normal} and ``{normal} ** +** Command line completion with ``{normal} and ``{normal}. ** - 1. Look what files exist in the directory: `:!ls`{vim} + 1. Look what files exist in the directory: `:!ls`{vim} - 2. Type the start of a command: `:e`{vim} + 2. Type the start of a command: `:e`{vim} 3. Press ``{normal} and Vim will show a list of commands that start with "e". @@ -913,20 +915,20 @@ default. To start using more features you have to create a "vimrc" file. 5. Now add a space and the start of an existing file name: `:edit FIL`{vim} - 6. Press ``{normal}. Vim will complete the name (if it is unique). + 6. Press ``{normal}. Vim will complete the name (if it is unique). -NOTE: Completion works for many commands. It is especially useful for `:help`{vim}. +NOTE: Completion works for many commands. It is especially useful for `:help`{vim}. # Lesson 7 SUMMARY 1. Type `:help`{vim} or press ``{normal} or ``{normal} to open a help window. - 2. Type `:help TOPIC`{vim} to find help on TOPIC. + 2. Type `:help TOPIC`{vim} to find help on TOPIC. - 3. Type ``{normal} to jump to another window + 3. Type ``{normal} to jump to another window - 4. Type `:q`{vim} to close the help window + 4. Type `:q`{vim} to close the help window 5. Create a vimrc startup script to keep your preferred settings. @@ -937,22 +939,24 @@ NOTE: Completion works for many commands. It is especially useful for `:help`{v This was intended to give a brief overview of the Vim editor, just enough to allow you to use the editor fairly easily. It is far from complete as Vim has -many many more commands. Consult the help often. +many many more commands. Consult the help often. There are many resources online to learn more about vim. Here's a bunch of them: - *Learn Vim Progressively*: http://yannesposito.com/Scratch/en/blog/Learn-Vim-Progressively/ - *Learning Vim in 2014*: http://benmccormick.org/learning-vim-in-2014/ -- Vimcasts: http://vimcasts.org/ -- Vim Video-Tutorials by Derek Wyatt: http://derekwyatt.org/vim/tutorials/ +- *Vimcasts*: http://vimcasts.org/ +- *Vim Video-Tutorials by Derek Wyatt*: http://derekwyatt.org/vim/tutorials/ - *Learn Vimscript the Hard Way*: http://learnvimscriptthehardway.stevelosh.com/ - *7 Habits of Effective Text Editing*: http://www.moolenaar.net/habits.html +- *vim-galore*: https://github.com/mhinz/vim-galore -If you prefer a book, *Practival Vim* by Drew Neil is recommended often. +If you prefer a book, *Practical Vim* by Drew Neil is recommended often (the sequel, *Modern +Vim*, includes material specific to nvim). This tutorial was written by Michael C. Pierce and Robert K. Ware, Colorado School of Mines using ideas supplied by Charles Smith, Colorado State -University. E-mail: bware@mines.colorado.edu. +University. E-mail: bware@mines.colorado.edu. Modified for Vim by Bram Moolenaar. Modified for vim-tutor-mode by Felipe Morales. diff --git a/runtime/tutor/en/vim-01-beginner.tutor.json b/runtime/tutor/en/vim-01-beginner.tutor.json new file mode 100644 index 0000000000..444bd7c4b7 --- /dev/null +++ b/runtime/tutor/en/vim-01-beginner.tutor.json @@ -0,0 +1,45 @@ +{ + "expect": { + "24": -1, + "102": "The cow jumped over the moon.", + "122": "There is some text missing from this line.", + "123": "There is some text missing from this line.", + "141": "There is some text missing from this line.", + "142": "There is some text missing from this line.", + "143": "There is also some text missing here.", + "144": "There is also some text missing here.", + "215": "There are some words that don't belong in this sentence.", + "231": "Somebody typed the end of this line twice.", + "271": -1, + "290": "This line of words is cleaned up.", + "304": -1, + "305": -1, + "306": -1, + "307": -1, + "308": -1, + "309": -1, + "310": -1, + "325": "Fix the errors on this line and replace them with undo.", + "365": -1, + "366": -1, + "367": -1, + "368": -1, + "382": "When this line was typed in, someone pressed some wrong keys!", + "383": "When this line was typed in, someone pressed some wrong keys!", + "403": "This line has a few words that need changing using the change operator.", + "404": "This line has a few words that need changing using the change operator.", + "424": "The end of this line needs to be corrected using the c$ command.", + "425": "The end of this line needs to be corrected using the c$ command.", + "487": -1, + "506": -1, + "531": "Usually the best time to see the flowers is in the spring.", + "722": -1, + "727": -1, + "744": "This line will allow you to practice appending text to a line.", + "745": "This line will allow you to practice appending text to a line.", + "765": "Adding 123 to 456 gives you 579.", + "766": "Adding 123 to 456 gives you 579.", + "790": "a) This is the first item.", + "791": " b) This is the second item." + } +} diff --git a/runtime/tutor/tutor.tutor b/runtime/tutor/tutor.tutor index 1ad64a18ff..c937bd686a 100644 --- a/runtime/tutor/tutor.tutor +++ b/runtime/tutor/tutor.tutor @@ -60,27 +60,27 @@ is displayed like 1. Format the line below so it becomes a lesson description: ----> This is text with important information {expect:This is text with **important information**} ----> This is text with **important information** {expect:This is text with **important information**} +This is text with important information +This is text with **important information** Note: Some words (e.g., NOTE, IMPORTANT, tip, ATTENTION, etc.) will also be highlighted. You don't need to mark them specially. 2. Turn the line below into a TODO item: ----> Document '&variable' {expect:TODO: Document '&variable'} ----> TODO: Document '&variable' {expect:TODO: Document '&variable'} +Document '&variable' +TODO: Document '&variable' ### Headers *headers* 3. Practice fixing the lines below: ----> This is a level 1 header {expect:# This is a level 1 header} ----> # This is a level 1 header {expect:# This is a level 1 header} ----> This is a level 3 header {expect:### This is a level 3 header} ----> ### This is a level 3 header {expect:### This is a level 3 header} ----> This is a header with a label {expect:# This is a header with a label {*label*}} ----> # This is a header with a label {*label*} {expect:# This is a header with a label {*label*}} +This is a level 1 header +# This is a level 1 header +This is a level 3 header +### This is a level 3 header +This is a header with a label +# This is a header with a label {*label*} 4. Now, create a 4th level section here, and add a label like in the previous exercise: @@ -105,8 +105,8 @@ If the target of a link matches a help topic, opening it will open it. 5. Fix the following line: ----> A link to help for the 'breakindent' option {expect:A link to help for the ['breakindent']('breakindent') option} ----> A link to help for the ['breakindent']('breakindent') option {expect:A link to help for the ['breakindent']('breakindent') option} +A link to help for the 'breakindent' option +A link to help for the ['breakindent']('breakindent') option #### Anchor links @@ -120,8 +120,8 @@ and are hidden by default. Links to them look like 6. Add the appropiate link: ----> A link to the Links section {expect:A link to the [Links](*links*) section} ----> A link to the [Links](*links*) section {expect:A link to the [Links](*links*) section} +A link to the Links section +A link to the [Links](*links*) section 7. Now, create a link to the section you created on exercise 4 above. @@ -136,8 +136,8 @@ You can also have links to other tutorials. For this, you'll write the anchor in 7. Create a link to this tutorial: ----> A link to the vim-tutor-mode tutorial {expect:A link to [the vim-tutor-mode tutorial](@tutor:tutor)} ----> A link to [the vim-tutor-mode tutorial](@tutor:tutor) {expect:A link to [the vim-tutor-mode tutorial](@tutor:tutor)} +A link to the vim-tutor-mode tutorial +A link to [the vim-tutor-mode tutorial](@tutor:tutor) ### Codeblocks *codeblocks* @@ -154,13 +154,13 @@ echom "hello" 8. Copy the viml section below ----> {expect:~~~ viml} ----> {expect:echom "the value of &number is".string(&number)} ----> {expect:~~~} ----> ~~~ viml {expect:~~~ viml} ----> echom "the value of &number is".string(&number) {expect:echom "the value of &number is".string(&number)} ----> ~~~ {expect:~~~} + + + +~~~ viml +echom 'the value of &number is'.string(&number) +~~~ You can inline viml code using "\`" and "\`{vim}": @@ -185,13 +185,13 @@ Note: you can also write `norm` or `normal`. 9. Copy the normal section below ----> {expect:~~~ normal} ----> {expect:d2w} ----> {expect:~~~} ----> ~~~ normal {expect:~~~ normal} ----> d2w {expect:d2w} ----> ~~~ {expect:~~~} + + + +~~~ normal +d2w +~~~ You can also inline normal commands by using "\`" and "\`{normal}": @@ -203,10 +203,11 @@ is displayed: 10. Complete the line as shown ----> d {expect:«d2w»} ----> «d2w» {expect:«d2w»} +d +`d2w`{normal} -Commands to run in the system shell can be highlighted by indenting a line starting with "$". +Commands to run in the system shell can be highlighted by indenting a line +starting with "$". ~~~ sh $ vim --version @@ -215,45 +216,32 @@ Commands to run in the system shell can be highlighted by indenting a line start ## INTERACTIVE ELEMENTS *interactive* As visible in this very document, vim-tutor-mode includes some interactive -elements, to provide feedback to the user about his progress. These elements -all have the syntax - - \---> TEXT {CLAUSE} - -where \---> must start at the beginning of the line. If TEXT satisfies CLAUSE, -a ✓ sign will appear to the left. A ✗ sign is displayed otherwise. The CLAUSE -itself is hidden unless debug mode is set or ['conceallevel']('conceallevel') -is 2. +elements to provide feedback to the user about his progress. If the text in +these elements satisfies some set condition, a ✓ sign will appear in the gutter +to the left. Otherwise, a ✗ sign is displayed. ### expect *expect* -The basic clause is "expect", which is satisfied if TEXT is the same as the -content of the clause. For example +"expect" lines check that the contents of the line are identical to some preset text +(like in the exercises above). - \---> TEXT {expect:TEXT} +These elements are specified in separate JSON files like this -is satisfied, but +~~~ json +{ + "expect": { + "1": "This is how this line should look.", + "2": "This is how this line should look.", + "3": -1 + } +} +~~~ - \---> OTHER TEXT {expect:TEXT} +These files contain an "expect" dictionary, for which the keys are line numbers and +the values are the expected text. A value of -1 means that the condition for the line +will always be satisfied, no matter what (this is useful for letting the user play a bit). -is not. +This is an "expect" line that is always satisfied. Try changing it. -13. Make both lines the same: - ----> this is not right {expect:---> this is right} |expect:---> this is right {expect:---> this is right}| ----> ---> this is right {expect:---> this is right} |expect:---> this is right {expect:---> this is right}| - - -If the content of a expect clause is ANYTHING, no checks will be performed. This is -useful to create a line that is highlighted you want the user to play with. - - \---> TEXT {expect:ANYTHING} - -is displayed - ----> this is free text {expect:ANYTHING} - -14. Turn the line below into free text: - ----> this is some text |expect:---> this is some text {expect:ANYTHING}| ----> ---> this is some text {expect:ANYTHING} |expect:---> this is some text {expect:ANYTHING}| +These files conventionally have the same name as the tutorial document with the `.json` +extension appended (for a full example, see the file that corresponds to this tutorial). diff --git a/runtime/tutor/tutor.tutor.json b/runtime/tutor/tutor.tutor.json new file mode 100644 index 0000000000..bf3eae8586 --- /dev/null +++ b/runtime/tutor/tutor.tutor.json @@ -0,0 +1,35 @@ +{ + "expect": { + "63": "This is text with **important information**", + "64": "This is text with **important information**", + "71": "Document '&variable'", + "72": "Document '&variable'", + "78": "# This is a level 1 header", + "79": "# This is a level 1 header", + "80": "### This is a level 3 header", + "81": "### This is a level 3 header", + "82": "# This is a header with a label {*label*}", + "83": "# This is a header with a label {*label*}", + "108": "A link to help for the ['breakindent']('breakindent') option", + "109": "A link to help for the ['breakindent']('breakindent') option", + "123": "A link to the [Links](*links*) section", + "124": "A link to the [Links](*links*) section", + "139": "A link to [the vim-tutor-mode tutorial](@tutor:tutor)", + "140": "A link to [the vim-tutor-mode tutorial](@tutor:tutor)", + "157": "~~~ viml", + "158": "echom 'the value of &number is'.string(&number)", + "159": "~~~", + "161": "~~~ viml", + "162": "echom 'the value of &number is'.string(&number)", + "163": "~~~", + "188": "~~~ normal", + "189": "d2w", + "190": "~~~", + "192": "~~~ normal", + "193": "d2w", + "194": "~~~", + "206": "`d2w`{normal}", + "207": "`d2w`{normal}", + "244": -1 + } +} diff --git a/runtime/vimrc_example.vim b/runtime/vimrc_example.vim deleted file mode 100644 index 17cba123a8..0000000000 --- a/runtime/vimrc_example.vim +++ /dev/null @@ -1,56 +0,0 @@ -" An example for a vimrc file. -" -" To use it, copy it to -" for Unix: $HOME/.config/nvim/init.vim -" for Windows: %LOCALAPPDATA%\nvim\init.vim - -set backup " keep a backup file (restore to previous version) -set undofile " keep an undo file (undo changes after closing) -set ruler " show the cursor position all the time -set showcmd " display incomplete commands - -" Don't use Ex mode, use Q for formatting -noremap Q gq - -" CTRL-U in insert mode deletes a lot. Use CTRL-G u to first break undo, -" so that you can undo CTRL-U after inserting a line break. -inoremap u - -" Switch syntax highlighting on -syntax on - -" Also switch on highlighting the last used search pattern. -set hlsearch - -" I like highlighting strings inside C comments. -let c_comment_strings=1 - -" Enable file type detection. -" Use the default filetype settings, so that mail gets 'textwidth' set to 72, -" 'cindent' is on in C files, etc. -" Also load indent files, to automatically do language-dependent indenting. -filetype plugin indent on - -" Put these in an autocmd group, so that we can delete them easily. -augroup vimrcEx - autocmd! - - " For all text files set 'textwidth' to 78 characters. - autocmd FileType text setlocal textwidth=78 - - " When editing a file, always jump to the last known cursor position. - " Don't do it when the position is invalid or when inside an event handler - autocmd BufReadPost * - \ if line("'\"") >= 1 && line("'\"") <= line("$") | - \ execute "normal! g`\"" | - \ endif - -augroup END - -" Convenient command to see the difference between the current buffer and the -" file it was loaded from, thus the changes you made. -" Only define it when not defined already. -if !exists(":DiffOrig") - command DiffOrig vert new | set buftype=nofile | read ++edit # | 0d_ | diffthis - \ | wincmd p | diffthis -endif diff --git a/scripts/check-includes.py b/scripts/check-includes.py new file mode 100755 index 0000000000..21308a21aa --- /dev/null +++ b/scripts/check-includes.py @@ -0,0 +1,66 @@ +#!/usr/bin/env python + +import sys +import re +import os + +from subprocess import Popen, PIPE +from argparse import ArgumentParser + + +GENERATED_INCLUDE_RE = re.compile( + r'^\s*#\s*include\s*"([/a-z_0-9.]+\.generated\.h)"(\s+//.*)?$') + + +def main(argv): + argparser = ArgumentParser() + argparser.add_argument('--generated-includes-dir', action='append', + help='Directory where generated includes are located.') + argparser.add_argument('--file', type=open, help='File to check.') + argparser.add_argument('iwyu_args', nargs='*', + help='IWYU arguments, must go after --.') + args = argparser.parse_args(argv) + + with args.file: + include_dirs = [] + + iwyu = Popen(['include-what-you-use', '-xc'] + args.iwyu_args + ['/dev/stdin'], + stdin=PIPE, stdout=PIPE, stderr=PIPE) + + for line in args.file: + match = GENERATED_INCLUDE_RE.match(line) + if match: + for d in args.generated_includes_dir: + try: + f = open(os.path.join(d, match.group(1))) + except IOError: + continue + else: + with f: + for generated_line in f: + iwyu.stdin.write(generated_line) + break + else: + raise IOError('Failed to find {0}'.format(match.group(1))) + else: + iwyu.stdin.write(line) + + iwyu.stdin.close() + + out = iwyu.stdout.read() + err = iwyu.stderr.read() + + ret = iwyu.wait() + + if ret != 2: + print('IWYU failed with exit code {0}:'.format(ret)) + print('{0} stdout {0}'.format('=' * ((80 - len(' stdout ')) // 2))) + print(out) + print('{0} stderr {0}'.format('=' * ((80 - len(' stderr ')) // 2))) + print(err) + return 1 + return 0 + + +if __name__ == '__main__': + raise SystemExit(main(sys.argv[1:])) diff --git a/scripts/download-unicode-files.sh b/scripts/download-unicode-files.sh index 54fc32550c..5f38d0589a 100755 --- a/scripts/download-unicode-files.sh +++ b/scripts/download-unicode-files.sh @@ -22,7 +22,7 @@ UNIDIR=${1:-$UNIDIR_DEFAULT} DOWNLOAD_URL_BASE=${2:-$DOWNLOAD_URL_BASE_DEFAULT} for filename in $data_files ; do - curl -o "$UNIDIR/$filename" "$DOWNLOAD_URL_BASE/UNIDATA/$filename" + curl -L -o "$UNIDIR/$filename" "$DOWNLOAD_URL_BASE/UNIDATA/$filename" ( cd "$UNIDIR" git add $filename @@ -30,7 +30,7 @@ for filename in $data_files ; do done for filename in $emoji_files ; do - curl -o "$UNIDIR/$filename" "$DOWNLOAD_URL_BASE/emoji/3.0/$filename" + curl -L -o "$UNIDIR/$filename" "$DOWNLOAD_URL_BASE/emoji/latest/$filename" ( cd "$UNIDIR" git add $filename diff --git a/scripts/gen_api_vimdoc.py b/scripts/gen_api_vimdoc.py index 4dcb42d685..51e585a007 100644 --- a/scripts/gen_api_vimdoc.py +++ b/scripts/gen_api_vimdoc.py @@ -38,6 +38,10 @@ import subprocess from xml.dom import minidom +if sys.version_info[0] < 3: + print("use Python 3") + sys.exit(1) + doc_filename = 'api.txt' # String used to find the start of the generated part of the doc. section_start_token = '*api-global*' @@ -69,7 +73,7 @@ text_width = 78 script_path = os.path.abspath(__file__) base_dir = os.path.dirname(os.path.dirname(script_path)) src_dir = os.path.join(base_dir, 'src/nvim/api') -out_dir = os.path.join(base_dir, 'tmp/api_doc') +out_dir = os.path.join(base_dir, 'tmp-api-doc') filter_cmd = '%s %s' % (sys.executable, script_path) seen_funcs = set() @@ -217,7 +221,12 @@ def parse_para(parent, width=62): width=width) + '\n') elif child.nodeName == 'simplesect': kind = child.getAttribute('kind') - if kind == 'return': + if kind == 'note': + lines.append('Note:') + lines.append(doc_wrap(parse_para(child), + prefix=' ', + width=width)) + elif kind == 'return': lines.append('%s:~' % kind.title()) lines.append(doc_wrap(parse_para(child), prefix=' ', @@ -280,14 +289,19 @@ def parse_source_xml(filename): parts = return_type.strip('_').split('_') return_type = '%s(%s)' % (parts[0], ', '.join(parts[1:])) + name = get_text(get_child(member, 'name')) + annotations = get_text(get_child(member, 'argsstring')) if annotations and ')' in annotations: annotations = annotations.rsplit(')', 1)[-1].strip() + # XXX: (doxygen 1.8.11) 'argsstring' only includes FUNC_ATTR_* + # attributes if the function signature is non-void. + # Force attributes here for such functions. + if name == 'nvim_get_mode' and len(annotations) == 0: + annotations += 'FUNC_API_ASYNC' annotations = filter(None, map(lambda x: annotation_map.get(x), annotations.split())) - name = get_text(get_child(member, 'name')) - vimtag = '*%s()*' % name args = [] type_length = 0 diff --git a/scripts/genappimage.sh b/scripts/genappimage.sh new file mode 100755 index 0000000000..a73ccd86c7 --- /dev/null +++ b/scripts/genappimage.sh @@ -0,0 +1,83 @@ +#!/bin/bash + +######################################################################## +# Package the binaries built as an AppImage +# By Simon Peter 2016 +# For more information, see http://appimage.org/ +######################################################################## + +# App arch, used by generate_appimage. +if [ -z "$ARCH" ]; then + export ARCH="$(arch)" +fi + +# App name, used by generate_appimage. +APP=nvim + +ROOT_DIR="$(git rev-parse --show-toplevel)" +APP_BUILD_DIR="$ROOT_DIR/build" +APP_DIR="$APP.AppDir" + +######################################################################## +# Compile nvim and install it into AppDir +######################################################################## + +# Build and install nvim into the AppImage +make CMAKE_BUILD_TYPE=RelWithDebInfo CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX=${APP_DIR}/usr -DCMAKE_INSTALL_MANDIR=man" +make install + +######################################################################## +# Get helper functions and move to AppDir +######################################################################## + +# App version, used by generate_appimage. +VERSION=$("$ROOT_DIR"/build/bin/nvim --version | head -n 1 | grep -o 'v.*') + +cd "$APP_BUILD_DIR" + +curl -Lo "$APP_BUILD_DIR"/appimage_functions.sh https://github.com/probonopd/AppImages/raw/master/functions.sh +. ./appimage_functions.sh + +# Copy desktop and icon file to AppDir for AppRun to pick them up. +# get_apprun +# get_desktop +cp "$ROOT_DIR/runtime/nvim.desktop" "$APP_DIR/" +cp "$ROOT_DIR/runtime/nvim.png" "$APP_DIR/" + +cd "$APP_DIR" + +# copy dependencies +copy_deps +# Move the libraries to usr/bin +move_lib + +# Delete stuff that should not go into the AppImage. +# Delete dangerous libraries; see +# https://github.com/probonopd/AppImages/blob/master/excludelist +delete_blacklisted + +######################################################################## +# AppDir complete. Now package it as an AppImage. +######################################################################## + +# No need for a fancy script. AppRun can just be a symlink to nvim. +ln -s usr/bin/nvim AppRun + +cd "$APP_BUILD_DIR" # Get out of AppImage directory. + +# Generate AppImage. +# - Expects: $ARCH, $APP, $VERSION env vars +# - Expects: ./$APP.AppDir/ directory +# - Produces: ../out/$APP-$VERSION.glibc$GLIBC_NEEDED-$ARCH.AppImage +generate_appimage + +# NOTE: There is currently a bug in the `generate_appimage` function (see +# https://github.com/probonopd/AppImages/issues/228) that causes repeated builds +# that result in the same name to fail. +# Moving the final executable to a different folder gets around this issue. + +mv "$ROOT_DIR"/out/*.AppImage "$ROOT_DIR"/build/bin +# Remove the (now empty) folder the AppImage was built in +rmdir "$ROOT_DIR"/out + +echo 'genappimage.sh: finished' diff --git a/scripts/pvscheck.sh b/scripts/pvscheck.sh new file mode 100755 index 0000000000..30c4d296d7 --- /dev/null +++ b/scripts/pvscheck.sh @@ -0,0 +1,454 @@ +#!/bin/sh + +# Assume that "local" is available. +# shellcheck disable=SC2039 + +set -e +# Note: -u causes problems with posh, it barks at “undefined” $@ when no +# arguments provided. +test -z "$POSH_VERSION" && set -u + +get_jobs_num() { + if [ -n "${TRAVIS:-}" ] ; then + # HACK: /proc/cpuinfo on Travis CI is misleading, so hardcode 1. + echo 1 + else + echo $(( $(grep -c "^processor" /proc/cpuinfo) + 1 )) + fi +} + +help() { + echo 'Usage:' + echo ' pvscheck.sh [--pvs URL] [--deps] [--environment-cc]' + echo ' [target-directory [branch]]' + echo ' pvscheck.sh [--pvs URL] [--recheck] [--environment-cc]' + echo ' [target-directory]' + echo ' pvscheck.sh [--pvs URL] --only-analyse [target-directory]' + echo ' pvscheck.sh [--pvs URL] --pvs-install {target-directory}' + echo ' pvscheck.sh --patch [--only-build]' + echo + echo ' --pvs: Fetch pvs-studio from URL.' + echo ' --pvs detect: Auto-detect latest version (by scraping viva64.com).' + echo + echo ' --deps: (for regular run) Use top-level Makefile and build deps.' + echo ' Without this it assumes all dependencies are already' + echo ' installed.' + echo + echo ' --environment-cc: (for regular run and --recheck) Do not export' + echo ' CC=clang. Build is still run with CFLAGS=-O0.' + echo + echo ' --only-build: (for --patch) Only patch files in ./build directory.' + echo + echo ' --pvs-install: Only install PVS-studio to the specified location.' + echo + echo ' --patch: patch sources in the current directory.' + echo ' Does not patch already patched files.' + echo ' Does not run analysis.' + echo + echo ' --recheck: run analysis on a prepared target directory.' + echo + echo ' --only-analyse: run analysis on a prepared target directory ' + echo ' without building Neovim.' + echo + echo ' target-directory: Directory where build should occur.' + echo ' Default: ../neovim-pvs' + echo + echo ' branch: Branch to check.' + echo ' Default: master.' +} + +getopts_error() { + local msg="$1" ; shift + local do_help= + if test "$msg" = "--help" ; then + msg="$1" ; shift + do_help=1 + fi + printf '%s\n' "$msg" >&2 + if test -n "$do_help" ; then + printf '\n' >&2 + help >&2 + fi + echo 'return 1' + return 1 +} + +# Usage `eval "$(getopts_long long_defs -- positionals_defs -- "$@")"` +# +# long_defs: list of pairs of arguments like `longopt action`. +# positionals_defs: list of arguments like `action`. +# +# `action` is a space-separated commands: +# +# store_const [const] [varname] [default] +# Store constant [const] (default 1) (note: eval’ed) if argument is present +# (long options only). Assumes long option accepts no arguments. +# store [varname] [default] +# Store value. Assumes long option needs an argument. +# run {func} [varname] [default] +# Run function {func} and store its output to the [varname]. Assumes no +# arguments accepted (long options only). +# modify {func} [varname] [default] +# Like run, but assumes a single argument, passed to function {func} as $1. +# +# All actions stores empty value if neither [varname] nor [default] are +# present. [default] is evaled by top-level `eval`, so be careful. Also note +# that no arguments may contain spaces, including [default] and [const]. +getopts_long() { + local positional= + local opt_bases="" + while test $# -gt 0 ; do + local arg="$1" ; shift + local opt_base= + local act= + local opt_name= + if test -z "$positional" ; then + if test "$arg" = "--" ; then + positional=0 + continue + fi + act="$1" ; shift + opt_name="$(echo "$arg" | tr '-' '_')" + opt_base="longopt_$opt_name" + else + if test "$arg" = "--" ; then + break + fi + : $(( positional+=1 )) + act="$arg" + opt_name="arg_$positional" + opt_base="positional_$positional" + fi + opt_bases="$opt_bases $opt_base" + eval "local varname_$opt_base=$opt_name" + local i=0 + for act_subarg in $act ; do + eval "local act_$(( i+=1 ))_$opt_base=\"\$act_subarg\"" + done + done + # Process options + local positional=0 + local force_positional= + while test $# -gt 0 ; do + local argument="$1" ; shift + local opt_base= + local has_equal= + local equal_arg= + local is_positional= + if test "$argument" = "--" ; then + force_positional=1 + continue + elif test -z "$force_positional" && test "${argument#--}" != "$argument" + then + local opt_name="${argument#--}" + local opt_name_striparg="${opt_name%%=*}" + if test "$opt_name" = "$opt_name_striparg" ; then + has_equal=0 + else + has_equal=1 + equal_arg="${argument#*=}" + opt_name="$opt_name_striparg" + fi + # Use trailing x to prevent stripping newlines + opt_name="$(printf '%sx' "$opt_name" | tr '-' '_')" + opt_name="${opt_name%x}" + if test -n "$(printf '%sx' "$opt_name" | tr -d 'a-z_')" ; then + getopts_error "Option contains invalid characters: $opt_name" + fi + opt_base="longopt_$opt_name" + else + : $(( positional+=1 )) + opt_base="positional_$positional" + is_positional=1 + fi + if test -n "$opt_base" ; then + eval "local occurred_$opt_base=1" + + eval "local act_1=\"\${act_1_$opt_base:-}\"" + eval "local varname=\"\${varname_$opt_base:-}\"" + local need_val= + local func= + case "$act_1" in + (store_const) + eval "local const=\"\${act_2_${opt_base}:-1}\"" + eval "local varname=\"\${act_3_${opt_base}:-$varname}\"" + printf 'local %s=%s\n' "$varname" "$const" + ;; + (store) + eval "varname=\"\${act_2_${opt_base}:-$varname}\"" + need_val=1 + ;; + (run) + eval "func=\"\${act_2_${opt_base}}\"" + eval "varname=\"\${act_3_${opt_base}:-$varname}\"" + printf 'local %s="$(%s)"\n' "$varname" "$func" + ;; + (modify) + eval "func=\"\${act_2_${opt_base}}\"" + eval "varname=\"\${act_3_${opt_base}:-$varname}\"" + need_val=1 + ;; + ("") + getopts_error --help "Wrong argument: $argument" + ;; + esac + if test -n "$need_val" ; then + local val= + if test -z "$is_positional" ; then + if test $has_equal = 1 ; then + val="$equal_arg" + else + if test $# -eq 0 ; then + getopts_error "Missing argument for $opt_name" + fi + val="$1" ; shift + fi + else + val="$argument" + fi + local escaped_val="'$(printf "%s" "$val" | sed "s/'/'\\\\''/g")'" + case "$act_1" in + (store) + printf 'local %s=%s\n' "$varname" "$escaped_val" + ;; + (modify) + printf 'local %s="$(%s %s)"\n' "$varname" "$func" "$escaped_val" + ;; + esac + fi + fi + done + # Print default values when no values were provided + local opt_base= + for opt_base in $opt_bases ; do + eval "local occurred=\"\${occurred_$opt_base:-}\"" + if test -n "$occurred" ; then + continue + fi + eval "local act_1=\"\$act_1_$opt_base\"" + eval "local varname=\"\$varname_$opt_base\"" + case "$act_1" in + (store) + eval "local varname=\"\${act_2_${opt_base}:-$varname}\"" + eval "local default=\"\${act_3_${opt_base}:-}\"" + printf 'local %s=%s\n' "$varname" "$default" + ;; + (store_const|run|modify) + eval "local varname=\"\${act_3_${opt_base}:-$varname}\"" + eval "local default=\"\${act_4_${opt_base}:-}\"" + printf 'local %s=%s\n' "$varname" "$default" + ;; + esac + done +} + +get_pvs_comment() { + local tgt="$1" ; shift + + cat > "$tgt/pvs-comment" << EOF +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + +EOF +} + +install_pvs() {( + local tgt="$1" ; shift + local pvs_url="$1" ; shift + + cd "$tgt" + + mkdir pvs-studio + cd pvs-studio + + curl -L -o pvs-studio.tar.gz "$pvs_url" + tar xzf pvs-studio.tar.gz + rm pvs-studio.tar.gz + local pvsdir="$(find . -maxdepth 1 -mindepth 1)" + find "$pvsdir" -maxdepth 1 -mindepth 1 -exec mv '{}' . \; + rmdir "$pvsdir" +)} + +create_compile_commands() {( + local tgt="$1" ; shift + local deps="$1" ; shift + local environment_cc="$1" ; shift + + if test -z "$environment_cc" ; then + export CC=clang + fi + export CFLAGS=' -O0 ' + + if test -z "$deps" ; then + mkdir -p "$tgt/build" + ( + cd "$tgt/build" + + cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX="$PWD/root" + make -j"$(get_jobs_num)" + ) + else + ( + cd "$tgt" + + make -j"$(get_jobs_num)" CMAKE_EXTRA_FLAGS=" -DCMAKE_INSTALL_PREFIX=$PWD/root -DCMAKE_BUILD_TYPE=Debug " + ) + fi + find "$tgt/build/src/nvim/auto" -name '*.test-include.c' -delete +)} + +# Warning: realdir below only cares about directories unlike realpath. +# +# realpath is not available in Ubuntu trusty yet. +realdir() {( + local dir="$1" + cd "$dir" + printf '%s\n' "$PWD" +)} + +patch_sources() {( + local tgt="$1" ; shift + local only_bulid="${1}" ; shift + + get_pvs_comment "$tgt" + + local sh_script=' + pvs_comment="$(cat pvs-comment ; echo -n EOS)" + filehead="$(head -c $(( ${#pvs_comment} - 3 )) "$1" ; echo -n EOS)" + if test "x$filehead" != "x$pvs_comment" ; then + cat pvs-comment "$1" > "$1.tmp" + mv "$1.tmp" "$1" + fi + ' + + cd "$tgt" + + if test "$only_build" != "--only-build" ; then + find \ + src/nvim test/functional/fixtures test/unit/fixtures \ + -name '*.c' \ + -exec /bin/sh -c "$sh_script" - '{}' \; + fi + + find \ + build/src/nvim/auto build/config \ + -name '*.c' -not -name '*.test-include.c' \ + -exec /bin/sh -c "$sh_script" - '{}' \; + + rm pvs-comment +)} + +run_analysis() {( + local tgt="$1" ; shift + + cd "$tgt" + + pvs-studio-analyzer \ + analyze \ + --threads "$(get_jobs_num)" \ + --output-file PVS-studio.log \ + --verbose \ + --file build/compile_commands.json \ + --sourcetree-root . + + plog-converter -t xml -o PVS-studio.xml PVS-studio.log + plog-converter -t errorfile -o PVS-studio.err PVS-studio.log + plog-converter -t tasklist -o PVS-studio.tsk PVS-studio.log +)} + +detect_url() { + local url="${1:-detect}" + if test "$url" = detect ; then + curl --silent -L 'https://www.viva64.com/en/pvs-studio-download-linux/' \ + | grep -o 'https\{0,1\}://[^"<>]\{1,\}/pvs-studio[^/"<>]*\.tgz' \ + || echo FAILED + else + printf '%s' "$url" + fi +} + +do_check() { + local tgt="$1" ; shift + local branch="$1" ; shift + local pvs_url="$1" ; shift + local deps="$1" ; shift + local environment_cc="$1" ; shift + + if test -z "$pvs_url" || test "$pvs_url" = FAILED ; then + pvs_url="$(detect_url detect)" + if test -z "$pvs_url" || test "$pvs_url" = FAILED ; then + echo "failed to auto-detect PVS URL" + exit 1 + fi + echo "Auto-detected PVS URL: ${pvs_url}" + fi + + git clone --branch="$branch" . "$tgt" + + install_pvs "$tgt" "$pvs_url" + + do_recheck "$tgt" "$deps" "$environment_cc" +} + +do_recheck() { + local tgt="$1" ; shift + local deps="$1" ; shift + local environment_cc="$1" ; shift + + create_compile_commands "$tgt" "$deps" "$environment_cc" + + do_analysis "$tgt" +} + +do_analysis() { + local tgt="$1" ; shift + + if test -d "$tgt/pvs-studio" ; then + local saved_pwd="$PWD" + cd "$tgt/pvs-studio" + export PATH="$PWD/bin${PATH+:}${PATH}" + cd "$saved_pwd" + fi + + run_analysis "$tgt" +} + +main() { + eval "$( + getopts_long \ + help store_const \ + pvs 'modify detect_url pvs_url' \ + patch store_const \ + only-build 'store_const --only-build' \ + recheck store_const \ + only-analyse store_const \ + pvs-install store_const \ + deps store_const \ + environment-cc store_const \ + -- \ + 'modify realdir tgt "$PWD/../neovim-pvs"' \ + 'store branch master' \ + -- "$@" + )" + + if test -n "$help" ; then + help + return 0 + fi + + # set -x + + if test -n "$patch" ; then + patch_sources "$tgt" "$only_build" + elif test -n "$pvs_install" ; then + install_pvs "$tgt" "$pvs_url" + elif test -n "$recheck" ; then + do_recheck "$tgt" "$deps" "$environment_cc" + elif test -n "$only_analyse" ; then + do_analysis "$tgt" + else + do_check "$tgt" "$branch" "$pvs_url" "$deps" "$environment_cc" + fi +} + +main "$@" diff --git a/scripts/release.sh b/scripts/release.sh index dac5e9b177..f1dbf99473 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -18,6 +18,8 @@ set -e set -u set -o pipefail +USE_CURRENT_COMMIT=${1:-no} + __sed=$( [ "$(uname)" = Darwin ] && echo 'sed -E' || echo 'sed -r' ) cd "$(git rev-parse --show-toplevel)" @@ -51,15 +53,18 @@ echo "Release version: ${__VERSION}" $__sed -i.bk 's/(NVIM_VERSION_PRERELEASE) "-dev"/\1 ""/' CMakeLists.txt if grep '(NVIM_API_PRERELEASE true)' CMakeLists.txt > /dev/null; then $__sed -i.bk 's/(NVIM_API_PRERELEASE) true/\1 false/' CMakeLists.txt - cp build/funcs_data.mpack test/functional/fixtures/api_level_$__API_LEVEL.mpack + build/bin/nvim --api-info > test/functional/fixtures/api_level_$__API_LEVEL.mpack git add test/functional/fixtures/api_level_$__API_LEVEL.mpack fi -echo "Building changelog since ${__LAST_TAG}..." -__CHANGELOG="$(./scripts/git-log-pretty-since.sh "$__LAST_TAG" 'vim-patch:\S')" +if ! test "$USE_CURRENT_COMMIT" = 'use-current-commit' ; then + echo "Building changelog since ${__LAST_TAG}..." + __CHANGELOG="$(./scripts/git-log-pretty-since.sh "$__LAST_TAG" 'vim-patch:\S')" + + git add CMakeLists.txt + git commit --edit -m "${__RELEASE_MSG} ${__CHANGELOG}" +fi -git add CMakeLists.txt -git commit --edit -m "${__RELEASE_MSG} ${__CHANGELOG}" git tag --sign -a v"${__VERSION}" -m "NVIM v${__VERSION}" $__sed -i.bk 's/(NVIM_VERSION_PRERELEASE) ""/\1 "-dev"/' CMakeLists.txt @@ -70,6 +75,8 @@ nvim +'/NVIM_VERSION' +10new +'exe "norm! iUpdate version numbers!!!\"' \ git add CMakeLists.txt git commit -m "$__BUMP_MSG" +rm CMakeLists.txt.bk || true + echo " Next steps: - Double-check NVIM_VERSION_* in CMakeLists.txt diff --git a/scripts/vim-patch.sh b/scripts/vim-patch.sh index bf4b7d9080..2875e7d95a 100755 --- a/scripts/vim-patch.sh +++ b/scripts/vim-patch.sh @@ -22,9 +22,10 @@ usage() { echo "Options:" echo " -h Show this message and exit." echo " -l Show list of Vim patches missing from Neovim." - echo " -p {vim-revision} Download and apply the Vim patch vim-revision." - echo " vim-revision can be a version number of the " - echo " format '7.4.xxx' or a Git commit hash." + echo " -p {vim-revision} Download and generate the specified Vim patch." + echo " vim-revision can be a version number '8.0.xxx'" + echo " or a valid Git ref (hash, tag, etc.)." + echo " -P {vim-revision} Download, generate and apply the Vim patch." echo " -g {vim-revision} Download the Vim patch vim-revision." echo " vim-revision can be a version number of the " echo " format '7.4.xxx' or a Git commit hash." @@ -32,7 +33,7 @@ usage() { echo " -r {pr-number} Review a vim-patch pull request to Neovim." echo echo "Set VIM_SOURCE_DIR to change where Vim's sources are stored." - echo "The default is '${VIM_SOURCE_DIR_DEFAULT}'." + echo "Default is '${VIM_SOURCE_DIR_DEFAULT}'." } # Checks if a program is in the user's PATH, and is executable. @@ -109,7 +110,7 @@ assign_commit_details() { local strip_commit_line=true else # Interpret parameter as commit hash. - vim_version="${1:0:7}" + vim_version="${1:0:12}" vim_commit=$(cd "${VIM_SOURCE_DIR}" \ && git log -1 --format="%H" "${vim_version}") local strip_commit_line=false @@ -133,19 +134,26 @@ preprocess_patch() { # Remove *.proto, Make*, gui_*, some if_* local na_src='proto\|Make*\|gui_*\|if_lua\|if_mzsch\|if_olepp\|if_ole\|if_perl\|if_py\|if_ruby\|if_tcl\|if_xcmdsrv' - 2>/dev/null $nvim --cmd 'set dir=/tmp' +'g@^diff --git a/src/\S*\<\%('${na_src}'\)@norm! d/\v(^diff)|%$ ' +w +q "$file" + 2>/dev/null $nvim --cmd 'set dir=/tmp' +'g@^diff --git a/src/\S*\<\%(testdir/\)\@/dev/null $nvim --cmd 'set dir=/tmp' +'g@^diff --git a/runtime/doc/\%('${na_doc}'\)@norm! d/\v(^diff)|%$ ' +w +q "$file" + # Remove channel.txt, netbeans.txt, os_*.txt, term.txt, todo.txt, version*.txt, tags + local na_doc='channel\.txt\|netbeans\.txt\|os_\w\+\.txt\|term\.txt\|todo\.txt\|version\d\.txt\|tags' + 2>/dev/null $nvim --cmd 'set dir=/tmp' +'g@^diff --git a/runtime/doc/\<\%('${na_doc}'\)\>@norm! d/\v(^diff)|%$ ' +w +q "$file" + + # Remove "Last change ..." changes in doc files. + 2>/dev/null $nvim --cmd 'set dir=/tmp' +'%s/^@@.*\n.*For Vim version.*Last change.*\n.*For Vim version.*Last change.*//' +w +q "$file" # Remove some testdir/Make_*.mak files local na_src_testdir='Make_amiga.mak\|Make_dos.mak\|Make_ming.mak\|Make_vms.mms' - 2>/dev/null $nvim --cmd 'set dir=/tmp' +'g@^diff --git a/src/testdir/\%('${na_src_testdir}'\)@norm! d/\v(^diff)|%$ ' +w +q "$file" + 2>/dev/null $nvim --cmd 'set dir=/tmp' +'g@^diff --git a/src/testdir/\<\%('${na_src_testdir}'\)\>@norm! d/\v(^diff)|%$ ' +w +q "$file" # Remove some *.po files. #5622 local na_po='sjiscorr.c\|ja.sjis.po\|ko.po\|pl.cp1250.po\|pl.po\|ru.cp1251.po\|uk.cp1251.po\|zh_CN.cp936.po\|zh_CN.po\|zh_TW.po' - 2>/dev/null $nvim --cmd 'set dir=/tmp' +'g@^diff --git a/src/po/\%('${na_po}'\)@norm! d/\v(^diff)|%$ ' +w +q "$file" + 2>/dev/null $nvim --cmd 'set dir=/tmp' +'g@^diff --git a/src/po/\<\%('${na_po}'\)\>@norm! d/\v(^diff)|%$ ' +w +q "$file" + + # Remove vimrc_example.vim + local na_vimrcexample='vimrc_example\.vim' + 2>/dev/null $nvim --cmd 'set dir=/tmp' +'g@^diff --git a/runtime/\<\%('${na_vimrcexample}'\)\>@norm! d/\v(^diff)|%$ ' +w +q "$file" # Rename src/ paths to src/nvim/ LC_ALL=C sed -e 's/\( [ab]\/src\)/\1\/nvim/g' \ @@ -183,6 +191,7 @@ get_vim_patch() { stage_patch() { get_vim_patch "$1" + local try_apply="${2:-}" local git_remote git_remote="$(find_git_remote)" @@ -212,14 +221,23 @@ stage_patch() { echo "✔ ${output}" || (echo "✘ ${output}"; false) - printf "\nInstructions: - Proceed to port the patch. This may help: - patch -p1 < ${patch_file} + if test -n "$try_apply" ; then + if ! check_executable patch; then + printf "\n✘ 'patch' command not found\n" + else + printf "\nApplying patch...\n" + patch -p1 --posix < "${patch_file}" + fi + printf "\nInstructions:\n Proceed to port the patch.\n" + else + printf "\nInstructions:\n Proceed to port the patch.\n Try the 'patch' command (or use '${BASENAME} -P ...' next time):\n patch -p1 < ${patch_file}\n" + fi - Stage your changes ('git add ...') and use 'git commit --amend' to commit. + printf " + Stage your changes ('git add ...'), then use 'git commit --amend' to commit. - To port additional patches related to ${vim_version} and add them to the - current branch, call '${BASENAME} -p' again. + To port more patches (if any) related to ${vim_version}, + run '${BASENAME}' again. * Do this only for _related_ patches (otherwise it increases the size of the pull request, making it harder to review) @@ -277,7 +295,7 @@ submit_pr() { echo "Pushing to 'origin/${checked_out_branch}'." output="$(git push origin "${checked_out_branch}" 2>&1)" && echo "✔ ${output}" || - (echo "✘ ${output}"; git reset --soft HEAD^1; false) + (echo "✘ ${output}"; false) echo fi @@ -307,7 +325,7 @@ list_vim_patches() { # Get missing Vim commits local vim_commits - vim_commits="$(cd "${VIM_SOURCE_DIR}" && git log --reverse --format='%H' v7.4.1979..HEAD)" + vim_commits="$(cd "${VIM_SOURCE_DIR}" && git log --reverse --format='%H' v8.0.0000..HEAD)" local vim_commit for vim_commit in ${vim_commits}; do @@ -317,8 +335,9 @@ list_vim_patches() { vim_tag="$(cd "${VIM_SOURCE_DIR}" && git describe --tags --exact-match "${vim_commit}" 2>/dev/null)" || true if [[ -n "${vim_tag}" ]]; then local patch_number="${vim_tag:5}" # Remove prefix like "v7.4." + patch_number="$(echo ${patch_number} | sed 's/^0*//g')" # Remove prefix "0" # Tagged Vim patch, check version.c: - is_missing="$(sed -n '/static int included_patches/,/}/p' "${NVIM_SOURCE_DIR}/src/nvim/version.c" | + is_missing="$(sed -n '/static const int included_patches/,/}/p' "${NVIM_SOURCE_DIR}/src/nvim/version.c" | grep -x -e "[[:space:]]*//[[:space:]]${patch_number} NA.*" -e "[[:space:]]*${patch_number}," >/dev/null && echo "false" || echo "true")" vim_commit="${vim_tag#v}" if (cd "${VIM_SOURCE_DIR}" && git --no-pager show --color=never --name-only "v${vim_commit}" 2>/dev/null) | grep -q ^runtime; then @@ -442,7 +461,7 @@ review_pr() { clean_files } -while getopts "hlp:g:r:s" opt; do +while getopts "hlp:P:g:r:s" opt; do case ${opt} in h) usage @@ -456,6 +475,10 @@ while getopts "hlp:g:r:s" opt; do stage_patch "${OPTARG}" exit 0 ;; + P) + stage_patch "${OPTARG}" TRY_APPLY + exit 0 + ;; g) get_vim_patch "${OPTARG}" exit 0 diff --git a/src/.asan-blacklist b/src/.asan-blacklist index 7636f8fa82..928d81bd5a 100644 --- a/src/.asan-blacklist +++ b/src/.asan-blacklist @@ -1,3 +1,3 @@ # multiqueue.h pointer arithmetic is not accepted by asan fun:multiqueue_node_data -fun:dictwatcher_node_data +fun:tv_dict_watcher_node_data diff --git a/src/clint.py b/src/clint.py index ce31822ada..e63175a69b 100755 --- a/src/clint.py +++ b/src/clint.py @@ -182,6 +182,7 @@ _ERROR_CATEGORIES = [ 'build/include_order', 'build/printf_format', 'build/storage_class', + 'build/useless_fattr', 'readability/alt_tokens', 'readability/bool', 'readability/braces', @@ -571,7 +572,8 @@ class _CppLintState(object): for category, count in self.errors_by_category.items(): sys.stderr.write('Category \'%s\' errors found: %d\n' % (category, count)) - sys.stderr.write('Total errors found: %d\n' % self.error_count) + if self.error_count: + sys.stderr.write('Total errors found: %d\n' % self.error_count) def SuppressErrorsFrom(self, fname): """Open file and read a list of suppressed errors from it""" @@ -1224,6 +1226,10 @@ def CheckForHeaderGuard(filename, lines, error): lines: An array of strings, each representing a line of the file. error: The function to call with any errors found. """ + if filename.endswith('.c.h') or FileInfo(filename).RelativePath() in set(( + 'func_attr.h', + )): + return cppvar = GetHeaderGuardCPPVariable(filename) @@ -2268,11 +2274,14 @@ def CheckSpacing(filename, clean_lines, linenum, nesting_state, error): # //!< Header comment # or they begin with multiple slashes followed by a space: # //////// Header comment + # or they are Vim {{{ fold markers match = (Search(r'[=/-]{4,}\s*$', line[commentend:]) or Search(r'^/$', line[commentend:]) or Search(r'^!< ', line[commentend:]) or Search(r'^/< ', line[commentend:]) or - Search(r'^/+ ', line[commentend:])) + Search(r'^/+ ', line[commentend:]) or + Search(r'^(?:\{{3}|\}{3})\d*(?: |$)', + line[commentend:])) if not match: error(filename, linenum, 'whitespace/comments', 4, 'Should have a space between // and comment') @@ -2520,6 +2529,9 @@ def CheckSpacing(filename, clean_lines, linenum, nesting_state, error): r'(?` 22. Vim inserts "word" at the beginning and returns to normal mode -Note that we have split user actions into sequences of inputs that change the -state of the editor. While there's no documentation about a "g command -mode" (step 16), internally it is implemented similarly to "operator-pending -mode". +Note that we split user actions into sequences of inputs that change the state +of the editor. While there's no documentation about a "g command mode" (step +16), internally it is implemented similarly to "operator-pending mode". -From this we can see that Vim has the behavior of a input-driven state -machine (more specifically, a pushdown automaton since it requires a stack for +From this we can see that Vim has the behavior of an input-driven state machine +(more specifically, a pushdown automaton since it requires a stack for transitioning back from states). Assuming each state has a callback responsible -for handling keys, this pseudocode (a python-like language) shows a good -representation of the main program loop: +for handling keys, this pseudocode represents the main program loop: ```py def state_enter(state_callback, data): @@ -126,12 +144,11 @@ def insert_state(data, key): return true ``` -While the actual code is much more complicated, the above gives an idea of how -Neovim is organized internally. Some states like the `g_command_state` or -`get_operator_count_state` do not have a dedicated `state_enter` callback, but -are implicitly embedded into other states (this will change later as we continue -the refactoring effort). To start reading the actual code, here's the -recommended order: +The above gives an idea of how Nvim is organized internally. Some states like +the `g_command_state` or `get_operator_count_state` do not have a dedicated +`state_enter` callback, but are implicitly embedded into other states (this +will change later as we continue the refactoring effort). To start reading the +actual code, here's the recommended order: 1. `state_enter()` function (state.c). This is the actual program loop, note that a `VimState` structure is used, which contains function pointers @@ -152,16 +169,17 @@ modes managed by the `state_enter` loop: - insert mode: `insert_{enter,check,execute}()`(`edit.c`) - terminal mode: `terminal_{enter,execute}()`(`terminal.c`) -### Async event support +Async event support +------------------- -One of the features Neovim added is the support for handling arbitrary +One of the features Nvim added is the support for handling arbitrary asynchronous events, which can include: -- msgpack-rpc requests +- RPC requests - job control callbacks -- timers (not implemented yet but the support code is already there) +- timers -Neovim implements this functionality by entering another event loop while +Nvim implements this functionality by entering another event loop while waiting for characters, so instead of: ```py @@ -171,7 +189,7 @@ def state_enter(state_callback, data): while state_callback(data, key) # invoke the callback for the current state ``` -Neovim program loop is more like: +Nvim program loop is more like: ```py def state_enter(state_callback, data): @@ -182,9 +200,9 @@ def state_enter(state_callback, data): where `event` is something the operating system delivers to us, including (but not limited to) user input. The `read_next_event()` part is internally -implemented by libuv, the platform layer used by Neovim. +implemented by libuv, the platform layer used by Nvim. -Since Neovim inherited its code from Vim, the states are not prepared to receive +Since Nvim inherited its code from Vim, the states are not prepared to receive "arbitrary events", so we use a special key to represent those (When a state receives an "arbitrary event", it normally doesn't do anything other update the screen). diff --git a/src/nvim/api/buffer.c b/src/nvim/api/buffer.c index b75a2c7211..4b6a88e5fa 100644 --- a/src/nvim/api/buffer.c +++ b/src/nvim/api/buffer.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + // Much of this code was adapted from 'if_py_both.h' from the original // vim source #include @@ -32,7 +35,7 @@ /// @param[out] err Error details, if any /// @return Line count Integer nvim_buf_line_count(Buffer buffer, Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { buf_T *buf = find_buffer_by_handle(buffer, err); @@ -62,7 +65,7 @@ String buffer_get_line(Buffer buffer, Integer index, Error *err) index = convert_index(index); Array slice = nvim_buf_get_lines(0, buffer, index, index+1, true, err); - if (!err->set && slice.size) { + if (!ERROR_SET(err) && slice.size) { rv = slice.items[0].data.string; } @@ -154,7 +157,7 @@ ArrayOf(String) nvim_buf_get_lines(uint64_t channel_id, Integer end, Boolean strict_indexing, Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { Array rv = ARRAY_DICT_INIT; buf_T *buf = find_buffer_by_handle(buffer, err); @@ -168,7 +171,7 @@ ArrayOf(String) nvim_buf_get_lines(uint64_t channel_id, end = normalize_index(buf, end, &oob); if (strict_indexing && oob) { - api_set_error(err, Validation, _("Index out of bounds")); + api_set_error(err, kErrorTypeValidation, "Index out of bounds"); return rv; } @@ -184,7 +187,7 @@ ArrayOf(String) nvim_buf_get_lines(uint64_t channel_id, int64_t lnum = start + (int64_t)i; if (lnum > LONG_MAX) { - api_set_error(err, Validation, _("Line index is too high")); + api_set_error(err, kErrorTypeValidation, "Line index is too high"); goto end; } @@ -192,7 +195,7 @@ ArrayOf(String) nvim_buf_get_lines(uint64_t channel_id, Object str = STRING_OBJ(cstr_to_string(bufstr)); // Vim represents NULs as NLs, but this may confuse clients. - if (channel_id != INTERNAL_CALL) { + if (channel_id != VIML_INTERNAL_CALL) { strchrsub(str.data.string.data, '\n', '\0'); } @@ -200,7 +203,7 @@ ArrayOf(String) nvim_buf_get_lines(uint64_t channel_id, } end: - if (err->set) { + if (ERROR_SET(err)) { for (size_t i = 0; i < rv.size; i++) { xfree(rv.items[i].data.string.data); } @@ -267,7 +270,7 @@ void nvim_buf_set_lines(uint64_t channel_id, Boolean strict_indexing, ArrayOf(String) replacement, // NOLINT Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { buf_T *buf = find_buffer_by_handle(buffer, err); @@ -280,54 +283,58 @@ void nvim_buf_set_lines(uint64_t channel_id, end = normalize_index(buf, end, &oob); if (strict_indexing && oob) { - api_set_error(err, Validation, _("Index out of bounds")); + api_set_error(err, kErrorTypeValidation, "Index out of bounds"); return; } if (start > end) { api_set_error(err, - Validation, - _("Argument \"start\" is higher than \"end\"")); + kErrorTypeValidation, + "Argument \"start\" is higher than \"end\""); return; } + for (size_t i = 0; i < replacement.size; i++) { + if (replacement.items[i].type != kObjectTypeString) { + api_set_error(err, + kErrorTypeValidation, + "All items in the replacement array must be strings"); + return; + } + // Disallow newlines in the middle of the line. + if (channel_id != VIML_INTERNAL_CALL) { + const String l = replacement.items[i].data.string; + if (memchr(l.data, NL, l.size)) { + api_set_error(err, kErrorTypeValidation, + "String cannot contain newlines"); + return; + } + } + } + win_T *save_curwin = NULL; tabpage_T *save_curtab = NULL; size_t new_len = replacement.size; size_t old_len = (size_t)(end - start); - ssize_t extra = 0; // lines added to text, can be negative + ptrdiff_t extra = 0; // lines added to text, can be negative char **lines = (new_len != 0) ? xcalloc(new_len, sizeof(char *)) : NULL; for (size_t i = 0; i < new_len; i++) { - if (replacement.items[i].type != kObjectTypeString) { - api_set_error(err, - Validation, - _("All items in the replacement array must be strings")); - goto end; - } + const String l = replacement.items[i].data.string; - String l = replacement.items[i].data.string; - - // Fill lines[i] with l's contents. Disallow newlines in the middle of a - // line and convert NULs to newlines to avoid truncation. - lines[i] = xmallocz(l.size); - for (size_t j = 0; j < l.size; j++) { - if (l.data[j] == '\n' && channel_id != INTERNAL_CALL) { - api_set_error(err, Exception, _("string cannot contain newlines")); - new_len = i + 1; - goto end; - } - lines[i][j] = (char) (l.data[j] == '\0' ? '\n' : l.data[j]); - } + // Fill lines[i] with l's contents. Convert NULs to newlines as required by + // NL-used-for-NUL. + lines[i] = xmemdupz(l.data, l.size); + memchrsub(lines[i], NUL, NL, l.size); } try_start(); - bufref_T save_curbuf = { NULL, 0 }; + bufref_T save_curbuf = { NULL, 0, 0 }; switch_to_win_for_buf(buf, &save_curwin, &save_curtab, &save_curbuf); if (u_save((linenr_T)(start - 1), (linenr_T)end) == FAIL) { - api_set_error(err, Exception, _("Failed to save undo information")); + api_set_error(err, kErrorTypeException, "Failed to save undo information"); goto end; } @@ -337,13 +344,13 @@ void nvim_buf_set_lines(uint64_t channel_id, size_t to_delete = (new_len < old_len) ? (size_t)(old_len - new_len) : 0; for (size_t i = 0; i < to_delete; i++) { if (ml_delete((linenr_T)start, false) == FAIL) { - api_set_error(err, Exception, _("Failed to delete line")); + api_set_error(err, kErrorTypeException, "Failed to delete line"); goto end; } } - if ((ssize_t)to_delete > 0) { - extra -= (ssize_t)to_delete; + if (to_delete > 0) { + extra -= (ptrdiff_t)to_delete; } // For as long as possible, replace the existing old_len with the @@ -354,12 +361,12 @@ void nvim_buf_set_lines(uint64_t channel_id, int64_t lnum = start + (int64_t)i; if (lnum > LONG_MAX) { - api_set_error(err, Validation, _("Index value is too high")); + api_set_error(err, kErrorTypeValidation, "Index value is too high"); goto end; } if (ml_replace((linenr_T)lnum, (char_u *)lines[i], false) == FAIL) { - api_set_error(err, Exception, _("Failed to replace line")); + api_set_error(err, kErrorTypeException, "Failed to replace line"); goto end; } // Mark lines that haven't been passed to the buffer as they need @@ -372,12 +379,12 @@ void nvim_buf_set_lines(uint64_t channel_id, int64_t lnum = start + (int64_t)i - 1; if (lnum > LONG_MAX) { - api_set_error(err, Validation, _("Index value is too high")); + api_set_error(err, kErrorTypeValidation, "Index value is too high"); goto end; } if (ml_append((linenr_T)lnum, (char_u *)lines[i], 0, false) == FAIL) { - api_set_error(err, Exception, _("Failed to insert line")); + api_set_error(err, kErrorTypeException, "Failed to insert line"); goto end; } @@ -392,13 +399,13 @@ void nvim_buf_set_lines(uint64_t channel_id, // Only adjust marks if we managed to switch to a window that holds // the buffer, otherwise line numbers will be invalid. if (save_curbuf.br_buf == NULL) { - mark_adjust((linenr_T)start, (linenr_T)(end - 1), MAXLNUM, extra); + mark_adjust((linenr_T)start, (linenr_T)(end - 1), MAXLNUM, extra, false); } - changed_lines((linenr_T)start, 0, (linenr_T)end, extra); + changed_lines((linenr_T)start, 0, (linenr_T)end, (long)extra); if (save_curbuf.br_buf == NULL) { - fix_cursor((linenr_T)start, (linenr_T)end, extra); + fix_cursor((linenr_T)start, (linenr_T)end, (linenr_T)extra); } end: @@ -418,7 +425,7 @@ end: /// @param[out] err Error details, if any /// @return Variable value Object nvim_buf_get_var(Buffer buffer, String name, Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { buf_T *buf = find_buffer_by_handle(buffer, err); @@ -432,10 +439,11 @@ Object nvim_buf_get_var(Buffer buffer, String name, Error *err) /// Gets a changed tick of a buffer /// /// @param[in] buffer Buffer handle. +/// @param[out] err Error details, if any /// /// @return `b:changedtick` value. Integer nvim_buf_get_changedtick(Buffer buffer, Error *err) - FUNC_API_SINCE(2) + FUNC_API_SINCE(2) { const buf_T *const buf = find_buffer_by_handle(buffer, err); @@ -446,6 +454,26 @@ Integer nvim_buf_get_changedtick(Buffer buffer, Error *err) return buf->b_changedtick; } +/// Gets a list of dictionaries describing buffer-local mappings. +/// The "buffer" key in the returned dictionary reflects the buffer +/// handle where the mapping is present. +/// +/// @param mode Mode short-name ("n", "i", "v", ...) +/// @param buffer Buffer handle +/// @param[out] err Error details, if any +/// @returns Array of maparg()-like dictionaries describing mappings +ArrayOf(Dictionary) nvim_buf_get_keymap(Buffer buffer, String mode, Error *err) + FUNC_API_SINCE(3) +{ + buf_T *buf = find_buffer_by_handle(buffer, err); + + if (!buf) { + return (Array)ARRAY_DICT_INIT; + } + + return keymap_array(mode, buf); +} + /// Sets a buffer-scoped (b:) variable /// /// @param buffer Buffer handle @@ -453,7 +481,7 @@ Integer nvim_buf_get_changedtick(Buffer buffer, Error *err) /// @param value Variable value /// @param[out] err Error details, if any void nvim_buf_set_var(Buffer buffer, String name, Object value, Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { buf_T *buf = find_buffer_by_handle(buffer, err); @@ -470,7 +498,7 @@ void nvim_buf_set_var(Buffer buffer, String name, Object value, Error *err) /// @param name Variable name /// @param[out] err Error details, if any void nvim_buf_del_var(Buffer buffer, String name, Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { buf_T *buf = find_buffer_by_handle(buffer, err); @@ -531,7 +559,7 @@ Object buffer_del_var(Buffer buffer, String name, Error *err) /// @param[out] err Error details, if any /// @return Option value Object nvim_buf_get_option(Buffer buffer, String name, Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { buf_T *buf = find_buffer_by_handle(buffer, err); @@ -550,7 +578,7 @@ Object nvim_buf_get_option(Buffer buffer, String name, Error *err) /// @param value Option value /// @param[out] err Error details, if any void nvim_buf_set_option(Buffer buffer, String name, Object value, Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { buf_T *buf = find_buffer_by_handle(buffer, err); @@ -563,11 +591,15 @@ void nvim_buf_set_option(Buffer buffer, String name, Object value, Error *err) /// Gets the buffer number /// +/// @deprecated The buffer number now is equal to the object id, +/// so there is no need to use this function. +/// /// @param buffer Buffer handle /// @param[out] err Error details, if any /// @return Buffer number Integer nvim_buf_get_number(Buffer buffer, Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) + FUNC_API_DEPRECATED_SINCE(2) { Integer rv = 0; buf_T *buf = find_buffer_by_handle(buffer, err); @@ -585,7 +617,7 @@ Integer nvim_buf_get_number(Buffer buffer, Error *err) /// @param[out] err Error details, if any /// @return Buffer name String nvim_buf_get_name(Buffer buffer, Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { String rv = STRING_INIT; buf_T *buf = find_buffer_by_handle(buffer, err); @@ -603,7 +635,7 @@ String nvim_buf_get_name(Buffer buffer, Error *err) /// @param name Buffer name /// @param[out] err Error details, if any void nvim_buf_set_name(Buffer buffer, String name, Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { buf_T *buf = find_buffer_by_handle(buffer, err); @@ -624,7 +656,7 @@ void nvim_buf_set_name(Buffer buffer, String name, Error *err) } if (ren_ret == FAIL) { - api_set_error(err, Exception, _("Failed to rename buffer")); + api_set_error(err, kErrorTypeException, "Failed to rename buffer"); } } @@ -633,10 +665,12 @@ void nvim_buf_set_name(Buffer buffer, String name, Error *err) /// @param buffer Buffer handle /// @return true if the buffer is valid, false otherwise Boolean nvim_buf_is_valid(Buffer buffer) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { Error stub = ERROR_INIT; - return find_buffer_by_handle(buffer, &stub) != NULL; + Boolean ret = find_buffer_by_handle(buffer, &stub) != NULL; + api_clear_error(&stub); + return ret; } /// Inserts a sequence of lines to a buffer at a certain index @@ -665,7 +699,7 @@ void buffer_insert(Buffer buffer, /// @param[out] err Error details, if any /// @return (row, col) tuple ArrayOf(Integer, 2) nvim_buf_get_mark(Buffer buffer, String name, Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { Array rv = ARRAY_DICT_INIT; buf_T *buf = find_buffer_by_handle(buffer, err); @@ -675,7 +709,8 @@ ArrayOf(Integer, 2) nvim_buf_get_mark(Buffer buffer, String name, Error *err) } if (name.size != 1) { - api_set_error(err, Validation, _("Mark name must be a single character")); + api_set_error(err, kErrorTypeValidation, + "Mark name must be a single character"); return rv; } @@ -693,7 +728,7 @@ ArrayOf(Integer, 2) nvim_buf_get_mark(Buffer buffer, String name, Error *err) } if (posp == NULL) { - api_set_error(err, Validation, _("Invalid mark name")); + api_set_error(err, kErrorTypeValidation, "Invalid mark name"); return rv; } @@ -705,29 +740,29 @@ ArrayOf(Integer, 2) nvim_buf_get_mark(Buffer buffer, String name, Error *err) /// Adds a highlight to buffer. /// -/// This can be used for plugins which dynamically generate highlights to a -/// buffer (like a semantic highlighter or linter). The function adds a single +/// Useful for plugins that dynamically generate highlights to a buffer +/// (like a semantic highlighter or linter). The function adds a single /// highlight to a buffer. Unlike matchaddpos() highlights follow changes to /// line numbering (as lines are inserted/removed above the highlighted line), /// like signs and marks do. /// -/// "src_id" is useful for batch deletion/updating of a set of highlights. When -/// called with src_id = 0, an unique source id is generated and returned. -/// Succesive calls can pass in it as "src_id" to add new highlights to the same -/// source group. All highlights in the same group can then be cleared with -/// nvim_buf_clear_highlight. If the highlight never will be manually deleted -/// pass in -1 for "src_id". +/// `src_id` is useful for batch deletion/updating of a set of highlights. When +/// called with `src_id = 0`, an unique source id is generated and returned. +/// Successive calls can pass that `src_id` to associate new highlights with +/// the same source group. All highlights in the same group can be cleared +/// with `nvim_buf_clear_highlight`. If the highlight never will be manually +/// deleted, pass `src_id = -1`. /// -/// If "hl_group" is the empty string no highlight is added, but a new src_id +/// If `hl_group` is the empty string no highlight is added, but a new `src_id` /// is still returned. This is useful for an external plugin to synchrounously -/// request an unique src_id at initialization, and later asynchronously add and -/// clear highlights in response to buffer changes. +/// request an unique `src_id` at initialization, and later asynchronously add +/// and clear highlights in response to buffer changes. /// /// @param buffer Buffer handle /// @param src_id Source group to use or 0 to use a new group, /// or -1 for ungrouped highlight /// @param hl_group Name of the highlight group to use -/// @param line Line to highlight +/// @param line Line to highlight (zero-indexed) /// @param col_start Start of range of columns to highlight /// @param col_end End of range of columns to highlight, /// or -1 to highlight to end of line @@ -740,7 +775,7 @@ Integer nvim_buf_add_highlight(Buffer buffer, Integer col_start, Integer col_end, Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { buf_T *buf = find_buffer_by_handle(buffer, err); if (!buf) { @@ -748,18 +783,22 @@ Integer nvim_buf_add_highlight(Buffer buffer, } if (line < 0 || line >= MAXLNUM) { - api_set_error(err, Validation, _("Line number outside range")); + api_set_error(err, kErrorTypeValidation, "Line number outside range"); return 0; } if (col_start < 0 || col_start > MAXCOL) { - api_set_error(err, Validation, _("Column value outside range")); + api_set_error(err, kErrorTypeValidation, "Column value outside range"); return 0; } if (col_end < 0 || col_end > MAXCOL) { col_end = MAXCOL; } - int hlg_id = syn_name2id((char_u *)(hl_group.data ? hl_group.data : "")); + int hlg_id = 0; + if (hl_group.size > 0) { + hlg_id = syn_check_group((char_u *)hl_group.data, (int)hl_group.size); + } + src_id = bufhl_add_hl(buf, (int)src_id, hlg_id, (linenr_T)line+1, (colnr_T)col_start+1, (colnr_T)col_end); return src_id; @@ -781,7 +820,7 @@ void nvim_buf_clear_highlight(Buffer buffer, Integer line_start, Integer line_end, Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { buf_T *buf = find_buffer_by_handle(buffer, err); if (!buf) { @@ -789,7 +828,7 @@ void nvim_buf_clear_highlight(Buffer buffer, } if (line_start < 0 || line_start >= MAXLNUM) { - api_set_error(err, Validation, _("Line number outside range")); + api_set_error(err, kErrorTypeValidation, "Line number outside range"); return; } if (line_end < 0 || line_end > MAXLNUM) { diff --git a/src/nvim/api/private/defs.h b/src/nvim/api/private/defs.h index 223aab09dc..2144c80d6a 100644 --- a/src/nvim/api/private/defs.h +++ b/src/nvim/api/private/defs.h @@ -5,12 +5,16 @@ #include #include +#include "nvim/func_attr.h" + #define ARRAY_DICT_INIT {.size = 0, .capacity = 0, .items = NULL} #define STRING_INIT {.data = NULL, .size = 0} #define OBJECT_INIT { .type = kObjectTypeNil } -#define ERROR_INIT { .set = false } +#define ERROR_INIT { .type = kErrorTypeNone, .msg = NULL } #define REMOTE_TYPE(type) typedef handle_T type +#define ERROR_SET(e) ((e)->type != kErrorTypeNone) + #ifdef INCLUDE_GENERATED_DECLARATIONS # define ArrayOf(...) Array # define DictionaryOf(...) Dictionary @@ -20,6 +24,7 @@ typedef int handle_T; // Basic types typedef enum { + kErrorTypeNone = -1, kErrorTypeException, kErrorTypeValidation } ErrorType; @@ -33,13 +38,31 @@ typedef enum { /// Used as the message ID of notifications. #define NO_RESPONSE UINT64_MAX -/// Used as channel_id when the call is local. -#define INTERNAL_CALL UINT64_MAX +/// Mask for all internal calls +#define INTERNAL_CALL_MASK (((uint64_t)1) << (sizeof(uint64_t) * 8 - 1)) + +/// Internal call from VimL code +#define VIML_INTERNAL_CALL INTERNAL_CALL_MASK + +/// Internal call from lua code +#define LUA_INTERNAL_CALL (VIML_INTERNAL_CALL + 1) + +static inline bool is_internal_call(uint64_t channel_id) + REAL_FATTR_ALWAYS_INLINE REAL_FATTR_CONST; + +/// Check whether call is internal +/// +/// @param[in] channel_id Channel id. +/// +/// @return true if channel_id refers to internal channel. +static inline bool is_internal_call(const uint64_t channel_id) +{ + return !!(channel_id & INTERNAL_CALL_MASK); +} typedef struct { ErrorType type; - char msg[1024]; - bool set; + char *msg; } Error; typedef bool Boolean; @@ -76,16 +99,17 @@ typedef struct { } Dictionary; typedef enum { - kObjectTypeBuffer, - kObjectTypeWindow, - kObjectTypeTabpage, - kObjectTypeNil, + kObjectTypeNil = 0, kObjectTypeBoolean, kObjectTypeInteger, kObjectTypeFloat, kObjectTypeString, kObjectTypeArray, kObjectTypeDictionary, + // EXT types, cannot be split or reordered, see #EXT_OBJECT_TYPE_SHIFT + kObjectTypeBuffer, + kObjectTypeWindow, + kObjectTypeTabpage, } ObjectType; struct object { diff --git a/src/nvim/api/private/dispatch.c b/src/nvim/api/private/dispatch.c index 9b3bcc380a..f8eebcdb10 100644 --- a/src/nvim/api/private/dispatch.c +++ b/src/nvim/api/private/dispatch.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include #include diff --git a/src/nvim/api/private/handle.c b/src/nvim/api/private/handle.c index acb0fb332a..eb96192af2 100644 --- a/src/nvim/api/private/handle.c +++ b/src/nvim/api/private/handle.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include diff --git a/src/nvim/api/private/helpers.c b/src/nvim/api/private/helpers.c index 7efa086af2..629873998e 100644 --- a/src/nvim/api/private/helpers.c +++ b/src/nvim/api/private/helpers.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include #include @@ -9,17 +12,20 @@ #include "nvim/api/private/handle.h" #include "nvim/msgpack_rpc/helpers.h" #include "nvim/ascii.h" +#include "nvim/assert.h" #include "nvim/vim.h" #include "nvim/buffer.h" #include "nvim/window.h" #include "nvim/memory.h" #include "nvim/eval.h" +#include "nvim/eval/typval.h" #include "nvim/map_defs.h" #include "nvim/map.h" #include "nvim/option.h" #include "nvim/option_defs.h" #include "nvim/version.h" #include "nvim/lib/kvec.h" +#include "nvim/getchar.h" /// Helper structure for vim_to_object typedef struct { @@ -29,9 +35,75 @@ typedef struct { #ifdef INCLUDE_GENERATED_DECLARATIONS # include "api/private/helpers.c.generated.h" # include "api/private/funcs_metadata.generated.h" +# include "api/private/ui_events_metadata.generated.h" #endif +/// Start block that may cause VimL exceptions while evaluating another code +/// +/// Used when caller is supposed to be operating when other VimL code is being +/// processed and that “other VimL code” must not be affected. +/// +/// @param[out] tstate Location where try state should be saved. +void try_enter(TryState *const tstate) +{ + *tstate = (TryState) { + .current_exception = current_exception, + .msg_list = (const struct msglist *const *)msg_list, + .private_msg_list = NULL, + .trylevel = trylevel, + .got_int = got_int, + .did_throw = did_throw, + .need_rethrow = need_rethrow, + .did_emsg = did_emsg, + }; + msg_list = &tstate->private_msg_list; + current_exception = NULL; + trylevel = 1; + got_int = false; + did_throw = false; + need_rethrow = false; + did_emsg = false; +} + +/// End try block, set the error message if any and restore previous state +/// +/// @warning Return is consistent with most functions (false on error), not with +/// try_end (true on error). +/// +/// @param[in] tstate Previous state to restore. +/// @param[out] err Location where error should be saved. +/// +/// @return false if error occurred, true otherwise. +bool try_leave(const TryState *const tstate, Error *const err) + FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT +{ + const bool ret = !try_end(err); + assert(trylevel == 0); + assert(!need_rethrow); + assert(!got_int); + assert(!did_throw); + assert(!did_emsg); + assert(msg_list == &tstate->private_msg_list); + assert(*msg_list == NULL); + assert(current_exception == NULL); + msg_list = (struct msglist **)tstate->msg_list; + current_exception = tstate->current_exception; + trylevel = tstate->trylevel; + got_int = tstate->got_int; + did_throw = tstate->did_throw; + need_rethrow = tstate->need_rethrow; + did_emsg = tstate->did_emsg; + return ret; +} + /// Start block that may cause vimscript exceptions +/// +/// Each try_start() call should be mirrored by try_end() call. +/// +/// To be used as a replacement of `:try … catch … endtry` in C code, in cases +/// when error flag could not already be set. If there may be pending error +/// state at the time try_start() is executed which needs to be preserved, +/// try_enter()/try_leave() pair should be used instead. void try_start(void) { ++trylevel; @@ -44,7 +116,9 @@ void try_start(void) /// @return true if an error occurred bool try_end(Error *err) { - --trylevel; + // Note: all globals manipulated here should be saved/restored in + // try_enter/try_leave. + trylevel--; // Without this it stops processing all subsequent VimL commands and // generates strange error messages if I e.g. try calling Test() in a @@ -57,7 +131,7 @@ bool try_end(Error *err) discard_current_exception(); } - api_set_error(err, Exception, _("Keyboard interrupt")); + api_set_error(err, kErrorTypeException, "Keyboard interrupt"); got_int = false; } else if (msg_list != NULL && *msg_list != NULL) { int should_free; @@ -65,19 +139,18 @@ bool try_end(Error *err) ET_ERROR, NULL, &should_free); - xstrlcpy(err->msg, msg, sizeof(err->msg)); - err->set = true; + api_set_error(err, kErrorTypeException, "%s", msg); free_global_msglist(); if (should_free) { xfree(msg); } } else if (did_throw) { - api_set_error(err, Exception, "%s", current_exception->value); + api_set_error(err, kErrorTypeException, "%s", current_exception->value); discard_current_exception(); } - return err->set; + return ERROR_SET(err); } /// Recursively expands a vimscript value in a dict @@ -87,14 +160,13 @@ bool try_end(Error *err) /// @param[out] err Details of an error that may have occurred Object dict_get_value(dict_T *dict, String key, Error *err) { - hashitem_T *hi = hash_find(&dict->dv_hashtab, (uint8_t *) key.data); + dictitem_T *const di = tv_dict_find(dict, key.data, (ptrdiff_t)key.size); - if (HASHITEM_EMPTY(hi)) { - api_set_error(err, Validation, _("Key not found")); - return (Object) OBJECT_INIT; + if (di == NULL) { + api_set_error(err, kErrorTypeValidation, "Key '%s' not found", key.data); + return (Object)OBJECT_INIT; } - dictitem_T *di = dict_lookup(hi); return vim_to_object(&di->di_tv); } @@ -115,31 +187,32 @@ Object dict_set_var(dict_T *dict, String key, Object value, bool del, Object rv = OBJECT_INIT; if (dict->dv_lock) { - api_set_error(err, Exception, _("Dictionary is locked")); + api_set_error(err, kErrorTypeException, "Dictionary is locked"); return rv; } if (key.size == 0) { - api_set_error(err, Validation, _("Empty variable names aren't allowed")); + api_set_error(err, kErrorTypeValidation, + "Empty variable names aren't allowed"); return rv; } if (key.size > INT_MAX) { - api_set_error(err, Validation, _("Key length is too high")); + api_set_error(err, kErrorTypeValidation, "Key length is too high"); return rv; } - dictitem_T *di = dict_find(dict, (char_u *)key.data, (int)key.size); + dictitem_T *di = tv_dict_find(dict, key.data, (ptrdiff_t)key.size); if (di != NULL) { if (di->di_flags & DI_FLAGS_RO) { - api_set_error(err, Exception, _("Key is read-only: %s"), key.data); + api_set_error(err, kErrorTypeException, "Key is read-only: %s", key.data); return rv; } else if (di->di_flags & DI_FLAGS_FIX) { - api_set_error(err, Exception, _("Key is fixed: %s"), key.data); + api_set_error(err, kErrorTypeException, "Key is fixed: %s", key.data); return rv; } else if (di->di_flags & DI_FLAGS_LOCK) { - api_set_error(err, Exception, _("Key is locked: %s"), key.data); + api_set_error(err, kErrorTypeException, "Key is locked: %s", key.data); return rv; } } @@ -148,16 +221,15 @@ Object dict_set_var(dict_T *dict, String key, Object value, bool del, // Delete the key if (di == NULL) { // Doesn't exist, fail - api_set_error(err, Validation, _("Key \"%s\" doesn't exist"), key.data); + api_set_error(err, kErrorTypeValidation, "Key does not exist: %s", + key.data); } else { // Return the old value if (retval) { rv = vim_to_object(&di->di_tv); } // Delete the entry - hashitem_T *hi = hash_find(&dict->dv_hashtab, di->di_key); - hash_remove(&dict->dv_hashtab, hi); - dictitem_free(di); + tv_dict_item_remove(dict, di); } } else { // Update the key @@ -170,20 +242,20 @@ Object dict_set_var(dict_T *dict, String key, Object value, bool del, if (di == NULL) { // Need to create an entry - di = dictitem_alloc((uint8_t *) key.data); - dict_add(dict, di); + di = tv_dict_item_alloc_len(key.data, key.size); + tv_dict_add(dict, di); } else { // Return the old value if (retval) { rv = vim_to_object(&di->di_tv); } - clear_tv(&di->di_tv); + tv_clear(&di->di_tv); } // Update the value - copy_tv(&tv, &di->di_tv); + tv_copy(&tv, &di->di_tv); // Clear the temporary variable - clear_tv(&tv); + tv_clear(&tv); } return rv; @@ -202,7 +274,7 @@ Object get_option_from(void *from, int type, String name, Error *err) Object rv = OBJECT_INIT; if (name.size == 0) { - api_set_error(err, Validation, _("Empty option name")); + api_set_error(err, kErrorTypeValidation, "Empty option name"); return rv; } @@ -214,8 +286,8 @@ Object get_option_from(void *from, int type, String name, Error *err) if (!flags) { api_set_error(err, - Validation, - _("Invalid option name \"%s\""), + kErrorTypeValidation, + "Invalid option name \"%s\"", name.data); return rv; } @@ -233,14 +305,14 @@ Object get_option_from(void *from, int type, String name, Error *err) rv.data.string.size = strlen(stringval); } else { api_set_error(err, - Exception, - _("Unable to get value for option \"%s\""), + kErrorTypeException, + "Unable to get value for option \"%s\"", name.data); } } else { api_set_error(err, - Exception, - _("Unknown type for option \"%s\""), + kErrorTypeException, + "Unknown type for option \"%s\"", name.data); } @@ -257,7 +329,7 @@ Object get_option_from(void *from, int type, String name, Error *err) void set_option_to(void *to, int type, String name, Object value, Error *err) { if (name.size == 0) { - api_set_error(err, Validation, _("Empty option name")); + api_set_error(err, kErrorTypeValidation, "Empty option name"); return; } @@ -265,8 +337,8 @@ void set_option_to(void *to, int type, String name, Object value, Error *err) if (flags == 0) { api_set_error(err, - Validation, - _("Invalid option name \"%s\""), + kErrorTypeValidation, + "Invalid option name \"%s\"", name.data); return; } @@ -274,15 +346,15 @@ void set_option_to(void *to, int type, String name, Object value, Error *err) if (value.type == kObjectTypeNil) { if (type == SREQ_GLOBAL) { api_set_error(err, - Exception, - _("Unable to unset option \"%s\""), + kErrorTypeException, + "Unable to unset option \"%s\"", name.data); return; } else if (!(flags & SOPT_GLOBAL)) { api_set_error(err, - Exception, - _("Cannot unset option \"%s\" " - "because it doesn't have a global value"), + kErrorTypeException, + "Cannot unset option \"%s\" " + "because it doesn't have a global value", name.data); return; } else { @@ -291,13 +363,13 @@ void set_option_to(void *to, int type, String name, Object value, Error *err) } } - int opt_flags = (type ? OPT_LOCAL : OPT_GLOBAL); + int opt_flags = (type == SREQ_GLOBAL) ? OPT_GLOBAL : OPT_LOCAL; if (flags & SOPT_BOOL) { if (value.type != kObjectTypeBoolean) { api_set_error(err, - Validation, - _("Option \"%s\" requires a boolean value"), + kErrorTypeValidation, + "Option \"%s\" requires a boolean value", name.data); return; } @@ -307,16 +379,16 @@ void set_option_to(void *to, int type, String name, Object value, Error *err) } else if (flags & SOPT_NUM) { if (value.type != kObjectTypeInteger) { api_set_error(err, - Validation, - _("Option \"%s\" requires an integer value"), + kErrorTypeValidation, + "Option \"%s\" requires an integer value", name.data); return; } if (value.data.integer > INT_MAX || value.data.integer < INT_MIN) { api_set_error(err, - Validation, - _("Value for option \"%s\" is outside range"), + kErrorTypeValidation, + "Value for option \"%s\" is outside range", name.data); return; } @@ -326,8 +398,8 @@ void set_option_to(void *to, int type, String name, Object value, Error *err) } else { if (value.type != kObjectTypeString) { api_set_error(err, - Validation, - _("Option \"%s\" requires a string value"), + kErrorTypeValidation, + "Option \"%s\" requires a string value", name.data); return; } @@ -351,7 +423,7 @@ void set_option_to(void *to, int type, String name, Object value, Error *err) #define TYPVAL_ENCODE_CONV_UNSIGNED_NUMBER TYPVAL_ENCODE_CONV_NUMBER #define TYPVAL_ENCODE_CONV_FLOAT(tv, flt) \ - kv_push(edata->stack, FLOATING_OBJ((Float)(flt))) + kv_push(edata->stack, FLOAT_OBJ((Float)(flt))) #define TYPVAL_ENCODE_CONV_STRING(tv, str, len) \ do { \ @@ -560,13 +632,13 @@ buf_T *find_buffer_by_handle(Buffer buffer, Error *err) buf_T *rv = handle_get_buffer(buffer); if (!rv) { - api_set_error(err, Validation, _("Invalid buffer id")); + api_set_error(err, kErrorTypeValidation, "Invalid buffer id"); } return rv; } -win_T * find_window_by_handle(Window window, Error *err) +win_T *find_window_by_handle(Window window, Error *err) { if (window == 0) { return curwin; @@ -575,13 +647,13 @@ win_T * find_window_by_handle(Window window, Error *err) win_T *rv = handle_get_window(window); if (!rv) { - api_set_error(err, Validation, _("Invalid window id")); + api_set_error(err, kErrorTypeValidation, "Invalid window id"); } return rv; } -tabpage_T * find_tab_by_handle(Tabpage tabpage, Error *err) +tabpage_T *find_tab_by_handle(Tabpage tabpage, Error *err) { if (tabpage == 0) { return curtab; @@ -590,12 +662,28 @@ tabpage_T * find_tab_by_handle(Tabpage tabpage, Error *err) tabpage_T *rv = handle_get_tabpage(tabpage); if (!rv) { - api_set_error(err, Validation, _("Invalid tabpage id")); + api_set_error(err, kErrorTypeValidation, "Invalid tabpage id"); } return rv; } +/// Allocates a String consisting of a single char. Does not support multibyte +/// characters. The resulting string is also NUL-terminated, to facilitate +/// interoperating with code using C strings. +/// +/// @param char the char to convert +/// @return the resulting String, if the input char was NUL, an +/// empty String is returned +String cchar_to_string(char c) +{ + char buf[] = { c, NUL }; + return (String) { + .data = xmemdupz(buf, 1), + .size = (c != NUL) ? 1 : 0 + }; +} + /// Copies a C string into a String (binary safe string, characters + length). /// The resulting string is also NUL-terminated, to facilitate interoperating /// with code using C strings. @@ -616,6 +704,23 @@ String cstr_to_string(const char *str) }; } +/// Copies buffer to an allocated String. +/// The resulting string is also NUL-terminated, to facilitate interoperating +/// with code using C strings. +/// +/// @param buf the buffer to copy +/// @param size length of the buffer +/// @return the resulting String, if the input string was NULL, an +/// empty String is returned +String cbuf_to_string(const char *buf, size_t size) + FUNC_ATTR_NONNULL_ALL +{ + return (String) { + .data = xmemdupz(buf, size), + .size = size + }; +} + /// Creates a String using the given C string. Unlike /// cstr_to_string this function DOES NOT copy the C string. /// @@ -627,7 +732,7 @@ String cstr_as_string(char *str) FUNC_ATTR_PURE if (str == NULL) { return (String) STRING_INIT; } - return (String) {.data = str, .size = strlen(str)}; + return (String) { .data = str, .size = strlen(str) }; } /// Converts from type Object to a VimL value. @@ -656,12 +761,8 @@ bool object_to_vim(Object obj, typval_T *tv, Error *err) case kObjectTypeWindow: case kObjectTypeTabpage: case kObjectTypeInteger: - if (obj.data.integer > VARNUMBER_MAX - || obj.data.integer < VARNUMBER_MIN) { - api_set_error(err, Validation, _("Integer value outside range")); - return false; - } - + STATIC_ASSERT(sizeof(obj.data.integer) <= sizeof(varnumber_T), + "Integer size must be <= VimL number size"); tv->v_type = VAR_NUMBER; tv->vval.v_number = (varnumber_T)obj.data.integer; break; @@ -682,20 +783,20 @@ bool object_to_vim(Object obj, typval_T *tv, Error *err) break; case kObjectTypeArray: { - list_T *list = list_alloc(); + list_T *const list = tv_list_alloc(); for (uint32_t i = 0; i < obj.data.array.size; i++) { Object item = obj.data.array.items[i]; - listitem_T *li = listitem_alloc(); + listitem_T *li = tv_list_item_alloc(); if (!object_to_vim(item, &li->li_tv, err)) { // cleanup - listitem_free(li); - list_free(list); + tv_list_item_free(li); + tv_list_free(list); return false; } - list_append(list, li); + tv_list_append(list, li); } list->lv_refcount++; @@ -705,30 +806,30 @@ bool object_to_vim(Object obj, typval_T *tv, Error *err) } case kObjectTypeDictionary: { - dict_T *dict = dict_alloc(); + dict_T *const dict = tv_dict_alloc(); for (uint32_t i = 0; i < obj.data.dictionary.size; i++) { KeyValuePair item = obj.data.dictionary.items[i]; String key = item.key; if (key.size == 0) { - api_set_error(err, Validation, - _("Empty dictionary keys aren't allowed")); + api_set_error(err, kErrorTypeValidation, + "Empty dictionary keys aren't allowed"); // cleanup - dict_free(dict); + tv_dict_free(dict); return false; } - dictitem_T *di = dictitem_alloc((uint8_t *)key.data); + dictitem_T *const di = tv_dict_item_alloc(key.data); if (!object_to_vim(item.value, &di->di_tv, err)) { // cleanup - dictitem_free(di); - dict_free(dict); + tv_dict_item_free(di); + tv_dict_free(dict); return false; } - dict_add(dict, di); + tv_dict_add(dict, di); } dict->dv_refcount++; @@ -800,6 +901,17 @@ void api_free_dictionary(Dictionary value) xfree(value.items); } +void api_clear_error(Error *value) + FUNC_ATTR_NONNULL_ALL +{ + if (!ERROR_SET(value)) { + return; + } + xfree(value->msg); + value->msg = NULL; + value->type = kErrorTypeNone; +} + Dictionary api_metadata(void) { static Dictionary metadata = ARRAY_DICT_INIT; @@ -807,6 +919,7 @@ Dictionary api_metadata(void) if (!metadata.size) { PUT(metadata, "version", DICTIONARY_OBJ(version_dict())); init_function_metadata(&metadata); + init_ui_event_metadata(&metadata); init_error_type_metadata(&metadata); init_type_metadata(&metadata); } @@ -830,6 +943,22 @@ static void init_function_metadata(Dictionary *metadata) PUT(*metadata, "functions", functions); } +static void init_ui_event_metadata(Dictionary *metadata) +{ + msgpack_unpacked unpacked; + msgpack_unpacked_init(&unpacked); + if (msgpack_unpack_next(&unpacked, + (const char *)ui_events_metadata, + sizeof(ui_events_metadata), + NULL) != MSGPACK_UNPACK_SUCCESS) { + abort(); + } + Object ui_events; + msgpack_rpc_to_object(&unpacked.data, &ui_events); + msgpack_unpacked_destroy(&unpacked); + PUT(*metadata, "ui_events", ui_events); +} + static void init_error_type_metadata(Dictionary *metadata) { Dictionary types = ARRAY_DICT_INIT; @@ -851,15 +980,18 @@ static void init_type_metadata(Dictionary *metadata) Dictionary types = ARRAY_DICT_INIT; Dictionary buffer_metadata = ARRAY_DICT_INIT; - PUT(buffer_metadata, "id", INTEGER_OBJ(kObjectTypeBuffer)); + PUT(buffer_metadata, "id", + INTEGER_OBJ(kObjectTypeBuffer - EXT_OBJECT_TYPE_SHIFT)); PUT(buffer_metadata, "prefix", STRING_OBJ(cstr_to_string("nvim_buf_"))); Dictionary window_metadata = ARRAY_DICT_INIT; - PUT(window_metadata, "id", INTEGER_OBJ(kObjectTypeWindow)); + PUT(window_metadata, "id", + INTEGER_OBJ(kObjectTypeWindow - EXT_OBJECT_TYPE_SHIFT)); PUT(window_metadata, "prefix", STRING_OBJ(cstr_to_string("nvim_win_"))); Dictionary tabpage_metadata = ARRAY_DICT_INIT; - PUT(tabpage_metadata, "id", INTEGER_OBJ(kObjectTypeTabpage)); + PUT(tabpage_metadata, "id", + INTEGER_OBJ(kObjectTypeTabpage - EXT_OBJECT_TYPE_SHIFT)); PUT(tabpage_metadata, "prefix", STRING_OBJ(cstr_to_string("nvim_tabpage_"))); PUT(types, "Buffer", DICTIONARY_OBJ(buffer_metadata)); @@ -869,6 +1001,24 @@ static void init_type_metadata(Dictionary *metadata) PUT(*metadata, "types", DICTIONARY_OBJ(types)); } +String copy_string(String str) +{ + if (str.data != NULL) { + return (String){ .data = xmemdupz(str.data, str.size), .size = str.size }; + } else { + return (String)STRING_INIT; + } +} + +Array copy_array(Array array) +{ + Array rv = ARRAY_DICT_INIT; + for (size_t i = 0; i < array.size; i++) { + ADD(rv, copy_object(array.items[i])); + } + return rv; +} + /// Creates a deep clone of an object Object copy_object(Object obj) { @@ -880,15 +1030,10 @@ Object copy_object(Object obj) return obj; case kObjectTypeString: - return STRING_OBJ(cstr_to_string(obj.data.string.data)); + return STRING_OBJ(copy_string(obj.data.string)); - case kObjectTypeArray: { - Array rv = ARRAY_DICT_INIT; - for (size_t i = 0; i < obj.data.array.size; i++) { - ADD(rv, copy_object(obj.data.array.items[i])); - } - return ARRAY_OBJ(rv); - } + case kObjectTypeArray: + return ARRAY_OBJ(copy_array(obj.data.array)); case kObjectTypeDictionary: { Dictionary rv = ARRAY_DICT_INIT; @@ -913,7 +1058,7 @@ static void set_option_value_for(char *key, { win_T *save_curwin = NULL; tabpage_T *save_curtab = NULL; - bufref_T save_curbuf = { NULL, 0 }; + bufref_T save_curbuf = { NULL, 0, 0 }; try_start(); switch (opt_type) @@ -926,8 +1071,8 @@ static void set_option_value_for(char *key, return; } api_set_error(err, - Exception, - _("Problem while switching windows")); + kErrorTypeException, + "Problem while switching windows"); return; } set_option_value_err(key, numval, stringval, opt_flags, err); @@ -943,7 +1088,7 @@ static void set_option_value_for(char *key, break; } - if (err->set) { + if (ERROR_SET(err)) { return; } @@ -959,15 +1104,69 @@ static void set_option_value_err(char *key, { char *errmsg; - if ((errmsg = (char *)set_option_value((uint8_t *)key, - numval, - (uint8_t *)stringval, - opt_flags))) - { + if ((errmsg = set_option_value(key, numval, stringval, opt_flags))) { if (try_end(err)) { return; } - api_set_error(err, Exception, "%s", errmsg); + api_set_error(err, kErrorTypeException, "%s", errmsg); } } + +void api_set_error(Error *err, ErrorType errType, const char *format, ...) + FUNC_ATTR_NONNULL_ALL +{ + assert(kErrorTypeNone != errType); + va_list args1; + va_list args2; + va_start(args1, format); + va_copy(args2, args1); + int len = vsnprintf(NULL, 0, format, args1); + va_end(args1); + assert(len >= 0); + // Limit error message to 1 MB. + size_t bufsize = MIN((size_t)len + 1, 1024 * 1024); + err->msg = xmalloc(bufsize); + vsnprintf(err->msg, bufsize, format, args2); + va_end(args2); + + err->type = errType; +} + +/// Get an array containing dictionaries describing mappings +/// based on mode and buffer id +/// +/// @param mode The abbreviation for the mode +/// @param buf The buffer to get the mapping array. NULL for global +/// @returns An array of maparg() like dictionaries describing mappings +ArrayOf(Dictionary) keymap_array(String mode, buf_T *buf) +{ + Array mappings = ARRAY_DICT_INIT; + dict_T *const dict = tv_dict_alloc(); + + // Convert the string mode to the integer mode + // that is stored within each mapblock + char_u *p = (char_u *)mode.data; + int int_mode = get_map_mode(&p, 0); + + // Determine the desired buffer value + long buffer_value = (buf == NULL) ? 0 : buf->handle; + + for (int i = 0; i < MAX_MAPHASH; i++) { + for (const mapblock_T *current_maphash = get_maphash(i, buf); + current_maphash; + current_maphash = current_maphash->m_next) { + // Check for correct mode + if (int_mode & current_maphash->m_mode) { + mapblock_fill_dict(dict, current_maphash, buffer_value, false); + ADD(mappings, vim_to_object( + (typval_T[]) { { .v_type = VAR_DICT, .vval.v_dict = dict } })); + + tv_dict_clear(dict); + } + } + } + tv_dict_free(dict); + + return mappings; +} diff --git a/src/nvim/api/private/helpers.h b/src/nvim/api/private/helpers.h index 9fe8c351cf..87f334ac30 100644 --- a/src/nvim/api/private/helpers.h +++ b/src/nvim/api/private/helpers.h @@ -6,17 +6,9 @@ #include "nvim/api/private/defs.h" #include "nvim/vim.h" #include "nvim/memory.h" +#include "nvim/ex_eval.h" #include "nvim/lib/kvec.h" -#define api_set_error(err, errtype, ...) \ - do { \ - snprintf((err)->msg, \ - sizeof((err)->msg), \ - __VA_ARGS__); \ - (err)->set = true; \ - (err)->type = kErrorType##errtype; \ - } while (0) - #define OBJECT_OBJ(o) o #define BOOLEAN_OBJ(b) ((Object) { \ @@ -27,7 +19,7 @@ .type = kObjectTypeInteger, \ .data.integer = i }) -#define FLOATING_OBJ(f) ((Object) { \ +#define FLOAT_OBJ(f) ((Object) { \ .type = kObjectTypeFloat, \ .data.floating = f }) @@ -91,6 +83,21 @@ #define api_free_window(value) #define api_free_tabpage(value) +/// Structure used for saving state for :try +/// +/// Used when caller is supposed to be operating when other VimL code is being +/// processed and that “other VimL code” must not be affected. +typedef struct { + except_T *current_exception; + struct msglist *private_msg_list; + const struct msglist *const *msg_list; + int trylevel; + int got_int; + int did_throw; + int need_rethrow; + int did_emsg; +} TryState; + #ifdef INCLUDE_GENERATED_DECLARATIONS # include "api/private/helpers.h.generated.h" #endif diff --git a/src/nvim/api/tabpage.c b/src/nvim/api/tabpage.c index 0f0c33f621..b6830d9fcf 100644 --- a/src/nvim/api/tabpage.c +++ b/src/nvim/api/tabpage.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include #include @@ -15,7 +18,7 @@ /// @param[out] err Error details, if any /// @return List of windows in `tabpage` ArrayOf(Window) nvim_tabpage_list_wins(Tabpage tabpage, Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { Array rv = ARRAY_DICT_INIT; tabpage_T *tab = find_tab_by_handle(tabpage, err); @@ -45,7 +48,7 @@ ArrayOf(Window) nvim_tabpage_list_wins(Tabpage tabpage, Error *err) /// @param[out] err Error details, if any /// @return Variable value Object nvim_tabpage_get_var(Tabpage tabpage, String name, Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { tabpage_T *tab = find_tab_by_handle(tabpage, err); @@ -66,7 +69,7 @@ void nvim_tabpage_set_var(Tabpage tabpage, String name, Object value, Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { tabpage_T *tab = find_tab_by_handle(tabpage, err); @@ -83,7 +86,7 @@ void nvim_tabpage_set_var(Tabpage tabpage, /// @param name Variable name /// @param[out] err Error details, if any void nvim_tabpage_del_var(Tabpage tabpage, String name, Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { tabpage_T *tab = find_tab_by_handle(tabpage, err); @@ -142,7 +145,7 @@ Object tabpage_del_var(Tabpage tabpage, String name, Error *err) /// @param[out] err Error details, if any /// @return Window handle Window nvim_tabpage_get_win(Tabpage tabpage, Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { Window rv = 0; tabpage_T *tab = find_tab_by_handle(tabpage, err); @@ -170,7 +173,7 @@ Window nvim_tabpage_get_win(Tabpage tabpage, Error *err) /// @param[out] err Error details, if any /// @return Tabpage number Integer nvim_tabpage_get_number(Tabpage tabpage, Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { Integer rv = 0; tabpage_T *tab = find_tab_by_handle(tabpage, err); @@ -187,9 +190,11 @@ Integer nvim_tabpage_get_number(Tabpage tabpage, Error *err) /// @param tabpage Tabpage handle /// @return true if the tabpage is valid, false otherwise Boolean nvim_tabpage_is_valid(Tabpage tabpage) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { Error stub = ERROR_INIT; - return find_tab_by_handle(tabpage, &stub) != NULL; + Boolean ret = find_tab_by_handle(tabpage, &stub) != NULL; + api_clear_error(&stub); + return ret; } diff --git a/src/nvim/api/ui.c b/src/nvim/api/ui.c index 625bcc6b4b..a9eaccfac5 100644 --- a/src/nvim/api/ui.c +++ b/src/nvim/api/ui.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include #include @@ -12,9 +15,11 @@ #include "nvim/api/private/defs.h" #include "nvim/api/private/helpers.h" #include "nvim/popupmnu.h" +#include "nvim/cursor_shape.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "api/ui.c.generated.h" +# include "ui_events_remote.generated.h" #endif typedef struct { @@ -25,13 +30,13 @@ typedef struct { static PMap(uint64_t) *connected_uis = NULL; void remote_ui_init(void) - FUNC_API_NOEXPORT + FUNC_API_NOEXPORT { connected_uis = pmap_new(uint64_t)(); } void remote_ui_disconnect(uint64_t channel_id) - FUNC_API_NOEXPORT + FUNC_API_NOEXPORT { UI *ui = pmap_get(uint64_t)(connected_uis, channel_id); if (!ui) { @@ -48,27 +53,27 @@ void remote_ui_disconnect(uint64_t channel_id) void nvim_ui_attach(uint64_t channel_id, Integer width, Integer height, Dictionary options, Error *err) - FUNC_API_SINCE(1) FUNC_API_NOEVAL + FUNC_API_SINCE(1) FUNC_API_REMOTE_ONLY { if (pmap_has(uint64_t)(connected_uis, channel_id)) { - api_set_error(err, Exception, _("UI already attached for channel")); + api_set_error(err, kErrorTypeException, "UI already attached for channel"); return; } if (width <= 0 || height <= 0) { - api_set_error(err, Validation, - _("Expected width > 0 and height > 0")); + api_set_error(err, kErrorTypeValidation, + "Expected width > 0 and height > 0"); return; } UI *ui = xcalloc(1, sizeof(UI)); ui->width = (int)width; ui->height = (int)height; ui->rgb = true; - ui->pum_external = false; ui->resize = remote_ui_resize; ui->clear = remote_ui_clear; ui->eol_clear = remote_ui_eol_clear; ui->cursor_goto = remote_ui_cursor_goto; + ui->mode_info_set = remote_ui_mode_info_set; ui->update_menu = remote_ui_update_menu; ui->busy_start = remote_ui_busy_start; ui->busy_stop = remote_ui_busy_stop; @@ -90,9 +95,11 @@ void nvim_ui_attach(uint64_t channel_id, Integer width, Integer height, ui->set_icon = remote_ui_set_icon; ui->event = remote_ui_event; + memset(ui->ui_ext, 0, sizeof(ui->ui_ext)); + for (size_t i = 0; i < options.size; i++) { ui_set_option(ui, options.items[i].key, options.items[i].value, err); - if (err->set) { + if (ERROR_SET(err)) { xfree(ui); return; } @@ -118,10 +125,10 @@ void ui_attach(uint64_t channel_id, Integer width, Integer height, } void nvim_ui_detach(uint64_t channel_id, Error *err) - FUNC_API_SINCE(1) FUNC_API_NOEVAL + FUNC_API_SINCE(1) FUNC_API_REMOTE_ONLY { if (!pmap_has(uint64_t)(connected_uis, channel_id)) { - api_set_error(err, Exception, _("UI is not attached for channel")); + api_set_error(err, kErrorTypeException, "UI is not attached for channel"); return; } remote_ui_disconnect(channel_id); @@ -130,16 +137,16 @@ void nvim_ui_detach(uint64_t channel_id, Error *err) void nvim_ui_try_resize(uint64_t channel_id, Integer width, Integer height, Error *err) - FUNC_API_SINCE(1) FUNC_API_NOEVAL + FUNC_API_SINCE(1) FUNC_API_REMOTE_ONLY { if (!pmap_has(uint64_t)(connected_uis, channel_id)) { - api_set_error(err, Exception, _("UI is not attached for channel")); + api_set_error(err, kErrorTypeException, "UI is not attached for channel"); return; } if (width <= 0 || height <= 0) { - api_set_error(err, Validation, - _("Expected width > 0 and height > 0")); + api_set_error(err, kErrorTypeValidation, + "Expected width > 0 and height > 0"); return; } @@ -151,39 +158,64 @@ void nvim_ui_try_resize(uint64_t channel_id, Integer width, void nvim_ui_set_option(uint64_t channel_id, String name, Object value, Error *error) - FUNC_API_SINCE(1) FUNC_API_NOEVAL + FUNC_API_SINCE(1) FUNC_API_REMOTE_ONLY { if (!pmap_has(uint64_t)(connected_uis, channel_id)) { - api_set_error(error, Exception, _("UI is not attached for channel")); + api_set_error(error, kErrorTypeException, "UI is not attached for channel"); return; } UI *ui = pmap_get(uint64_t)(connected_uis, channel_id); ui_set_option(ui, name, value, error); - if (!error->set) { + if (!ERROR_SET(error)) { ui_refresh(); } } -static void ui_set_option(UI *ui, String name, Object value, Error *error) { - if (strcmp(name.data, "rgb") == 0) { +static void ui_set_option(UI *ui, String name, Object value, Error *error) +{ +#define UI_EXT_OPTION(o, e) \ + do { \ + if (strequal(name.data, #o)) { \ + if (value.type != kObjectTypeBoolean) { \ + api_set_error(error, kErrorTypeValidation, #o " must be a Boolean"); \ + return; \ + } \ + ui->ui_ext[(e)] = value.data.boolean; \ + return; \ + } \ + } while (0) + + if (strequal(name.data, "rgb")) { if (value.type != kObjectTypeBoolean) { - api_set_error(error, Validation, _("rgb must be a Boolean")); + api_set_error(error, kErrorTypeValidation, "rgb must be a Boolean"); return; } ui->rgb = value.data.boolean; - } else if (strcmp(name.data, "popupmenu_external") == 0) { + return; + } + + UI_EXT_OPTION(ext_cmdline, kUICmdline); + UI_EXT_OPTION(ext_popupmenu, kUIPopupmenu); + UI_EXT_OPTION(ext_tabline, kUITabline); + UI_EXT_OPTION(ext_wildmenu, kUIWildmenu); + + if (strequal(name.data, "popupmenu_external")) { + // LEGACY: Deprecated option, use `ui_ext` instead. if (value.type != kObjectTypeBoolean) { - api_set_error(error, Validation, - _("popupmenu_external must be a Boolean")); + api_set_error(error, kErrorTypeValidation, + "popupmenu_external must be a Boolean"); return; } - ui->pum_external = value.data.boolean; - } else { - api_set_error(error, Validation, _("No such ui option")); + ui->ui_ext[kUIPopupmenu] = value.data.boolean; + return; } + + api_set_error(error, kErrorTypeValidation, "No such ui option"); +#undef UI_EXT_OPTION } +/// Pushes data into UI.UIData, to be consumed later by remote_ui_flush(). static void push_call(UI *ui, char *name, Array args) { Array call = ARRAY_DICT_INIT; @@ -206,205 +238,23 @@ static void push_call(UI *ui, char *name, Array args) kv_A(data->buffer, kv_size(data->buffer) - 1).data.array = call; } -static void remote_ui_resize(UI *ui, int width, int height) -{ - Array args = ARRAY_DICT_INIT; - ADD(args, INTEGER_OBJ(width)); - ADD(args, INTEGER_OBJ(height)); - push_call(ui, "resize", args); -} - -static void remote_ui_clear(UI *ui) -{ - Array args = ARRAY_DICT_INIT; - push_call(ui, "clear", args); -} - -static void remote_ui_eol_clear(UI *ui) -{ - Array args = ARRAY_DICT_INIT; - push_call(ui, "eol_clear", args); -} - -static void remote_ui_cursor_goto(UI *ui, int row, int col) -{ - Array args = ARRAY_DICT_INIT; - ADD(args, INTEGER_OBJ(row)); - ADD(args, INTEGER_OBJ(col)); - push_call(ui, "cursor_goto", args); -} - -static void remote_ui_update_menu(UI *ui) -{ - Array args = ARRAY_DICT_INIT; - push_call(ui, "update_menu", args); -} - -static void remote_ui_busy_start(UI *ui) -{ - Array args = ARRAY_DICT_INIT; - push_call(ui, "busy_start", args); -} - -static void remote_ui_busy_stop(UI *ui) -{ - Array args = ARRAY_DICT_INIT; - push_call(ui, "busy_stop", args); -} - -static void remote_ui_mouse_on(UI *ui) -{ - Array args = ARRAY_DICT_INIT; - push_call(ui, "mouse_on", args); -} - -static void remote_ui_mouse_off(UI *ui) -{ - Array args = ARRAY_DICT_INIT; - push_call(ui, "mouse_off", args); -} - -static void remote_ui_mode_change(UI *ui, int mode) -{ - Array args = ARRAY_DICT_INIT; - if (mode == INSERT) { - ADD(args, STRING_OBJ(cstr_to_string("insert"))); - } else if (mode == REPLACE) { - ADD(args, STRING_OBJ(cstr_to_string("replace"))); - } else if (mode == CMDLINE) { - ADD(args, STRING_OBJ(cstr_to_string("cmdline"))); - } else { - assert(mode == NORMAL); - ADD(args, STRING_OBJ(cstr_to_string("normal"))); - } - push_call(ui, "mode_change", args); -} - -static void remote_ui_set_scroll_region(UI *ui, int top, int bot, int left, - int right) -{ - Array args = ARRAY_DICT_INIT; - ADD(args, INTEGER_OBJ(top)); - ADD(args, INTEGER_OBJ(bot)); - ADD(args, INTEGER_OBJ(left)); - ADD(args, INTEGER_OBJ(right)); - push_call(ui, "set_scroll_region", args); -} - -static void remote_ui_scroll(UI *ui, int count) -{ - Array args = ARRAY_DICT_INIT; - ADD(args, INTEGER_OBJ(count)); - push_call(ui, "scroll", args); -} static void remote_ui_highlight_set(UI *ui, HlAttrs attrs) { Array args = ARRAY_DICT_INIT; - Dictionary hl = ARRAY_DICT_INIT; - - if (attrs.bold) { - PUT(hl, "bold", BOOLEAN_OBJ(true)); - } - - if (attrs.underline) { - PUT(hl, "underline", BOOLEAN_OBJ(true)); - } - - if (attrs.undercurl) { - PUT(hl, "undercurl", BOOLEAN_OBJ(true)); - } - - if (attrs.italic) { - PUT(hl, "italic", BOOLEAN_OBJ(true)); - } - - if (attrs.reverse) { - PUT(hl, "reverse", BOOLEAN_OBJ(true)); - } - - if (attrs.foreground != -1) { - PUT(hl, "foreground", INTEGER_OBJ(attrs.foreground)); - } - - if (attrs.background != -1) { - PUT(hl, "background", INTEGER_OBJ(attrs.background)); - } - - if (attrs.special != -1) { - PUT(hl, "special", INTEGER_OBJ(attrs.special)); - } + Dictionary hl = hlattrs2dict(attrs); ADD(args, DICTIONARY_OBJ(hl)); push_call(ui, "highlight_set", args); } -static void remote_ui_put(UI *ui, uint8_t *data, size_t size) -{ - Array args = ARRAY_DICT_INIT; - String str = { .data = xmemdupz(data, size), .size = size }; - ADD(args, STRING_OBJ(str)); - push_call(ui, "put", args); -} - -static void remote_ui_bell(UI *ui) -{ - Array args = ARRAY_DICT_INIT; - push_call(ui, "bell", args); -} - -static void remote_ui_visual_bell(UI *ui) -{ - Array args = ARRAY_DICT_INIT; - push_call(ui, "visual_bell", args); -} - -static void remote_ui_update_fg(UI *ui, int fg) -{ - Array args = ARRAY_DICT_INIT; - ADD(args, INTEGER_OBJ(fg)); - push_call(ui, "update_fg", args); -} - -static void remote_ui_update_bg(UI *ui, int bg) -{ - Array args = ARRAY_DICT_INIT; - ADD(args, INTEGER_OBJ(bg)); - push_call(ui, "update_bg", args); -} - -static void remote_ui_update_sp(UI *ui, int sp) -{ - Array args = ARRAY_DICT_INIT; - ADD(args, INTEGER_OBJ(sp)); - push_call(ui, "update_sp", args); -} - static void remote_ui_flush(UI *ui) { UIData *data = ui->data; - channel_send_event(data->channel_id, "redraw", data->buffer); - data->buffer = (Array)ARRAY_DICT_INIT; -} - -static void remote_ui_suspend(UI *ui) -{ - Array args = ARRAY_DICT_INIT; - push_call(ui, "suspend", args); -} - -static void remote_ui_set_title(UI *ui, char *title) -{ - Array args = ARRAY_DICT_INIT; - ADD(args, STRING_OBJ(cstr_to_string(title))); - push_call(ui, "set_title", args); -} - -static void remote_ui_set_icon(UI *ui, char *icon) -{ - Array args = ARRAY_DICT_INIT; - ADD(args, STRING_OBJ(cstr_to_string(icon))); - push_call(ui, "set_icon", args); + if (data->buffer.size > 0) { + rpc_send_event(data->channel_id, "redraw", data->buffer); + data->buffer = (Array)ARRAY_DICT_INIT; + } } static void remote_ui_event(UI *ui, char *name, Array args, bool *args_consumed) diff --git a/src/nvim/api/ui_events.in.h b/src/nvim/api/ui_events.in.h new file mode 100644 index 0000000000..847b21072a --- /dev/null +++ b/src/nvim/api/ui_events.in.h @@ -0,0 +1,94 @@ +#ifndef NVIM_API_UI_EVENTS_IN_H +#define NVIM_API_UI_EVENTS_IN_H + +// This file is not compiled, just parsed for definitons +#ifdef INCLUDE_GENERATED_DECLARATIONS +# error "don't include this file, include nvim/ui.h" +#endif + +#include "nvim/api/private/defs.h" +#include "nvim/func_attr.h" +#include "nvim/ui.h" + +void resize(Integer rows, Integer columns) + FUNC_API_SINCE(3); +void clear(void) + FUNC_API_SINCE(3); +void eol_clear(void) + FUNC_API_SINCE(3); +void cursor_goto(Integer row, Integer col) + FUNC_API_SINCE(3); +void mode_info_set(Boolean enabled, Array cursor_styles) + FUNC_API_SINCE(3); +void update_menu(void) + FUNC_API_SINCE(3); +void busy_start(void) + FUNC_API_SINCE(3); +void busy_stop(void) + FUNC_API_SINCE(3); +void mouse_on(void) + FUNC_API_SINCE(3); +void mouse_off(void) + FUNC_API_SINCE(3); +void mode_change(String mode, Integer mode_idx) + FUNC_API_SINCE(3); +void set_scroll_region(Integer top, Integer bot, Integer left, Integer right) + FUNC_API_SINCE(3); +void scroll(Integer count) + FUNC_API_SINCE(3); +void highlight_set(HlAttrs attrs) + FUNC_API_SINCE(3) FUNC_API_REMOTE_IMPL FUNC_API_BRIDGE_IMPL; +void put(String str) + FUNC_API_SINCE(3); +void bell(void) + FUNC_API_SINCE(3); +void visual_bell(void) + FUNC_API_SINCE(3); +void flush(void) + FUNC_API_SINCE(3) FUNC_API_REMOTE_IMPL; +void update_fg(Integer fg) + FUNC_API_SINCE(3); +void update_bg(Integer bg) + FUNC_API_SINCE(3); +void update_sp(Integer sp) + FUNC_API_SINCE(3); +void suspend(void) + FUNC_API_SINCE(3) FUNC_API_BRIDGE_IMPL; +void set_title(String title) + FUNC_API_SINCE(3); +void set_icon(String icon) + FUNC_API_SINCE(3); + +void popupmenu_show(Array items, Integer selected, Integer row, Integer col) + FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY; +void popupmenu_hide(void) + FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY; +void popupmenu_select(Integer selected) + FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY; + +void tabline_update(Tabpage current, Array tabs) + FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY; + +void cmdline_show(Array content, Integer pos, String firstc, String prompt, + Integer indent, Integer level) + FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY; +void cmdline_pos(Integer pos, Integer level) + FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY; +void cmdline_special_char(String c, Boolean shift, Integer level) + FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY; +void cmdline_hide(Integer level) + FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY; +void cmdline_block_show(Array lines) + FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY; +void cmdline_block_append(Array lines) + FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY; +void cmdline_block_hide(void) + FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY; + +void wildmenu_show(Array items) + FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY; +void wildmenu_select(Integer selected) + FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY; +void wildmenu_hide(void) + FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY; +#endif // NVIM_API_UI_EVENTS_IN_H diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index 413456c615..f4ccf07bec 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include #include @@ -10,8 +13,10 @@ #include "nvim/ascii.h" #include "nvim/api/private/helpers.h" #include "nvim/api/private/defs.h" +#include "nvim/api/private/dispatch.h" #include "nvim/api/buffer.h" #include "nvim/msgpack_rpc/channel.h" +#include "nvim/lua/executor.h" #include "nvim/vim.h" #include "nvim/buffer.h" #include "nvim/file_search.h" @@ -22,7 +27,9 @@ #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/eval.h" +#include "nvim/eval/typval.h" #include "nvim/option.h" +#include "nvim/state.h" #include "nvim/syntax.h" #include "nvim/getchar.h" #include "nvim/os/input.h" @@ -39,7 +46,7 @@ /// @param command Ex-command string /// @param[out] err Error details (including actual VimL error), if any void nvim_command(String command, Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { // Run the command try_start(); @@ -48,6 +55,48 @@ void nvim_command(String command, Error *err) try_end(err); } +/// Gets a highlight definition by name. +/// +/// @param name Highlight group name +/// @param rgb Export RGB colors +/// @param[out] err Error details, if any +/// @return Highlight definition map +/// @see nvim_get_hl_by_id +Dictionary nvim_get_hl_by_name(String name, Boolean rgb, Error *err) + FUNC_API_SINCE(3) +{ + Dictionary result = ARRAY_DICT_INIT; + int id = syn_name2id((const char_u *)name.data); + + if (id == 0) { + api_set_error(err, kErrorTypeException, "Invalid highlight name: %s", + name.data); + return result; + } + result = nvim_get_hl_by_id(id, rgb, err); + return result; +} + +/// Gets a highlight definition by id. |hlID()| +/// +/// @param hl_id Highlight id as returned by |hlID()| +/// @param rgb Export RGB colors +/// @param[out] err Error details, if any +/// @return Highlight definition map +/// @see nvim_get_hl_by_name +Dictionary nvim_get_hl_by_id(Integer hl_id, Boolean rgb, Error *err) + FUNC_API_SINCE(3) +{ + Dictionary dic = ARRAY_DICT_INIT; + if (syn_get_final_id((int)hl_id) == 0) { + api_set_error(err, kErrorTypeException, + "Invalid highlight id: %" PRId64, hl_id); + return dic; + } + int attrcode = syn_id2attr((int)hl_id); + return hl_get_attr_by_id(attrcode, rgb, err); +} + /// Passes input keys to Nvim. /// On VimL error: Does not fail, but updates v:errmsg. /// @@ -57,7 +106,7 @@ void nvim_command(String command, Error *err) /// @see feedkeys() /// @see vim_strsave_escape_csi void nvim_feedkeys(String keys, String mode, Boolean escape_csi) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { bool remap = true; bool insert = false; @@ -118,51 +167,53 @@ void nvim_feedkeys(String keys, String mode, Boolean escape_csi) /// On VimL error: Does not fail, but updates v:errmsg. /// /// Unlike `nvim_feedkeys`, this uses a lower-level input buffer and the call -/// is not deferred. This is the most reliable way to emulate real user input. +/// is not deferred. This is the most reliable way to send real user input. +/// +/// @note |keycodes| like are translated, so "<" is special. +/// To input a literal "<", send . /// /// @param keys to be typed /// @return Number of bytes actually written (can be fewer than /// requested if the buffer becomes full). Integer nvim_input(String keys) - FUNC_API_SINCE(1) FUNC_API_ASYNC + FUNC_API_SINCE(1) FUNC_API_ASYNC { return (Integer)input_enqueue(keys); } -/// Replaces any terminal codes with the internal representation +/// Replaces terminal codes and |keycodes| (, , ...) in a string with +/// the internal representation. /// +/// @param str String to be converted. +/// @param from_part Legacy Vim parameter. Usually true. +/// @param do_lt Also translate . Ignored if `special` is false. +/// @param special Replace |keycodes|, e.g. becomes a "\n" char. /// @see replace_termcodes /// @see cpoptions String nvim_replace_termcodes(String str, Boolean from_part, Boolean do_lt, Boolean special) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { if (str.size == 0) { // Empty string - return str; + return (String) { .data = NULL, .size = 0 }; } char *ptr = NULL; - // Set 'cpoptions' the way we want it. - // FLAG_CPO_BSLASH set - backslashes are *not* treated specially - // FLAG_CPO_KEYCODE set - keycodes are *not* reverse-engineered - // FLAG_CPO_SPECI unset - sequences *are* interpreted - // The third from end parameter of replace_termcodes() is true so that the - // sequence is recognised - needed for a real backslash. replace_termcodes((char_u *)str.data, str.size, (char_u **)&ptr, from_part, do_lt, special, CPO_TO_CPO_FLAGS); return cstr_as_string(ptr); } String nvim_command_output(String str, Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { do_cmdline_cmd("redir => v:command_output"); nvim_command(str, err); do_cmdline_cmd("redir END"); - if (err->set) { - return (String) STRING_INIT; + if (ERROR_SET(err)) { + return (String)STRING_INIT; } return cstr_to_string((char *)get_vim_var_str(VV_COMMAND_OUTPUT)); @@ -176,28 +227,30 @@ String nvim_command_output(String str, Error *err) /// @param[out] err Error details, if any /// @return Evaluation result or expanded object Object nvim_eval(String expr, Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { Object rv = OBJECT_INIT; // Evaluate the expression try_start(); - typval_T *expr_result = eval_expr((char_u *)expr.data, NULL); - if (!expr_result) { - api_set_error(err, Exception, _("Failed to evaluate expression")); + typval_T rettv; + if (eval0((char_u *)expr.data, &rettv, NULL, true) == FAIL) { + api_set_error(err, kErrorTypeException, "Failed to evaluate expression"); } if (!try_end(err)) { // No errors, convert the result - rv = vim_to_object(expr_result); + rv = vim_to_object(&rettv); } - // Free the vim object - free_tv(expr_result); + // Free the Vim object + tv_clear(&rettv); + return rv; } -/// Calls a VimL function with the given arguments. +/// Calls a VimL function with the given arguments +/// /// On VimL error: Returns a generic error; v:errmsg is not updated. /// /// @param fname Function to call @@ -205,12 +258,12 @@ Object nvim_eval(String expr, Error *err) /// @param[out] err Error details, if any /// @return Result of the function call Object nvim_call_function(String fname, Array args, Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { Object rv = OBJECT_INIT; if (args.size > MAX_FUNC_ARGS) { - api_set_error(err, Validation, - _("Function called with too many arguments.")); + api_set_error(err, kErrorTypeValidation, + "Function called with too many arguments."); return rv; } @@ -232,46 +285,64 @@ Object nvim_call_function(String fname, Array args, Error *err) curwin->w_cursor.lnum, curwin->w_cursor.lnum, &dummy, true, NULL, NULL); if (r == FAIL) { - api_set_error(err, Exception, _("Error calling function.")); + api_set_error(err, kErrorTypeException, "Error calling function."); } if (!try_end(err)) { rv = vim_to_object(&rettv); } - clear_tv(&rettv); + tv_clear(&rettv); free_vim_args: while (i > 0) { - clear_tv(&vim_args[--i]); + tv_clear(&vim_args[--i]); } return rv; } +/// Execute lua code. Parameters (if any) are available as `...` inside the +/// chunk. The chunk can return a value. +/// +/// Only statements are executed. To evaluate an expression, prefix it +/// with `return`: return my_function(...) +/// +/// @param code lua code to execute +/// @param args Arguments to the code +/// @param[out] err Details of an error encountered while parsing +/// or executing the lua code. +/// +/// @return Return value of lua code if present or NIL. +Object nvim_execute_lua(String code, Array args, Error *err) + FUNC_API_SINCE(3) FUNC_API_REMOTE_ONLY +{ + return executor_exec_lua_api(code, args, err); +} + /// Calculates the number of display cells occupied by `text`. /// counts as one cell. /// /// @param text Some text /// @param[out] err Error details, if any /// @return Number of cells -Integer nvim_strwidth(String str, Error *err) - FUNC_API_SINCE(1) +Integer nvim_strwidth(String text, Error *err) + FUNC_API_SINCE(1) { - if (str.size > INT_MAX) { - api_set_error(err, Validation, _("String length is too high")); + if (text.size > INT_MAX) { + api_set_error(err, kErrorTypeValidation, "String length is too high"); return 0; } - return (Integer) mb_string2cells((char_u *) str.data); + return (Integer)mb_string2cells((char_u *)text.data); } /// Gets the paths contained in 'runtimepath'. /// /// @return List of paths ArrayOf(String) nvim_list_runtime_paths(void) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { Array rv = ARRAY_DICT_INIT; - uint8_t *rtp = p_rtp; + char_u *rtp = p_rtp; if (*rtp == NUL) { // No paths @@ -285,13 +356,14 @@ ArrayOf(String) nvim_list_runtime_paths(void) } rtp++; } + rv.size++; // Allocate memory for the copies - rv.items = xmalloc(sizeof(Object) * rv.size); + rv.items = xmalloc(sizeof(*rv.items) * rv.size); // Reset the position rtp = p_rtp; // Start copying - for (size_t i = 0; i < rv.size && *rtp != NUL; i++) { + for (size_t i = 0; i < rv.size; i++) { rv.items[i].type = kObjectTypeString; rv.items[i].data.string.data = xmalloc(MAXPATHL); // Copy the path from 'runtimepath' to rv.items[i] @@ -310,10 +382,10 @@ ArrayOf(String) nvim_list_runtime_paths(void) /// @param dir Directory path /// @param[out] err Error details, if any void nvim_set_current_dir(String dir, Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { if (dir.size >= MAXPATHL) { - api_set_error(err, Validation, _("Directory string is too long")); + api_set_error(err, kErrorTypeValidation, "Directory string is too long"); return; } @@ -325,7 +397,7 @@ void nvim_set_current_dir(String dir, Error *err) if (vim_chdir((char_u *)string, kCdScopeGlobal)) { if (!try_end(err)) { - api_set_error(err, Exception, _("Failed to change directory")); + api_set_error(err, kErrorTypeException, "Failed to change directory"); } return; } @@ -339,7 +411,7 @@ void nvim_set_current_dir(String dir, Error *err) /// @param[out] err Error details, if any /// @return Current line string String nvim_get_current_line(Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { return buffer_get_line(curbuf->handle, curwin->w_cursor.lnum - 1, err); } @@ -349,7 +421,7 @@ String nvim_get_current_line(Error *err) /// @param line Line contents /// @param[out] err Error details, if any void nvim_set_current_line(String line, Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { buffer_set_line(curbuf->handle, curwin->w_cursor.lnum - 1, line, err); } @@ -358,7 +430,7 @@ void nvim_set_current_line(String line, Error *err) /// /// @param[out] err Error details, if any void nvim_del_current_line(Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { buffer_del_line(curbuf->handle, curwin->w_cursor.lnum - 1, err); } @@ -369,7 +441,7 @@ void nvim_del_current_line(Error *err) /// @param[out] err Error details, if any /// @return Variable value Object nvim_get_var(String name, Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { return dict_get_value(&globvardict, name, err); } @@ -380,7 +452,7 @@ Object nvim_get_var(String name, Error *err) /// @param value Variable value /// @param[out] err Error details, if any void nvim_set_var(String name, Object value, Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { dict_set_var(&globvardict, name, value, false, false, err); } @@ -390,34 +462,23 @@ void nvim_set_var(String name, Object value, Error *err) /// @param name Variable name /// @param[out] err Error details, if any void nvim_del_var(String name, Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { dict_set_var(&globvardict, name, NIL, true, false, err); } -/// Sets a global variable -/// /// @deprecated -/// -/// @param name Variable name -/// @param value Variable value -/// @param[out] err Error details, if any +/// @see nvim_set_var /// @return Old value or nil if there was no previous value. -/// -/// @warning It may return nil if there was no previous value -/// or if previous value was `v:null`. +/// @warning May return nil if there was no previous value +/// OR if previous value was `v:null`. Object vim_set_var(String name, Object value, Error *err) { return dict_set_var(&globvardict, name, value, false, true, err); } -/// Removes a global variable -/// /// @deprecated -/// -/// @param name Variable name -/// @param[out] err Error details, if any -/// @return Old value +/// @see nvim_del_var Object vim_del_var(String name, Error *err) { return dict_set_var(&globvardict, name, NIL, true, true, err); @@ -429,7 +490,7 @@ Object vim_del_var(String name, Error *err) /// @param[out] err Error details, if any /// @return Variable value Object nvim_get_vvar(String name, Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { return dict_get_value(&vimvardict, name, err); } @@ -438,9 +499,9 @@ Object nvim_get_vvar(String name, Error *err) /// /// @param name Option name /// @param[out] err Error details, if any -/// @return Option value +/// @return Option value (global) Object nvim_get_option(String name, Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { return get_option_from(NULL, SREQ_GLOBAL, name, err); } @@ -451,36 +512,38 @@ Object nvim_get_option(String name, Error *err) /// @param value New option value /// @param[out] err Error details, if any void nvim_set_option(String name, Object value, Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { set_option_to(NULL, SREQ_GLOBAL, name, value, err); } -/// Writes a message to vim output buffer +/// Writes a message to the Vim output buffer. Does not append "\n", the +/// message is buffered (won't display) until a linefeed is written. /// /// @param str Message void nvim_out_write(String str) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { write_msg(str, false); } -/// Writes a message to vim error buffer +/// Writes a message to the Vim error buffer. Does not append "\n", the +/// message is buffered (won't display) until a linefeed is written. /// /// @param str Message void nvim_err_write(String str) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { write_msg(str, true); } -/// Writes a message to vim error buffer. Appends a linefeed to ensure all -/// contents are written. +/// Writes a message to the Vim error buffer. Appends "\n", so the buffer is +/// flushed (and displayed). /// /// @param str Message /// @see nvim_err_write() void nvim_err_writeln(String str) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { nvim_err_write(str); nvim_err_write((String) { .data = "\n", .size = 1 }); @@ -490,7 +553,7 @@ void nvim_err_writeln(String str) /// /// @return List of buffer handles ArrayOf(Buffer) nvim_list_bufs(void) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { Array rv = ARRAY_DICT_INIT; @@ -512,17 +575,17 @@ ArrayOf(Buffer) nvim_list_bufs(void) /// /// @return Buffer handle Buffer nvim_get_current_buf(void) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { return curbuf->handle; } /// Sets the current buffer /// -/// @param id Buffer handle +/// @param buffer Buffer handle /// @param[out] err Error details, if any void nvim_set_current_buf(Buffer buffer, Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { buf_T *buf = find_buffer_by_handle(buffer, err); @@ -534,8 +597,8 @@ void nvim_set_current_buf(Buffer buffer, Error *err) int result = do_buffer(DOBUF_GOTO, DOBUF_FIRST, FORWARD, buf->b_fnum, 0); if (!try_end(err) && result == FAIL) { api_set_error(err, - Exception, - _("Failed to switch to buffer %d"), + kErrorTypeException, + "Failed to switch to buffer %d", buffer); } } @@ -544,7 +607,7 @@ void nvim_set_current_buf(Buffer buffer, Error *err) /// /// @return List of window handles ArrayOf(Window) nvim_list_wins(void) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { Array rv = ARRAY_DICT_INIT; @@ -566,16 +629,16 @@ ArrayOf(Window) nvim_list_wins(void) /// /// @return Window handle Window nvim_get_current_win(void) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { return curwin->handle; } /// Sets the current window /// -/// @param handle Window handle +/// @param window Window handle void nvim_set_current_win(Window window, Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { win_T *win = find_window_by_handle(window, err); @@ -587,8 +650,8 @@ void nvim_set_current_win(Window window, Error *err) goto_tabpage_win(win_find_tabpage(win), win); if (!try_end(err) && win != curwin) { api_set_error(err, - Exception, - _("Failed to switch to window %d"), + kErrorTypeException, + "Failed to switch to window %d", window); } } @@ -597,7 +660,7 @@ void nvim_set_current_win(Window window, Error *err) /// /// @return List of tabpage handles ArrayOf(Tabpage) nvim_list_tabpages(void) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { Array rv = ARRAY_DICT_INIT; @@ -619,17 +682,17 @@ ArrayOf(Tabpage) nvim_list_tabpages(void) /// /// @return Tabpage handle Tabpage nvim_get_current_tabpage(void) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { return curtab->handle; } /// Sets the current tabpage /// -/// @param handle Tabpage handle +/// @param tabpage Tabpage handle /// @param[out] err Error details, if any void nvim_set_current_tabpage(Tabpage tabpage, Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { tabpage_T *tp = find_tab_by_handle(tabpage, err); @@ -641,8 +704,8 @@ void nvim_set_current_tabpage(Tabpage tabpage, Error *err) goto_tabpage_tp(tp, true, true); if (!try_end(err) && tp != curtab) { api_set_error(err, - Exception, - _("Failed to switch to tabpage %d"), + kErrorTypeException, + "Failed to switch to tabpage %d", tabpage); } } @@ -652,13 +715,13 @@ void nvim_set_current_tabpage(Tabpage tabpage, Error *err) /// @param channel_id Channel id (passed automatically by the dispatcher) /// @param event Event type string void nvim_subscribe(uint64_t channel_id, String event) - FUNC_API_SINCE(1) FUNC_API_NOEVAL + FUNC_API_SINCE(1) FUNC_API_REMOTE_ONLY { size_t length = (event.size < METHOD_MAXLEN ? event.size : METHOD_MAXLEN); char e[METHOD_MAXLEN + 1]; memcpy(e, event.data, length); e[length] = NUL; - channel_subscribe(channel_id, e); + rpc_subscribe(channel_id, e); } /// Unsubscribes to event broadcasts @@ -666,7 +729,7 @@ void nvim_subscribe(uint64_t channel_id, String event) /// @param channel_id Channel id (passed automatically by the dispatcher) /// @param event Event type string void nvim_unsubscribe(uint64_t channel_id, String event) - FUNC_API_SINCE(1) FUNC_API_NOEVAL + FUNC_API_SINCE(1) FUNC_API_REMOTE_ONLY { size_t length = (event.size < METHOD_MAXLEN ? event.size : @@ -674,17 +737,17 @@ void nvim_unsubscribe(uint64_t channel_id, String event) char e[METHOD_MAXLEN + 1]; memcpy(e, event.data, length); e[length] = NUL; - channel_unsubscribe(channel_id, e); + rpc_unsubscribe(channel_id, e); } Integer nvim_get_color_by_name(String name) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { - return name_to_color((uint8_t *)name.data); + return name_to_color((char_u *)name.data); } Dictionary nvim_get_color_map(void) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { Dictionary colors = ARRAY_DICT_INIT; @@ -696,8 +759,36 @@ Dictionary nvim_get_color_map(void) } +/// Gets the current mode. |mode()| +/// "blocking" is true if Nvim is waiting for input. +/// +/// @returns Dictionary { "mode": String, "blocking": Boolean } +Dictionary nvim_get_mode(void) + FUNC_API_SINCE(2) FUNC_API_ASYNC +{ + Dictionary rv = ARRAY_DICT_INIT; + char *modestr = get_mode(); + bool blocked = input_blocking(); + + PUT(rv, "mode", STRING_OBJ(cstr_as_string(modestr))); + PUT(rv, "blocking", BOOLEAN_OBJ(blocked)); + + return rv; +} + +/// Gets a list of dictionaries describing global (non-buffer) mappings. +/// The "buffer" key in the returned dictionary is always zero. +/// +/// @param mode Mode short-name ("n", "i", "v", ...) +/// @returns Array of maparg()-like dictionaries describing mappings +ArrayOf(Dictionary) nvim_get_keymap(String mode) + FUNC_API_SINCE(3) +{ + return keymap_array(mode, NULL); +} + Array nvim_get_api_info(uint64_t channel_id) - FUNC_API_SINCE(1) FUNC_API_ASYNC FUNC_API_NOEVAL + FUNC_API_SINCE(1) FUNC_API_ASYNC FUNC_API_REMOTE_ONLY { Array rv = ARRAY_DICT_INIT; @@ -730,7 +821,7 @@ Array nvim_get_api_info(uint64_t channel_id) /// which resulted in an error, the error type and the error message. If an /// error ocurred, the values from all preceding calls will still be returned. Array nvim_call_atomic(uint64_t channel_id, Array calls, Error *err) - FUNC_API_SINCE(1) FUNC_API_NOEVAL + FUNC_API_SINCE(1) FUNC_API_REMOTE_ONLY { Array rv = ARRAY_DICT_INIT; Array results = ARRAY_DICT_INIT; @@ -740,30 +831,30 @@ Array nvim_call_atomic(uint64_t channel_id, Array calls, Error *err) for (i = 0; i < calls.size; i++) { if (calls.items[i].type != kObjectTypeArray) { api_set_error(err, - Validation, - _("All items in calls array must be arrays")); + kErrorTypeValidation, + "All items in calls array must be arrays"); goto validation_error; } Array call = calls.items[i].data.array; if (call.size != 2) { api_set_error(err, - Validation, - _("All items in calls array must be arrays of size 2")); + kErrorTypeValidation, + "All items in calls array must be arrays of size 2"); goto validation_error; } if (call.items[0].type != kObjectTypeString) { api_set_error(err, - Validation, - _("name must be String")); + kErrorTypeValidation, + "Name must be String"); goto validation_error; } String name = call.items[0].data.string; if (call.items[1].type != kObjectTypeArray) { api_set_error(err, - Validation, - _("args must be Array")); + kErrorTypeValidation, + "Args must be Array"); goto validation_error; } Array args = call.items[1].data.array; @@ -771,7 +862,7 @@ Array nvim_call_atomic(uint64_t channel_id, Array calls, Error *err) MsgpackRpcRequestHandler handler = msgpack_rpc_get_handler_for(name.data, name.size); Object result = handler.fn(channel_id, args, &nested_error); - if (nested_error.set) { + if (ERROR_SET(&nested_error)) { // error handled after loop break; } @@ -780,7 +871,7 @@ Array nvim_call_atomic(uint64_t channel_id, Array calls, Error *err) } ADD(rv, ARRAY_OBJ(results)); - if (nested_error.set) { + if (ERROR_SET(&nested_error)) { Array errval = ARRAY_DICT_INIT; ADD(errval, INTEGER_OBJ((Integer)i)); ADD(errval, INTEGER_OBJ(nested_error.type)); @@ -789,10 +880,12 @@ Array nvim_call_atomic(uint64_t channel_id, Array calls, Error *err) } else { ADD(rv, NIL); } - return rv; + goto theend; validation_error: api_free_array(results); +theend: + api_clear_error(&nested_error); return rv; } @@ -811,7 +904,7 @@ static void write_msg(String message, bool to_err) #define PUSH_CHAR(i, pos, line_buf, msg) \ if (message.data[i] == NL || pos == LINE_BUFFER_SIZE - 1) { \ line_buf[pos] = NUL; \ - msg((uint8_t *)line_buf); \ + msg((char_u *)line_buf); \ pos = 0; \ continue; \ } \ @@ -829,3 +922,57 @@ static void write_msg(String message, bool to_err) --no_wait_return; msg_end(); } + +// Functions used for testing purposes + +/// Returns object given as argument +/// +/// This API function is used for testing. One should not rely on its presence +/// in plugins. +/// +/// @param[in] obj Object to return. +/// +/// @return its argument. +Object nvim__id(Object obj) +{ + return copy_object(obj); +} + +/// Returns array given as argument +/// +/// This API function is used for testing. One should not rely on its presence +/// in plugins. +/// +/// @param[in] arr Array to return. +/// +/// @return its argument. +Array nvim__id_array(Array arr) +{ + return copy_object(ARRAY_OBJ(arr)).data.array; +} + +/// Returns dictionary given as argument +/// +/// This API function is used for testing. One should not rely on its presence +/// in plugins. +/// +/// @param[in] dct Dictionary to return. +/// +/// @return its argument. +Dictionary nvim__id_dictionary(Dictionary dct) +{ + return copy_object(DICTIONARY_OBJ(dct)).data.dictionary; +} + +/// Returns floating-point value given as argument +/// +/// This API function is used for testing. One should not rely on its presence +/// in plugins. +/// +/// @param[in] flt Value to return. +/// +/// @return its argument. +Float nvim__id_float(Float flt) +{ + return flt; +} diff --git a/src/nvim/api/window.c b/src/nvim/api/window.c index 3c564ada99..9bc91ef8fb 100644 --- a/src/nvim/api/window.c +++ b/src/nvim/api/window.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include #include @@ -19,7 +22,7 @@ /// @param[out] err Error details, if any /// @return Buffer handle Buffer nvim_win_get_buf(Window window, Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { win_T *win = find_window_by_handle(window, err); @@ -36,7 +39,7 @@ Buffer nvim_win_get_buf(Window window, Error *err) /// @param[out] err Error details, if any /// @return (row, col) tuple ArrayOf(Integer, 2) nvim_win_get_cursor(Window window, Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { Array rv = ARRAY_DICT_INIT; win_T *win = find_window_by_handle(window, err); @@ -55,19 +58,19 @@ ArrayOf(Integer, 2) nvim_win_get_cursor(Window window, Error *err) /// @param pos (row, col) tuple representing the new position /// @param[out] err Error details, if any void nvim_win_set_cursor(Window window, ArrayOf(Integer, 2) pos, Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { win_T *win = find_window_by_handle(window, err); + if (!win) { + return; + } + if (pos.size != 2 || pos.items[0].type != kObjectTypeInteger || pos.items[1].type != kObjectTypeInteger) { api_set_error(err, - Validation, - _("Argument \"pos\" must be a [row, col] array")); - return; - } - - if (!win) { + kErrorTypeValidation, + "Argument \"pos\" must be a [row, col] array"); return; } @@ -75,12 +78,12 @@ void nvim_win_set_cursor(Window window, ArrayOf(Integer, 2) pos, Error *err) int64_t col = pos.items[1].data.integer; if (row <= 0 || row > win->w_buffer->b_ml.ml_line_count) { - api_set_error(err, Validation, _("Cursor position outside buffer")); + api_set_error(err, kErrorTypeValidation, "Cursor position outside buffer"); return; } if (col > MAXCOL || col < 0) { - api_set_error(err, Validation, _("Column value outside range")); + api_set_error(err, kErrorTypeValidation, "Column value outside range"); return; } @@ -102,7 +105,7 @@ void nvim_win_set_cursor(Window window, ArrayOf(Integer, 2) pos, Error *err) /// @param[out] err Error details, if any /// @return Height as a count of rows Integer nvim_win_get_height(Window window, Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { win_T *win = find_window_by_handle(window, err); @@ -120,7 +123,7 @@ Integer nvim_win_get_height(Window window, Error *err) /// @param height Height as a count of rows /// @param[out] err Error details, if any void nvim_win_set_height(Window window, Integer height, Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { win_T *win = find_window_by_handle(window, err); @@ -129,7 +132,7 @@ void nvim_win_set_height(Window window, Integer height, Error *err) } if (height > INT_MAX || height < INT_MIN) { - api_set_error(err, Validation, _("Height value outside range")); + api_set_error(err, kErrorTypeValidation, "Height value outside range"); return; } @@ -147,7 +150,7 @@ void nvim_win_set_height(Window window, Integer height, Error *err) /// @param[out] err Error details, if any /// @return Width as a count of columns Integer nvim_win_get_width(Window window, Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { win_T *win = find_window_by_handle(window, err); @@ -165,7 +168,7 @@ Integer nvim_win_get_width(Window window, Error *err) /// @param width Width as a count of columns /// @param[out] err Error details, if any void nvim_win_set_width(Window window, Integer width, Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { win_T *win = find_window_by_handle(window, err); @@ -174,7 +177,7 @@ void nvim_win_set_width(Window window, Integer width, Error *err) } if (width > INT_MAX || width < INT_MIN) { - api_set_error(err, Validation, _("Width value outside range")); + api_set_error(err, kErrorTypeValidation, "Width value outside range"); return; } @@ -193,7 +196,7 @@ void nvim_win_set_width(Window window, Integer width, Error *err) /// @param[out] err Error details, if any /// @return Variable value Object nvim_win_get_var(Window window, String name, Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { win_T *win = find_window_by_handle(window, err); @@ -211,7 +214,7 @@ Object nvim_win_get_var(Window window, String name, Error *err) /// @param value Variable value /// @param[out] err Error details, if any void nvim_win_set_var(Window window, String name, Object value, Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { win_T *win = find_window_by_handle(window, err); @@ -228,7 +231,7 @@ void nvim_win_set_var(Window window, String name, Object value, Error *err) /// @param name Variable name /// @param[out] err Error details, if any void nvim_win_del_var(Window window, String name, Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { win_T *win = find_window_by_handle(window, err); @@ -288,7 +291,7 @@ Object window_del_var(Window window, String name, Error *err) /// @param[out] err Error details, if any /// @return Option value Object nvim_win_get_option(Window window, String name, Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { win_T *win = find_window_by_handle(window, err); @@ -307,7 +310,7 @@ Object nvim_win_get_option(Window window, String name, Error *err) /// @param value Option value /// @param[out] err Error details, if any void nvim_win_set_option(Window window, String name, Object value, Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { win_T *win = find_window_by_handle(window, err); @@ -324,7 +327,7 @@ void nvim_win_set_option(Window window, String name, Object value, Error *err) /// @param[out] err Error details, if any /// @return (row, col) tuple with the window position ArrayOf(Integer, 2) nvim_win_get_position(Window window, Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { Array rv = ARRAY_DICT_INIT; win_T *win = find_window_by_handle(window, err); @@ -343,7 +346,7 @@ ArrayOf(Integer, 2) nvim_win_get_position(Window window, Error *err) /// @param[out] err Error details, if any /// @return Tabpage that contains the window Tabpage nvim_win_get_tabpage(Window window, Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { Tabpage rv = 0; win_T *win = find_window_by_handle(window, err); @@ -361,7 +364,7 @@ Tabpage nvim_win_get_tabpage(Window window, Error *err) /// @param[out] err Error details, if any /// @return Window number Integer nvim_win_get_number(Window window, Error *err) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { int rv = 0; win_T *win = find_window_by_handle(window, err); @@ -381,9 +384,11 @@ Integer nvim_win_get_number(Window window, Error *err) /// @param window Window handle /// @return true if the window is valid, false otherwise Boolean nvim_win_is_valid(Window window) - FUNC_API_SINCE(1) + FUNC_API_SINCE(1) { Error stub = ERROR_INIT; - return find_window_by_handle(window, &stub) != NULL; + Boolean ret = find_window_by_handle(window, &stub) != NULL; + api_clear_error(&stub); + return ret; } diff --git a/src/nvim/arabic.c b/src/nvim/arabic.c index db97bd9dc4..1ef51d2a2a 100644 --- a/src/nvim/arabic.c +++ b/src/nvim/arabic.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /// @file arabic.c /// /// Functions for Arabic language. diff --git a/src/nvim/ascii.h b/src/nvim/ascii.h index 44ff540b40..adde91f9ec 100644 --- a/src/nvim/ascii.h +++ b/src/nvim/ascii.h @@ -8,9 +8,11 @@ // Definitions of various common control characters. -#define CharOrd(x) ((x) < 'a' ? (x) - 'A' : (x) - 'a') -#define CharOrdLow(x) ((x) - 'a') -#define CharOrdUp(x) ((x) - 'A') +#define CharOrd(x) ((uint8_t)(x) < 'a' \ + ? (uint8_t)(x) - 'A'\ + : (uint8_t)(x) - 'a') +#define CharOrdLow(x) ((uint8_t)(x) - 'a') +#define CharOrdUp(x) ((uint8_t)(x) - 'A') #define ROT13(c, a) (((((c) - (a)) + 13) % 26) + (a)) #define NUL '\000' @@ -18,15 +20,14 @@ #define BS '\010' #define TAB '\011' #define NL '\012' -#define NL_STR (char_u *)"\012" +#define NL_STR "\012" #define FF '\014' #define CAR '\015' /* CR is used by Mac OS X */ #define ESC '\033' -#define ESC_STR (char_u *)"\033" -#define ESC_STR_nc "\033" +#define ESC_STR "\033" #define DEL 0x7f -#define DEL_STR (char_u *)"\177" -#define CSI 0x9b /* Control Sequence Introducer */ +#define DEL_STR "\177" +#define CSI 0x9b // Control Sequence Introducer #define CSI_STR "\233" #define DCS 0x90 /* Device Control String */ #define STERM 0x9c /* String Terminator */ diff --git a/src/nvim/aucmd.c b/src/nvim/aucmd.c new file mode 100644 index 0000000000..fc421116ea --- /dev/null +++ b/src/nvim/aucmd.c @@ -0,0 +1,41 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + +#include "nvim/os/os.h" +#include "nvim/fileio.h" +#include "nvim/vim.h" +#include "nvim/main.h" +#include "nvim/ui.h" + +#ifdef INCLUDE_GENERATED_DECLARATIONS +# include "aucmd.c.generated.h" +#endif + +static void focusgained_event(void **argv) +{ + bool *gainedp = argv[0]; + do_autocmd_focusgained(*gainedp); + xfree(gainedp); +} +void aucmd_schedule_focusgained(bool gained) +{ + bool *gainedp = xmalloc(sizeof(*gainedp)); + *gainedp = gained; + loop_schedule_deferred(&main_loop, + event_create(focusgained_event, 1, gainedp)); +} + +static void do_autocmd_focusgained(bool gained) + FUNC_ATTR_NONNULL_ALL +{ + static bool recursive = false; + + if (recursive) { + return; // disallow recursion + } + recursive = true; + apply_autocmds((gained ? EVENT_FOCUSGAINED : EVENT_FOCUSLOST), + NULL, NULL, false, curbuf); + recursive = false; +} + diff --git a/src/nvim/aucmd.h b/src/nvim/aucmd.h new file mode 100644 index 0000000000..6570ba7a92 --- /dev/null +++ b/src/nvim/aucmd.h @@ -0,0 +1,9 @@ +#ifndef NVIM_AUCMD_H +#define NVIM_AUCMD_H + +#ifdef INCLUDE_GENERATED_DECLARATIONS +# include "aucmd.h.generated.h" +#endif + +#endif // NVIM_AUCMD_H + diff --git a/src/nvim/auevents.lua b/src/nvim/auevents.lua index 68a47c244f..7dfaf54ff0 100644 --- a/src/nvim/auevents.lua +++ b/src/nvim/auevents.lua @@ -19,6 +19,8 @@ return { 'BufWriteCmd', -- write buffer using command 'BufWritePost', -- after writing a buffer 'BufWritePre', -- before writing a buffer + 'CmdLineEnter', -- after entering cmdline mode + 'CmdLineLeave', -- before leaving cmdline mode 'CmdUndefined', -- command undefined 'CmdWinEnter', -- after entering the cmdline window 'CmdWinLeave', -- before leaving the cmdline window diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index f52989c74d..766003a021 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /* * buffer.c: functions for dealing with the buffer structure */ @@ -21,6 +24,7 @@ #include #include "nvim/api/private/handle.h" +#include "nvim/api/private/helpers.h" #include "nvim/ascii.h" #include "nvim/assert.h" #include "nvim/vim.h" @@ -60,7 +64,6 @@ #include "nvim/spell.h" #include "nvim/strings.h" #include "nvim/syntax.h" -#include "nvim/terminal.h" #include "nvim/ui.h" #include "nvim/undo.h" #include "nvim/version.h" @@ -70,6 +73,12 @@ #include "nvim/os/time.h" #include "nvim/os/input.h" +typedef enum { + kBLSUnchanged = 0, + kBLSChanged = 1, + kBLSDeleted = 2, +} BufhlLineStatus; + #ifdef INCLUDE_GENERATED_DECLARATIONS # include "buffer.c.generated.h" #endif @@ -81,6 +90,57 @@ static char *e_auabort = N_("E855: Autocommands caused command to abort"); // Number of times free_buffer() was called. static int buf_free_count = 0; +// Read data from buffer for retrying. +static int +read_buffer( + int read_stdin, // read file from stdin, otherwise fifo + exarg_T *eap, // for forced 'ff' and 'fenc' or NULL + int flags) // extra flags for readfile() +{ + int retval = OK; + linenr_T line_count; + + // + // Read from the buffer which the text is already filled in and append at + // the end. This makes it possible to retry when 'fileformat' or + // 'fileencoding' was guessed wrong. + // + line_count = curbuf->b_ml.ml_line_count; + retval = readfile( + read_stdin ? NULL : curbuf->b_ffname, + read_stdin ? NULL : curbuf->b_fname, + (linenr_T)line_count, (linenr_T)0, (linenr_T)MAXLNUM, eap, + flags | READ_BUFFER); + if (retval == OK) { + // Delete the binary lines. + while (--line_count >= 0) { + ml_delete((linenr_T)1, false); + } + } else { + // Delete the converted lines. + while (curbuf->b_ml.ml_line_count > line_count) { + ml_delete(line_count, false); + } + } + // Put the cursor on the first line. + curwin->w_cursor.lnum = 1; + curwin->w_cursor.col = 0; + + if (read_stdin) { + // Set or reset 'modified' before executing autocommands, so that + // it can be changed there. + if (!readonlymode && !bufempty()) { + changed(); + } else if (retval != FAIL) { + unchanged(curbuf, false); + } + + apply_autocmds_retval(EVENT_STDINREADPOST, NULL, NULL, false, + curbuf, &retval); + } + return retval; +} + /* * Open current buffer, that is: open the memfile and read the file into * memory. @@ -96,6 +156,7 @@ open_buffer ( int retval = OK; bufref_T old_curbuf; long old_tw = curbuf->b_p_tw; + int read_fifo = false; /* * The 'readonly' flag is only set when BF_NEVERLOADED is being reset. @@ -146,13 +207,45 @@ open_buffer ( if (curbuf->b_ffname != NULL) { int old_msg_silent = msg_silent; +#ifdef UNIX + int save_bin = curbuf->b_p_bin; + int perm; + + perm = os_getperm((const char *)curbuf->b_ffname); + if (perm >= 0 && (0 +# ifdef S_ISFIFO + || S_ISFIFO(perm) +# endif +# ifdef S_ISSOCK + || S_ISSOCK(perm) +# endif +# ifdef OPEN_CHR_FILES + || (S_ISCHR(perm) + && is_dev_fd_file(curbuf->b_ffname)) +# endif + ) + ) { + read_fifo = true; + } + if (read_fifo) { + curbuf->b_p_bin = true; + } +#endif if (shortmess(SHM_FILEINFO)) { msg_silent = 1; } retval = readfile(curbuf->b_ffname, curbuf->b_fname, (linenr_T)0, (linenr_T)0, (linenr_T)MAXLNUM, eap, - flags | READ_NEW); + flags | READ_NEW | (read_fifo ? READ_FIFO : 0)); +#ifdef UNIX + if (read_fifo) { + curbuf->b_p_bin = save_bin; + if (retval == OK) { + retval = read_buffer(false, eap, flags); + } + } +#endif msg_silent = old_msg_silent; // Help buffer is filtered. @@ -161,7 +254,6 @@ open_buffer ( } } else if (read_stdin) { int save_bin = curbuf->b_p_bin; - linenr_T line_count; /* * First read the text in binary mode into the buffer. @@ -175,41 +267,13 @@ open_buffer ( flags | (READ_NEW + READ_STDIN)); curbuf->b_p_bin = save_bin; if (retval == OK) { - line_count = curbuf->b_ml.ml_line_count; - retval = readfile(NULL, NULL, (linenr_T)line_count, - (linenr_T)0, (linenr_T)MAXLNUM, eap, - flags | READ_BUFFER); - if (retval == OK) { - /* Delete the binary lines. */ - while (--line_count >= 0) - ml_delete((linenr_T)1, FALSE); - } else { - /* Delete the converted lines. */ - while (curbuf->b_ml.ml_line_count > line_count) - ml_delete(line_count, FALSE); - } - /* Put the cursor on the first line. */ - curwin->w_cursor.lnum = 1; - curwin->w_cursor.col = 0; - - // Set or reset 'modified' before executing autocommands, so that - // it can be changed there. - if (!readonlymode && !bufempty()) { - changed(); - } else if (retval == OK) { - unchanged(curbuf, false); - } - - if (retval == OK) { - apply_autocmds_retval(EVENT_STDINREADPOST, NULL, NULL, false, - curbuf, &retval); - } + retval = read_buffer(true, eap, flags); } } /* if first time loading this buffer, init b_chartab[] */ if (curbuf->b_flags & BF_NEVERLOADED) { - (void)buf_init_chartab(curbuf, FALSE); + (void)buf_init_chartab(curbuf, false); parse_cino(curbuf); } @@ -224,7 +288,7 @@ open_buffer ( || modified_was_set // ":set modified" used in autocmd || (aborting() && vim_strchr(p_cpo, CPO_INTMOD) != NULL)) { changed(); - } else if (retval == OK && !read_stdin) { + } else if (retval != FAIL && !read_stdin && !read_fifo) { unchanged(curbuf, false); } save_file_ff(curbuf); // keep this fileformat @@ -277,19 +341,22 @@ open_buffer ( void set_bufref(bufref_T *bufref, buf_T *buf) { bufref->br_buf = buf; + bufref->br_fnum = buf->b_fnum; bufref->br_buf_free_count = buf_free_count; } -/// Check if "bufref" points to a valid buffer. -/// +/// Return true if "bufref->br_buf" points to the same buffer as when +/// set_bufref() was called and it is a valid buffer. /// Only goes through the buffer list if buf_free_count changed. +/// Also checks if b_fnum is still the same, a :bwipe followed by :new might get +/// the same allocated memory, but it's a different buffer. /// /// @param bufref Buffer reference to check for. bool bufref_valid(bufref_T *bufref) { return bufref->br_buf_free_count == buf_free_count ? true - : buf_valid(bufref->br_buf); + : buf_valid(bufref->br_buf) && bufref->br_fnum == bufref->br_buf->b_fnum; } /// Check that "buf" points to a valid buffer in the buffer list. @@ -337,6 +404,10 @@ void close_buffer(win_T *win, buf_T *buf, int action, int abort_if_last) bool del_buf = (action == DOBUF_DEL || action == DOBUF_WIPE); bool wipe_buf = (action == DOBUF_WIPE); + bool is_curwin = (curwin != NULL && curwin->w_buffer == buf); + win_T *the_curwin = curwin; + tabpage_T *the_curtab = curtab; + // Force unloading or deleting when 'bufhidden' says so, but not for terminal // buffers. // The caller must take care of NOT deleting/freeing when 'bufhidden' is @@ -360,6 +431,13 @@ void close_buffer(win_T *win, buf_T *buf, int action, int abort_if_last) wipe_buf = true; } + // Disallow deleting the buffer when it is locked (already being closed or + // halfway a command that relies on it). Unloading is allowed. + if (buf->b_locked > 0 && (del_buf || wipe_buf)) { + EMSG(_("E937: Attempt to delete a buffer that is in use")); + return; + } + if (win_valid_any_tab(win)) { // Set b_last_cursor when closing the last window for the buffer. // Remember the last cursor position and window options of the buffer. @@ -378,31 +456,31 @@ void close_buffer(win_T *win, buf_T *buf, int action, int abort_if_last) /* When the buffer is no longer in a window, trigger BufWinLeave */ if (buf->b_nwindows == 1) { - buf->b_closing = true; + buf->b_locked++; if (apply_autocmds(EVENT_BUFWINLEAVE, buf->b_fname, buf->b_fname, false, buf) && !bufref_valid(&bufref)) { // Autocommands deleted the buffer. EMSG(_(e_auabort)); return; } - buf->b_closing = false; + buf->b_locked--; if (abort_if_last && one_window()) { /* Autocommands made this the only window. */ EMSG(_(e_auabort)); return; } - /* When the buffer becomes hidden, but is not unloaded, trigger - * BufHidden */ + // When the buffer becomes hidden, but is not unloaded, trigger + // BufHidden if (!unload_buf) { - buf->b_closing = true; + buf->b_locked++; if (apply_autocmds(EVENT_BUFHIDDEN, buf->b_fname, buf->b_fname, false, buf) && !bufref_valid(&bufref)) { // Autocommands deleted the buffer. EMSG(_(e_auabort)); return; } - buf->b_closing = false; + buf->b_locked--; if (abort_if_last && one_window()) { /* Autocommands made this the only window. */ EMSG(_(e_auabort)); @@ -412,6 +490,16 @@ void close_buffer(win_T *win, buf_T *buf, int action, int abort_if_last) if (aborting()) /* autocmds may abort script processing */ return; } + + // If the buffer was in curwin and the window has changed, go back to that + // window, if it still exists. This avoids that ":edit x" triggering a + // "tabnext" BufUnload autocmd leaves a window behind without a buffer. + if (is_curwin && curwin != the_curwin && win_valid_any_tab(the_curwin)) { + block_autocmds(); + goto_tabpage_win(the_curtab, the_curwin); + unblock_autocmds(); + } + int nwindows = buf->b_nwindows; /* decrease the link count from windows (unless not in any window) */ @@ -425,7 +513,7 @@ void close_buffer(win_T *win, buf_T *buf, int action, int abort_if_last) if (buf->terminal) { terminal_close(buf->terminal, NULL); - } + } /* Always remove the buffer when there is no file name. */ if (buf->b_ffname == NULL) @@ -438,6 +526,17 @@ void close_buffer(win_T *win, buf_T *buf, int action, int abort_if_last) /* Remember if we are closing the current buffer. Restore the number of * windows, so that autocommands in buf_freeall() don't get confused. */ bool is_curbuf = (buf == curbuf); + + // When closing the current buffer stop Visual mode before freeing + // anything. + if (is_curbuf && VIsual_active +#if defined(EXITFREE) + && !entered_free_all_mem +#endif + ) { + end_visual_mode(); + } + buf->b_nwindows = nwindows; buf_freeall(buf, (del_buf ? BFA_DEL : 0) + (wipe_buf ? BFA_WIPE : 0)); @@ -548,7 +647,7 @@ void buf_freeall(buf_T *buf, int flags) tabpage_T *the_curtab = curtab; // Make sure the buffer isn't closed by autocommands. - buf->b_closing = true; + buf->b_locked++; bufref_T bufref; set_bufref(&bufref, buf); @@ -573,7 +672,7 @@ void buf_freeall(buf_T *buf, int flags) // Autocommands may delete the buffer. return; } - buf->b_closing = false; + buf->b_locked--; // If the buffer was in curwin and the window has changed, go back to that // window, if it still exists. This avoids that ":edit x" triggering a @@ -595,10 +694,11 @@ void buf_freeall(buf_T *buf, int flags) */ if (buf == curbuf && !is_curbuf) return; - diff_buf_delete(buf); /* Can't use 'diff' for unloaded buffer. */ - /* Remove any ownsyntax, unless exiting. */ - if (firstwin != NULL && curwin->w_buffer == buf) + diff_buf_delete(buf); // Can't use 'diff' for unloaded buffer. + // Remove any ownsyntax, unless exiting. + if (curwin != NULL && curwin->w_buffer == buf) { reset_synblock(curwin); + } /* No folds in an empty buffer. */ FOR_ALL_TAB_WINDOWS(tp, win) { @@ -628,7 +728,7 @@ static void free_buffer(buf_T *buf) free_buffer_stuff(buf, true); unref_var_dict(buf->b_vars); aubuflocal_remove(buf); - dict_unref(buf->additional_data); + tv_dict_unref(buf->additional_data); clear_fmark(&buf->b_last_cursor); clear_fmark(&buf->b_last_insert); clear_fmark(&buf->b_last_change); @@ -708,12 +808,13 @@ static void clear_wininfo(buf_T *buf) */ void goto_buffer(exarg_T *eap, int start, int dir, int count) { - (void)do_buffer(*eap->cmd == 's' ? DOBUF_SPLIT : DOBUF_GOTO, - start, dir, count, eap->forceit); bufref_T old_curbuf; set_bufref(&old_curbuf, curbuf); swap_exists_action = SEA_DIALOG; + (void)do_buffer(*eap->cmd == 's' ? DOBUF_SPLIT : DOBUF_GOTO, + start, dir, count, eap->forceit); + if (swap_exists_action == SEA_QUIT && *eap->cmd == 's') { cleanup_T cs; @@ -790,7 +891,7 @@ void handle_swap_exists(bufref_T *old_curbuf) * new aborting error, interrupt, or uncaught exception. */ leave_cleanup(&cs); } - swap_exists_action = SEA_NONE; + swap_exists_action = SEA_NONE; // -V519 } /* @@ -1075,6 +1176,11 @@ do_buffer ( } } + // When closing the current buffer stop Visual mode. + if (buf == curbuf && VIsual_active) { + end_visual_mode(); + } + /* * If deleting the last (listed) buffer, make it empty. * The last (listed) buffer cannot be unloaded. @@ -1095,9 +1201,9 @@ do_buffer ( * a window with this buffer. */ while (buf == curbuf - && !(curwin->w_closing || curwin->w_buffer->b_closing) - && (firstwin != lastwin || first_tabpage->tp_next != NULL)) { - if (win_close(curwin, FALSE) == FAIL) + && !(curwin->w_closing || curwin->w_buffer->b_locked > 0) + && (!ONE_WINDOW || first_tabpage->tp_next != NULL)) { + if (win_close(curwin, false) == FAIL) break; } @@ -1357,12 +1463,6 @@ void enter_buffer(buf_T *buf) /* mark cursor position as being invalid */ curwin->w_valid = 0; - if (buf->terminal) { - terminal_resize(buf->terminal, - (uint16_t)curwin->w_width, - (uint16_t)curwin->w_height); - } - /* Make sure the buffer is loaded. */ if (curbuf->b_ml.ml_mfp == NULL) { /* need to load the file */ /* If there is no filetype, allow for detecting one. Esp. useful for @@ -1434,7 +1534,7 @@ static inline void buf_init_changedtick(buf_T *const buf) { STATIC_ASSERT(sizeof("changedtick") <= sizeof(buf->changedtick_di.di_key), "buf->changedtick_di cannot hold large enough keys"); - buf->changedtick_di = (dictitem16_T) { + buf->changedtick_di = (ChangedtickDictItem) { .di_flags = DI_FLAGS_RO|DI_FLAGS_FIX, // Must not include DI_FLAGS_ALLOC. .di_tv = (typval_T) { .v_type = VAR_NUMBER, @@ -1443,7 +1543,7 @@ static inline void buf_init_changedtick(buf_T *const buf) }, .di_key = "changedtick", }; - dict_add(buf->b_vars, (dictitem_T *)&buf->changedtick_di); + tv_dict_add(buf->b_vars, (dictitem_T *)&buf->changedtick_di); } /// Add a file name to the buffer list. @@ -1535,7 +1635,7 @@ buf_T * buflist_new(char_u *ffname, char_u *sfname, linenr_T lnum, int flags) if (buf != curbuf || curbuf == NULL) { buf = xcalloc(1, sizeof(buf_T)); // init b: variables - buf->b_vars = dict_alloc(); + buf->b_vars = tv_dict_alloc(); init_var_dict(buf->b_vars, &buf->b_bufvar, VAR_SCOPE); buf_init_changedtick(buf); } @@ -1667,6 +1767,7 @@ void free_buf_options(buf_T *buf, int free_p_ff) clear_string_option(&buf->b_p_inex); clear_string_option(&buf->b_p_inde); clear_string_option(&buf->b_p_indk); + clear_string_option(&buf->b_p_fp); clear_string_option(&buf->b_p_fex); clear_string_option(&buf->b_p_kp); clear_string_option(&buf->b_p_mps); @@ -1709,16 +1810,15 @@ void free_buf_options(buf_T *buf, int free_p_ff) clear_string_option(&buf->b_p_bkc); } -/* - * get alternate file n - * set linenr to lnum or altfpos.lnum if lnum == 0 - * also set cursor column to altfpos.col if 'startofline' is not set. - * if (options & GETF_SETMARK) call setpcmark() - * if (options & GETF_ALT) we are jumping to an alternate file. - * if (options & GETF_SWITCH) respect 'switchbuf' settings when jumping - * - * return FAIL for failure, OK for success - */ + +/// Get alternate file "n". +/// Set linenr to "lnum" or altfpos.lnum if "lnum" == 0. +/// Also set cursor column to altfpos.col if 'startofline' is not set. +/// if (options & GETF_SETMARK) call setpcmark() +/// if (options & GETF_ALT) we are jumping to an alternate file. +/// if (options & GETF_SWITCH) respect 'switchbuf' settings when jumping +/// +/// Return FAIL for failure, OK for success. int buflist_getfile(int n, linenr_T lnum, int options, int forceit) { buf_T *buf; @@ -1799,9 +1899,7 @@ int buflist_getfile(int n, linenr_T lnum, int options, int forceit) return FAIL; } -/* - * go to the last know line number for the current buffer - */ +// Go to the last known line number for the current buffer. void buflist_getfpos(void) { pos_T *fpos; @@ -2275,7 +2373,7 @@ void get_winopts(buf_T *buf) /* Set 'foldlevel' to 'foldlevelstart' if it's not negative. */ if (p_fdls >= 0) curwin->w_p_fdl = p_fdls; - check_colorcolumn(curwin); + didset_window_options(curwin); } /* @@ -2299,9 +2397,7 @@ linenr_T buflist_findlnum(buf_T *buf) return buflist_findfpos(buf)->lnum; } -/* - * List all know file names (for :files and :buffers command). - */ +// List all known file names (for :files and :buffers command). void buflist_list(exarg_T *eap) { buf_T *buf; @@ -2326,12 +2422,17 @@ void buflist_list(exarg_T *eap) && (buf == curbuf || curwin->w_alt_fnum != buf->b_fnum))) { continue; } - msg_putchar('\n'); - if (buf_spname(buf) != NULL) + if (buf_spname(buf) != NULL) { STRLCPY(NameBuff, buf_spname(buf), MAXPATHL); - else - home_replace(buf, buf->b_fname, NameBuff, MAXPATHL, TRUE); + } else { + home_replace(buf, buf->b_fname, NameBuff, MAXPATHL, true); + } + if (message_filtered(NameBuff)) { + continue; + } + + msg_putchar('\n'); len = vim_snprintf((char *)IObuff, IOSIZE - 20, "%3d%c%c%c%c%c \"%s\"", buf->b_fnum, buf->b_p_bl ? ' ' : 'u', @@ -2685,7 +2786,7 @@ fileinfo ( else name = curbuf->b_ffname; home_replace(shorthelp ? curbuf : NULL, name, p, - (int)(IOSIZE - (p - buffer)), TRUE); + (size_t)(IOSIZE - (p - buffer)), true); } vim_snprintf_add((char *)buffer, IOSIZE, "\"%s%s%s%s%s%s", @@ -2850,7 +2951,7 @@ void maketitle(void) buf[off++] = ' '; buf[off++] = '('; home_replace(curbuf, curbuf->b_ffname, - buf + off, SPACE_FOR_DIR - off, TRUE); + buf + off, (size_t)(SPACE_FOR_DIR - off), true); #ifdef BACKSLASH_IN_FILENAME /* avoid "c:/name" to be reduced to "c" */ if (isalpha(buf[off]) && buf[off + 1] == ':') @@ -2957,13 +3058,13 @@ static bool ti_change(char_u *str, char_u **last) return false; } -/* - * Put current window title back (used after calling a shell) - */ + +/// Set current window title void resettitle(void) { - ui_set_title((char *)lasttitle); - ui_set_icon((char *)lasticon); + ui_call_set_icon(cstr_as_string((char *)lasticon)); + ui_call_set_title(cstr_as_string((char *)lasttitle)); + ui_flush(); } # if defined(EXITFREE) @@ -3021,7 +3122,7 @@ int build_stl_str_hl( StlClickRecord *tabtab ) { - int groupitem[STL_MAX_ITEM]; + int groupitems[STL_MAX_ITEM]; struct stl_item { // Where the item starts in the status line output buffer char_u *start; @@ -3041,7 +3142,7 @@ int build_stl_str_hl( ClickFunc, Trunc } type; - } item[STL_MAX_ITEM]; + } items[STL_MAX_ITEM]; #define TMPLEN 70 char_u tmp[TMPLEN]; char_u *usefmt = fmt; @@ -3143,16 +3244,16 @@ int build_stl_str_hl( if (groupdepth > 0) { continue; } - item[curitem].type = Separate; - item[curitem++].start = out_p; + items[curitem].type = Separate; + items[curitem++].start = out_p; continue; } // STL_TRUNCMARK: Where to begin truncating if the statusline is too long. if (*fmt_p == STL_TRUNCMARK) { fmt_p++; - item[curitem].type = Trunc; - item[curitem++].start = out_p; + items[curitem].type = Trunc; + items[curitem++].start = out_p; continue; } @@ -3168,7 +3269,7 @@ int build_stl_str_hl( // Determine how long the group is. // Note: We set the current output position to null // so `vim_strsize` will work. - char_u *t = item[groupitem[groupdepth]].start; + char_u *t = items[groupitems[groupdepth]].start; *out_p = NUL; long group_len = vim_strsize(t); @@ -3178,11 +3279,11 @@ int build_stl_str_hl( // move the output pointer back to where the group started. // Note: This erases any non-item characters that were in the group. // Otherwise there would be no reason to do this step. - if (curitem > groupitem[groupdepth] + 1 - && item[groupitem[groupdepth]].minwid == 0) { + if (curitem > groupitems[groupdepth] + 1 + && items[groupitems[groupdepth]].minwid == 0) { bool has_normal_items = false; - for (long n = groupitem[groupdepth] + 1; n < curitem; n++) { - if (item[n].type == Normal || item[n].type == Highlight) { + for (long n = groupitems[groupdepth] + 1; n < curitem; n++) { + if (items[n].type == Normal || items[n].type == Highlight) { has_normal_items = true; break; } @@ -3196,18 +3297,18 @@ int build_stl_str_hl( // If the group is longer than it is allowed to be // truncate by removing bytes from the start of the group text. - if (group_len > item[groupitem[groupdepth]].maxwid) { + if (group_len > items[groupitems[groupdepth]].maxwid) { // { Determine the number of bytes to remove long n; if (has_mbyte) { /* Find the first character that should be included. */ n = 0; - while (group_len >= item[groupitem[groupdepth]].maxwid) { + while (group_len >= items[groupitems[groupdepth]].maxwid) { group_len -= ptr2cells(t + n); n += (*mb_ptr2len)(t + n); } } else { - n = (long)(out_p - t) - item[groupitem[groupdepth]].maxwid + 1; + n = (long)(out_p - t) - items[groupitems[groupdepth]].maxwid + 1; } // } @@ -3217,25 +3318,26 @@ int build_stl_str_hl( // { Move the truncated output memmove(t + 1, t + n, (size_t)(out_p - (t + n))); out_p = out_p - n + 1; - /* Fill up space left over by half a double-wide char. */ - while (++group_len < item[groupitem[groupdepth]].minwid) + // Fill up space left over by half a double-wide char. + while (++group_len < items[groupitems[groupdepth]].minwid) { *out_p++ = fillchar; + } // } - /* correct the start of the items for the truncation */ - for (int idx = groupitem[groupdepth] + 1; idx < curitem; idx++) { + // correct the start of the items for the truncation + for (int idx = groupitems[groupdepth] + 1; idx < curitem; idx++) { // Shift everything back by the number of removed bytes - item[idx].start -= n; + items[idx].start -= n; // If the item was partially or completely truncated, set its // start to the start of the group - if (item[idx].start < t) { - item[idx].start = t; + if (items[idx].start < t) { + items[idx].start = t; } } // If the group is shorter than the minimum width, add padding characters. - } else if (abs(item[groupitem[groupdepth]].minwid) > group_len) { - long min_group_width = item[groupitem[groupdepth]].minwid; + } else if (abs(items[groupitems[groupdepth]].minwid) > group_len) { + long min_group_width = items[groupitems[groupdepth]].minwid; // If the group is left-aligned, add characters to the right. if (min_group_width < 0) { min_group_width = 0 - min_group_width; @@ -3254,8 +3356,8 @@ int build_stl_str_hl( // } // Adjust item start positions - for (int n = groupitem[groupdepth] + 1; n < curitem; n++) { - item[n].start += group_len; + for (int n = groupitems[groupdepth] + 1; n < curitem; n++) { + items[n].start += group_len; } // Prepend the fill characters @@ -3293,9 +3395,9 @@ int build_stl_str_hl( // User highlight groups override the min width field // to denote the styling to use. if (*fmt_p == STL_USER_HL) { - item[curitem].type = Highlight; - item[curitem].start = out_p; - item[curitem].minwid = minwid > 9 ? 1 : minwid; + items[curitem].type = Highlight; + items[curitem].start = out_p; + items[curitem].minwid = minwid > 9 ? 1 : minwid; fmt_p++; curitem++; continue; @@ -3327,20 +3429,21 @@ int build_stl_str_hl( if (*fmt_p == STL_TABPAGENR || *fmt_p == STL_TABCLOSENR) { if (*fmt_p == STL_TABCLOSENR) { if (minwid == 0) { - /* %X ends the close label, go back to the previously - * define tab label nr. */ - for (long n = curitem - 1; n >= 0; --n) - if (item[n].type == TabPage && item[n].minwid >= 0) { - minwid = item[n].minwid; + // %X ends the close label, go back to the previous tab label nr. + for (long n = curitem - 1; n >= 0; n--) { + if (items[n].type == TabPage && items[n].minwid >= 0) { + minwid = items[n].minwid; break; } - } else - /* close nrs are stored as negative values */ + } + } else { + // close nrs are stored as negative values minwid = -minwid; + } } - item[curitem].type = TabPage; - item[curitem].start = out_p; - item[curitem].minwid = minwid; + items[curitem].type = TabPage; + items[curitem].start = out_p; + items[curitem].minwid = minwid; fmt_p++; curitem++; continue; @@ -3355,10 +3458,10 @@ int build_stl_str_hl( if (*fmt_p != STL_CLICK_FUNC) { break; } - item[curitem].type = ClickFunc; - item[curitem].start = out_p; - item[curitem].cmd = xmemdupz(t, (size_t) (((char *) fmt_p - t))); - item[curitem].minwid = minwid; + items[curitem].type = ClickFunc; + items[curitem].start = out_p; + items[curitem].cmd = xmemdupz(t, (size_t)(((char *)fmt_p - t))); + items[curitem].minwid = minwid; fmt_p++; curitem++; continue; @@ -3381,11 +3484,11 @@ int build_stl_str_hl( // Denotes the start of a new group if (*fmt_p == '(') { - groupitem[groupdepth++] = curitem; - item[curitem].type = Group; - item[curitem].start = out_p; - item[curitem].minwid = minwid; - item[curitem].maxwid = maxwid; + groupitems[groupdepth++] = curitem; + items[curitem].type = Group; + items[curitem].start = out_p; + items[curitem].minwid = minwid; + items[curitem].maxwid = maxwid; fmt_p++; curitem++; continue; @@ -3412,7 +3515,7 @@ int build_stl_str_hl( case STL_FULLPATH: case STL_FILENAME: { - // Set fillable to false to that ' ' in the filename will not + // Set fillable to false so that ' ' in the filename will not // get replaced with the fillchar fillable = false; if (buf_spname(wp->w_buffer) != NULL) { @@ -3465,7 +3568,7 @@ int build_stl_str_hl( curbuf = o_curbuf; // Remove the variable we just stored - do_unlet((char_u *)"g:actual_curbuf", true); + do_unlet(S_LEN("g:actual_curbuf"), true); // } @@ -3560,6 +3663,7 @@ int build_stl_str_hl( case STL_OFFSET_X: base = kNumBaseHexadecimal; + // fallthrough case STL_OFFSET: { long l = ml_find_line_or_offset(wp->w_buffer, wp->w_cursor.lnum, NULL); @@ -3570,6 +3674,7 @@ int build_stl_str_hl( } case STL_BYTEVAL_X: base = kNumBaseHexadecimal; + // fallthrough case STL_BYTEVAL: num = byteval; if (num == NL) @@ -3664,9 +3769,9 @@ int build_stl_str_hl( // Create a highlight item based on the name if (*fmt_p == '#') { - item[curitem].type = Highlight; - item[curitem].start = out_p; - item[curitem].minwid = -syn_namen2id(t, (int)(fmt_p - t)); + items[curitem].type = Highlight; + items[curitem].start = out_p; + items[curitem].minwid = -syn_namen2id(t, (int)(fmt_p - t)); curitem++; fmt_p++; } @@ -3677,8 +3782,8 @@ int build_stl_str_hl( // If we made it this far, the item is normal and starts at // our current position in the output buffer. // Non-normal items would have `continued`. - item[curitem].start = out_p; - item[curitem].type = Normal; + items[curitem].start = out_p; + items[curitem].type = Normal; // Copy the item string into the output buffer if (str != NULL && *str) { @@ -3835,7 +3940,7 @@ int build_stl_str_hl( // Otherwise, there was nothing to print so mark the item as empty } else { - item[curitem].type = Empty; + items[curitem].type = Empty; } // Only free the string buffer if we allocated it. @@ -3860,8 +3965,7 @@ int build_stl_str_hl( } // We have now processed the entire statusline format string. - // What follows is post-processing to handle alignment and - // highlighting factors. + // What follows is post-processing to handle alignment and highlighting. int width = vim_strsize(out); if (maxwidth > 0 && width > maxwidth) { @@ -3876,16 +3980,17 @@ int build_stl_str_hl( // Otherwise, look for the truncation item } else { // Default to truncating at the first item - trunc_p = item[0].start; + trunc_p = items[0].start; item_idx = 0; - for (int i = 0; i < itemcnt; i++) - if (item[i].type == Trunc) { - // Truncate at %< item. - trunc_p = item[i].start; + for (int i = 0; i < itemcnt; i++) { + if (items[i].type == Trunc) { + // Truncate at %< items. + trunc_p = items[i].start; item_idx = i; break; } + } } // If the truncation point we found is beyond the maximum @@ -3915,7 +4020,7 @@ int build_stl_str_hl( // Ignore any items in the statusline that occur after // the truncation point for (int i = 0; i < itemcnt; i++) { - if (item[i].start > trunc_p) { + if (items[i].start > trunc_p) { itemcnt = i; break; } @@ -3970,12 +4075,12 @@ int build_stl_str_hl( for (int i = item_idx; i < itemcnt; i++) { // Items starting at or after the end of the truncated section need // to be moved backwards. - if (item[i].start >= trunc_end_p) { - item[i].start -= item_offset; + if (items[i].start >= trunc_end_p) { + items[i].start -= item_offset; // Anything inside the truncated area is set to start // at the `<` truncation character. } else { - item[i].start = trunc_p; + items[i].start = trunc_p; } } // } @@ -3991,7 +4096,7 @@ int build_stl_str_hl( // figuring out how many groups there are. int num_separators = 0; for (int i = 0; i < itemcnt; i++) { - if (item[i].type == Separate) { + if (items[i].type == Separate) { num_separators++; } } @@ -4003,7 +4108,7 @@ int build_stl_str_hl( int separator_locations[STL_MAX_ITEM]; int index = 0; for (int i = 0; i < itemcnt; i++) { - if (item[i].type == Separate) { + if (items[i].type == Separate) { separator_locations[index] = i; index++; } @@ -4014,18 +4119,18 @@ int build_stl_str_hl( standard_spaces * (num_separators - 1); for (int i = 0; i < num_separators; i++) { - int dislocation = (i == (num_separators - 1)) ? - final_spaces : standard_spaces; - char_u *sep_loc = item[separator_locations[i]].start + dislocation; - STRMOVE(sep_loc, item[separator_locations[i]].start); - for (char_u *s = item[separator_locations[i]].start; s < sep_loc; s++) { + int dislocation = (i == (num_separators - 1)) + ? final_spaces : standard_spaces; + char_u *seploc = items[separator_locations[i]].start + dislocation; + STRMOVE(seploc, items[separator_locations[i]].start); + for (char_u *s = items[separator_locations[i]].start; s < seploc; s++) { *s = fillchar; } for (int item_idx = separator_locations[i] + 1; item_idx < itemcnt; item_idx++) { - item[item_idx].start += dislocation; + items[item_idx].start += dislocation; } } @@ -4037,9 +4142,9 @@ int build_stl_str_hl( if (hltab != NULL) { struct stl_hlrec *sp = hltab; for (long l = 0; l < itemcnt; l++) { - if (item[l].type == Highlight) { - sp->start = item[l].start; - sp->userhl = item[l].minwid; + if (items[l].type == Highlight) { + sp->start = items[l].start; + sp->userhl = items[l].minwid; sp++; } } @@ -4051,14 +4156,14 @@ int build_stl_str_hl( if (tabtab != NULL) { StlClickRecord *cur_tab_rec = tabtab; for (long l = 0; l < itemcnt; l++) { - if (item[l].type == TabPage) { - cur_tab_rec->start = (char *) item[l].start; - if (item[l].minwid == 0) { + if (items[l].type == TabPage) { + cur_tab_rec->start = (char *)items[l].start; + if (items[l].minwid == 0) { cur_tab_rec->def.type = kStlClickDisabled; cur_tab_rec->def.tabnr = 0; } else { - int tabnr = item[l].minwid; - if (item[l].minwid > 0) { + int tabnr = items[l].minwid; + if (items[l].minwid > 0) { cur_tab_rec->def.type = kStlClickTabSwitch; } else { cur_tab_rec->def.type = kStlClickTabClose; @@ -4068,11 +4173,11 @@ int build_stl_str_hl( } cur_tab_rec->def.func = NULL; cur_tab_rec++; - } else if (item[l].type == ClickFunc) { - cur_tab_rec->start = (char *) item[l].start; + } else if (items[l].type == ClickFunc) { + cur_tab_rec->start = (char *)items[l].start; cur_tab_rec->def.type = kStlClickFuncRun; - cur_tab_rec->def.tabnr = item[l].minwid; - cur_tab_rec->def.func = item[l].cmd; + cur_tab_rec->def.tabnr = items[l].minwid; + cur_tab_rec->def.func = items[l].cmd; cur_tab_rec++; } } @@ -4168,11 +4273,11 @@ void fname_expand(buf_T *buf, char_u **ffname, char_u **sfname) #ifdef WIN32 if (!buf->b_p_bin) { // If the file name is a shortcut file, use the file it links to. - char_u *rfname = (char_u *)os_resolve_shortcut(*ffname); + char *rfname = os_resolve_shortcut((const char *)(*ffname)); if (rfname != NULL) { xfree(*ffname); - *ffname = rfname; - *sfname = rfname; + *ffname = (char_u *)rfname; + *sfname = (char_u *)rfname; } } #endif @@ -4316,15 +4421,17 @@ do_arg_all ( continue; } } - /* don't close last window */ - if (firstwin == lastwin - && (first_tabpage->tp_next == NULL || !had_tab)) - use_firstwin = TRUE; - else { + // don't close last window + if (ONE_WINDOW + && (first_tabpage->tp_next == NULL || !had_tab)) { + use_firstwin = true; + } else { win_close(wp, !P_HID(buf) && !bufIsChanged(buf)); - /* check if autocommands removed the next window */ - if (!win_valid(wpnext)) - wpnext = firstwin; /* start all over... */ + // check if autocommands removed the next window + if (!win_valid(wpnext)) { + // start all over... + wpnext = firstwin; + } } } } @@ -4480,9 +4587,9 @@ void ex_buffer_all(exarg_T *eap) ? wp->w_height + wp->w_status_height < Rows - p_ch - tabline_height() : wp->w_width != Columns) - || (had_tab > 0 && wp != firstwin) - ) && firstwin != lastwin - && !(wp->w_closing || wp->w_buffer->b_closing) + || (had_tab > 0 && wp != firstwin)) + && !ONE_WINDOW + && !(wp->w_closing || wp->w_buffer->b_locked > 0) ) { win_close(wp, FALSE); wpnext = firstwin; /* just in case an autocommand does @@ -5087,6 +5194,30 @@ void sign_mark_adjust(linenr_T line1, linenr_T line2, long amount, long amount_a // bufhl: plugin highlights associated with a buffer +/// Get reference to line in kbtree_t +/// +/// @param b the three +/// @param line the linenumber to lookup +/// @param put if true, put a new line when not found +/// if false, return NULL when not found +BufhlLine *bufhl_tree_ref(BufhlInfo *b, linenr_T line, bool put) +{ + BufhlLine t = BUFHLLINE_INIT(line); + + // kp_put() only works if key is absent, try get first + BufhlLine **pp = kb_get(bufhl, b, &t); + if (pp) { + return *pp; + } else if (!put) { + return NULL; + } + + BufhlLine *p = xmalloc(sizeof(*p)); + *p = (BufhlLine)BUFHLLINE_INIT(line); + kb_put(bufhl, b, p); + return p; +} + /// Adds a highlight to buffer. /// /// Unlike matchaddpos() highlights follow changes to line numbering (as lines @@ -5124,13 +5255,10 @@ int bufhl_add_hl(buf_T *buf, // no highlight group or invalid line, just return src_id return src_id; } - if (!buf->b_bufhl_info) { - buf->b_bufhl_info = map_new(linenr_T, bufhl_vec_T)(); - } - bufhl_vec_T* lineinfo = map_ref(linenr_T, bufhl_vec_T)(buf->b_bufhl_info, - lnum, true); - bufhl_hl_item_T *hlentry = kv_pushp(*lineinfo); + BufhlLine *lineinfo = bufhl_tree_ref(&buf->b_bufhl_info, lnum, true); + + BufhlItem *hlentry = kv_pushp(lineinfo->items); hlentry->src_id = src_id; hlentry->hl_id = hl_id; hlentry->start = col_start; @@ -5143,6 +5271,44 @@ int bufhl_add_hl(buf_T *buf, return src_id; } +/// Add highlighting to a buffer, bounded by two cursor positions, +/// with an offset. +/// +/// @param buf Buffer to add highlights to +/// @param src_id src_id to use or 0 to use a new src_id group, +/// or -1 for ungrouped highlight. +/// @param hl_id Highlight group id +/// @param pos_start Cursor position to start the hightlighting at +/// @param pos_end Cursor position to end the highlighting at +/// @param offset Move the whole highlighting this many columns to the right +void bufhl_add_hl_pos_offset(buf_T *buf, + int src_id, + int hl_id, + lpos_T pos_start, + lpos_T pos_end, + colnr_T offset) +{ + colnr_T hl_start = 0; + colnr_T hl_end = 0; + + for (linenr_T lnum = pos_start.lnum; lnum <= pos_end.lnum; lnum ++) { + if (pos_start.lnum < lnum && lnum < pos_end.lnum) { + hl_start = offset; + hl_end = MAXCOL; + } else if (lnum == pos_start.lnum && lnum < pos_end.lnum) { + hl_start = pos_start.col + offset + 1; + hl_end = MAXCOL; + } else if (pos_start.lnum < lnum && lnum == pos_end.lnum) { + hl_start = offset; + hl_end = pos_end.col + offset; + } else if (pos_start.lnum == lnum && pos_end.lnum == lnum) { + hl_start = pos_start.col + offset + 1; + hl_end = pos_end.col + offset; + } + (void)bufhl_add_hl(buf, src_id, hl_id, lnum, hl_start, hl_end); + } +} + /// Clear bufhl highlights from a given source group and range of lines. /// /// @param buf The buffer to remove highlights from @@ -5152,20 +5318,24 @@ int bufhl_add_hl(buf_T *buf, void bufhl_clear_line_range(buf_T *buf, int src_id, linenr_T line_start, - linenr_T line_end) { - if (!buf->b_bufhl_info) { - return; - } - linenr_T line; + linenr_T line_end) +{ linenr_T first_changed = MAXLNUM, last_changed = -1; - // In the case line_start - line_end << bufhl_info->size - // it might be better to reverse this, i e loop over the lines - // to clear on. - bufhl_vec_T unused; - map_foreach(buf->b_bufhl_info, line, unused, { - (void)unused; + + kbitr_t(bufhl) itr; + BufhlLine *l, t = BUFHLLINE_INIT(line_start); + if (!kb_itr_get(bufhl, &buf->b_bufhl_info, &t, &itr)) { + kb_itr_next(bufhl, &buf->b_bufhl_info, &itr); + } + for (; kb_itr_valid(&itr); kb_itr_next(bufhl, &buf->b_bufhl_info, &itr)) { + l = kb_itr_key(&itr); + linenr_T line = l->line; + if (line > line_end) { + break; + } if (line_start <= line && line <= line_end) { - if (bufhl_clear_line(buf->b_bufhl_info, src_id, line)) { + BufhlLineStatus status = bufhl_clear_line(l, src_id, line); + if (status != kBLSUnchanged) { if (line > last_changed) { last_changed = line; } @@ -5173,8 +5343,12 @@ void bufhl_clear_line_range(buf_T *buf, first_changed = line; } } + if (status == kBLSDeleted) { + kb_del_itr(bufhl, &buf->b_bufhl_info, &itr); + xfree(l); + } } - }) + } if (last_changed != -1) { changed_lines_buf(buf, first_changed, last_changed+1, 0); @@ -5187,42 +5361,40 @@ void bufhl_clear_line_range(buf_T *buf, /// @param bufhl_info The highlight info for the buffer /// @param src_id Highlight source group to clear, or -1 to clear all groups. /// @param lnum Linenr where the highlight should be cleared -static bool bufhl_clear_line(bufhl_info_T *bufhl_info, int src_id, - linenr_T lnum) +static BufhlLineStatus bufhl_clear_line(BufhlLine *lineinfo, int src_id, + linenr_T lnum) { - bufhl_vec_T *lineinfo = map_ref(linenr_T, bufhl_vec_T)(bufhl_info, - lnum, false); - size_t oldsize = kv_size(*lineinfo); + size_t oldsize = kv_size(lineinfo->items); if (src_id < 0) { - kv_size(*lineinfo) = 0; + kv_size(lineinfo->items) = 0; } else { - size_t newind = 0; - for (size_t i = 0; i < kv_size(*lineinfo); i++) { - if (kv_A(*lineinfo, i).src_id != src_id) { - if (i != newind) { - kv_A(*lineinfo, newind) = kv_A(*lineinfo, i); + size_t newidx = 0; + for (size_t i = 0; i < kv_size(lineinfo->items); i++) { + if (kv_A(lineinfo->items, i).src_id != src_id) { + if (i != newidx) { + kv_A(lineinfo->items, newidx) = kv_A(lineinfo->items, i); } - newind++; + newidx++; } } - kv_size(*lineinfo) = newind; + kv_size(lineinfo->items) = newidx; } - if (kv_size(*lineinfo) == 0) { - kv_destroy(*lineinfo); - map_del(linenr_T, bufhl_vec_T)(bufhl_info, lnum); + if (kv_size(lineinfo->items) == 0) { + kv_destroy(lineinfo->items); + return kBLSDeleted; } - return kv_size(*lineinfo) != oldsize; + return kv_size(lineinfo->items) != oldsize ? kBLSChanged : kBLSUnchanged; } /// Remove all highlights and free the highlight data -void bufhl_clear_all(buf_T* buf) { - if (!buf->b_bufhl_info) { - return; - } +void bufhl_clear_all(buf_T *buf) +{ bufhl_clear_line_range(buf, -1, 1, MAXLNUM); - map_free(linenr_T, bufhl_vec_T)(buf->b_bufhl_info); - buf->b_bufhl_info = NULL; + kb_destroy(bufhl, (&buf->b_bufhl_info)); + kb_init(&buf->b_bufhl_info); + kv_destroy(buf->b_bufhl_move_space); + kv_init(buf->b_bufhl_move_space); } /// Adjust a placed highlight for inserted/deleted lines. @@ -5230,29 +5402,49 @@ void bufhl_mark_adjust(buf_T* buf, linenr_T line1, linenr_T line2, long amount, - long amount_after) { - if (!buf->b_bufhl_info) { + long amount_after, + bool end_temp) +{ + kbitr_t(bufhl) itr; + BufhlLine *l, t = BUFHLLINE_INIT(line1); + if (end_temp && amount < 0) { + // Move all items from b_bufhl_move_space to the btree. + for (size_t i = 0; i < kv_size(buf->b_bufhl_move_space); i++) { + l = kv_A(buf->b_bufhl_move_space, i); + l->line += amount; + kb_put(bufhl, &buf->b_bufhl_info, l); + } + kv_size(buf->b_bufhl_move_space) = 0; return; } - bufhl_info_T *newmap = map_new(linenr_T, bufhl_vec_T)(); - linenr_T line; - bufhl_vec_T lineinfo; - map_foreach(buf->b_bufhl_info, line, lineinfo, { - if (line >= line1 && line <= line2) { - if (amount == MAXLNUM) { - bufhl_clear_line(buf->b_bufhl_info, -1, line); - continue; - } else { - line += amount; + if (!kb_itr_get(bufhl, &buf->b_bufhl_info, &t, &itr)) { + kb_itr_next(bufhl, &buf->b_bufhl_info, &itr); + } + for (; kb_itr_valid(&itr); kb_itr_next(bufhl, &buf->b_bufhl_info, &itr)) { + l = kb_itr_key(&itr); + if (l->line >= line1 && l->line <= line2) { + if (end_temp && amount > 0) { + kb_del_itr(bufhl, &buf->b_bufhl_info, &itr); + kv_push(buf->b_bufhl_move_space, l); } - } else if (line > line2) { - line += amount_after; + if (amount == MAXLNUM) { + if (bufhl_clear_line(l, -1, l->line) == kBLSDeleted) { + kb_del_itr(bufhl, &buf->b_bufhl_info, &itr); + xfree(l); + } else { + assert(false); + } + } else { + l->line += amount; + } + } else if (l->line > line2) { + if (amount_after == 0) { + break; + } + l->line += amount_after; } - map_put(linenr_T, bufhl_vec_T)(newmap, line, lineinfo); - }); - map_free(linenr_T, bufhl_vec_T)(buf->b_bufhl_info); - buf->b_bufhl_info = newmap; + } } @@ -5262,13 +5454,14 @@ void bufhl_mark_adjust(buf_T* buf, /// @param lnum The line number /// @param[out] info The highligts for the line /// @return true if there was highlights to display -bool bufhl_start_line(buf_T *buf, linenr_T lnum, bufhl_lineinfo_T *info) { - if (!buf->b_bufhl_info) { +bool bufhl_start_line(buf_T *buf, linenr_T lnum, BufhlLineInfo *info) +{ + BufhlLine *lineinfo = bufhl_tree_ref(&buf->b_bufhl_info, lnum, false); + if (!lineinfo) { return false; } - info->valid_to = -1; - info->entries = map_get(linenr_T, bufhl_vec_T)(buf->b_bufhl_info, lnum); + info->entries = lineinfo->items; return kv_size(info->entries) > 0; } @@ -5282,14 +5475,15 @@ bool bufhl_start_line(buf_T *buf, linenr_T lnum, bufhl_lineinfo_T *info) { /// @param info The info returned by bufhl_start_line /// @param col The column to get the attr for /// @return The highilight attr to display at the column -int bufhl_get_attr(bufhl_lineinfo_T *info, colnr_T col) { +int bufhl_get_attr(BufhlLineInfo *info, colnr_T col) +{ if (col <= info->valid_to) { return info->current; } int attr = 0; info->valid_to = MAXCOL; for (size_t i = 0; i < kv_size(info->entries); i++) { - bufhl_hl_item_T entry = kv_A(info->entries, i); + BufhlItem entry = kv_A(info->entries, i); if (entry.start <= col && col <= entry.stop) { int entry_attr = syn_id2attr(entry.hl_id); attr = hl_combine_attr(attr, entry_attr); @@ -5404,8 +5598,8 @@ void buf_open_scratch(handle_T bufnr, char *bufname) { (void)do_ecmd((int)bufnr, NULL, NULL, NULL, ECMD_ONE, ECMD_HIDE, NULL); (void)setfname(curbuf, (char_u *)bufname, NULL, true); - set_option_value((char_u *)"bh", 0L, (char_u *)"hide", OPT_LOCAL); - set_option_value((char_u *)"bt", 0L, (char_u *)"nofile", OPT_LOCAL); - set_option_value((char_u *)"swf", 0L, NULL, OPT_LOCAL); + set_option_value("bh", 0L, "hide", OPT_LOCAL); + set_option_value("bt", 0L, "nofile", OPT_LOCAL); + set_option_value("swf", 0L, NULL, OPT_LOCAL); RESET_BINDING(curwin); } diff --git a/src/nvim/buffer.h b/src/nvim/buffer.h index ed3e6ab6cc..faeeed121c 100644 --- a/src/nvim/buffer.h +++ b/src/nvim/buffer.h @@ -1,12 +1,14 @@ #ifndef NVIM_BUFFER_H #define NVIM_BUFFER_H +#include "nvim/vim.h" #include "nvim/window.h" #include "nvim/pos.h" // for linenr_T #include "nvim/ex_cmds_defs.h" // for exarg_T #include "nvim/screen.h" // for StlClickRecord #include "nvim/func_attr.h" #include "nvim/eval.h" +#include "nvim/macros.h" // Values for buflist_getfile() enum getf_values { @@ -81,18 +83,20 @@ static inline void restore_win_for_buf(win_T *save_curwin, } } -static inline void buf_set_changedtick(buf_T *const buf, const int changedtick) +static inline void buf_set_changedtick(buf_T *const buf, + const varnumber_T changedtick) REAL_FATTR_NONNULL_ALL REAL_FATTR_ALWAYS_INLINE; /// Set b_changedtick and corresponding variable /// /// @param[out] buf Buffer to set changedtick in. /// @param[in] changedtick New value. -static inline void buf_set_changedtick(buf_T *const buf, const int changedtick) +static inline void buf_set_changedtick(buf_T *const buf, + const varnumber_T changedtick) { #ifndef NDEBUG - dictitem_T *const changedtick_di = dict_find( - buf->b_vars, (char_u *)"changedtick", sizeof("changedtick") - 1); + dictitem_T *const changedtick_di = tv_dict_find( + buf->b_vars, S_LEN("changedtick")); assert(changedtick_di != NULL); assert(changedtick_di->di_tv.v_type == VAR_NUMBER); assert(changedtick_di->di_tv.v_lock == VAR_FIXED); @@ -101,7 +105,8 @@ static inline void buf_set_changedtick(buf_T *const buf, const int changedtick) assert(changedtick_di->di_flags == (DI_FLAGS_RO|DI_FLAGS_FIX)); # endif assert(changedtick_di == (dictitem_T *)&buf->changedtick_di); - assert(&buf->b_changedtick == &buf->changedtick_di.di_tv.vval.v_number); + assert(&buf->b_changedtick // -V501 + == &buf->changedtick_di.di_tv.vval.v_number); #endif buf->b_changedtick = changedtick; } @@ -110,7 +115,7 @@ static inline void buf_set_changedtick(buf_T *const buf, const int changedtick) do { \ win_T *save_curwin = NULL; \ tabpage_T *save_curtab = NULL; \ - bufref_T save_curbuf = { NULL, 0 }; \ + bufref_T save_curbuf = { NULL, 0, 0 }; \ switch_to_win_for_buf(b, &save_curwin, &save_curtab, &save_curbuf); \ code; \ restore_win_for_buf(save_curwin, save_curtab, &save_curbuf); \ diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h index 3e9767adde..f1cbcb2627 100644 --- a/src/nvim/buffer_defs.h +++ b/src/nvim/buffer_defs.h @@ -12,17 +12,18 @@ typedef struct file_buffer buf_T; // Forward declaration // bufref_valid() only needs to check "buf" when the count differs. typedef struct { buf_T *br_buf; + int br_fnum; int br_buf_free_count; } bufref_T; // for garray_T #include "nvim/garray.h" +// for HLF_COUNT +#include "nvim/highlight_defs.h" // for pos_T, lpos_T and linenr_T #include "nvim/pos.h" // for the number window-local and buffer-local options #include "nvim/option_defs.h" -// for optional iconv support -#include "nvim/iconv.h" // for jump list and tag stack sizes in a buffer and mark types #include "nvim/mark_defs.h" // for u_header_T; needs buf_T. @@ -30,7 +31,9 @@ typedef struct { // for hashtab_T #include "nvim/hashtab.h" // for dict_T -#include "nvim/eval_defs.h" +#include "nvim/eval/typval.h" +// for proftime_T +#include "nvim/profile.h" // for String #include "nvim/api/private/defs.h" // for Map(K, V) @@ -103,8 +106,6 @@ typedef struct frame_S frame_T; // for bufhl_*_T #include "nvim/bufhl_defs.h" -typedef Map(linenr_T, bufhl_vec_T) bufhl_info_T; - #include "nvim/os/fs_defs.h" // for FileID #include "nvim/terminal.h" // for Terminal @@ -233,6 +234,8 @@ typedef struct { # define w_p_crb_save w_onebuf_opt.wo_crb_save char_u *wo_scl; # define w_p_scl w_onebuf_opt.wo_scl // 'signcolumn' + char_u *wo_winhl; +# define w_p_winhl w_onebuf_opt.wo_winhl // 'winhighlight' int wo_scriptID[WV_COUNT]; /* SIDs for window-local options */ # define w_p_scriptID w_onebuf_opt.wo_scriptID @@ -318,25 +321,6 @@ typedef struct { String save_inputbuf; } tasave_T; -/* - * Used for conversion of terminal I/O and script files. - */ -typedef struct { - int vc_type; /* zero or one of the CONV_ values */ - int vc_factor; /* max. expansion factor */ -# ifdef USE_ICONV - iconv_t vc_fd; /* for CONV_ICONV */ -# endif - bool vc_fail; /* fail for invalid char, don't use '?' */ -} vimconv_T; - -#define CONV_NONE 0 -#define CONV_TO_UTF8 1 -#define CONV_9_TO_UTF8 2 -#define CONV_TO_LATIN1 3 -#define CONV_TO_LATIN9 4 -#define CONV_ICONV 5 - /* * Structure used for mappings and abbreviations. */ @@ -447,10 +431,17 @@ typedef struct { char_u *b_syn_isk; // iskeyword option } synblock_T; +/// Type used for changedtick_di member in buf_T +/// +/// Primary exists so that literals of relevant type can be made. +typedef TV_DICTITEM_STRUCT(sizeof("changedtick")) ChangedtickDictItem; #define BUF_HAS_QF_ENTRY 1 #define BUF_HAS_LL_ENTRY 2 +// Maximum number of maphash blocks we will have +#define MAX_MAPHASH 256 + /* * buffer: structure that holds information about one file * @@ -470,9 +461,9 @@ struct file_buffer { int b_nwindows; /* nr of windows open on this buffer */ - int b_flags; /* various BF_ flags */ - bool b_closing; /* buffer is being closed, don't let - autocommands close it too. */ + int b_flags; // various BF_ flags + int b_locked; // Buffer is being closed or referenced, don't + // let autocommands wipe it out. /* * b_ffname has the full path of the file (NULL for no name). @@ -491,7 +482,7 @@ struct file_buffer { // file has been changed and not written out. /// Change identifier incremented for each change, including undo #define b_changedtick changedtick_di.di_tv.vval.v_number - dictitem16_T changedtick_di; // b:changedtick dictionary item. + ChangedtickDictItem changedtick_di; // b:changedtick dictionary item. bool b_saving; /* Set to true if we are in the middle of saving the buffer. */ @@ -539,8 +530,8 @@ struct file_buffer { */ uint64_t b_chartab[4]; - /* Table used for mappings local to a buffer. */ - mapblock_T *(b_maphash[256]); + // Table used for mappings local to a buffer. + mapblock_T *(b_maphash[MAX_MAPHASH]); /* First abbreviation local to a buffer. */ mapblock_T *b_first_abbr; @@ -612,6 +603,7 @@ struct file_buffer { char_u *b_p_bt; ///< 'buftype' int b_has_qf_entry; ///< quickfix exists for buffer int b_p_bl; ///< 'buflisted' + long b_p_channel; ///< 'channel' int b_p_cin; ///< 'cindent' char_u *b_p_cino; ///< 'cinoptions' char_u *b_p_cink; ///< 'cinkeys' @@ -640,6 +632,7 @@ struct file_buffer { char_u *b_p_inde; ///< 'indentexpr' uint32_t b_p_inde_flags; ///< flags for 'indentexpr' char_u *b_p_indk; ///< 'indentkeys' + char_u *b_p_fp; ///< 'formatprg' char_u *b_p_fex; ///< 'formatexpr' uint32_t b_p_fex_flags; ///< flags for 'formatexpr' char_u *b_p_kp; ///< 'keywordprg' @@ -734,8 +727,8 @@ struct file_buffer { int b_bad_char; /* "++bad=" argument when edit started or 0 */ int b_start_bomb; /* 'bomb' when it was read */ - dictitem_T b_bufvar; /* variable for "b:" Dictionary */ - dict_T *b_vars; /* internal variables, local to buffer */ + ScopeDictDictItem b_bufvar; ///< Variable for "b:" Dictionary. + dict_T *b_vars; ///< b: scope dictionary. /* When a buffer is created, it starts without a swap file. b_may_swap is * then set to indicate that a swap file may be opened later. It is reset @@ -768,7 +761,9 @@ struct file_buffer { int b_mapped_ctrl_c; // modes where CTRL-C is mapped - bufhl_info_T *b_bufhl_info; // buffer stored highlights + BufhlInfo b_bufhl_info; // buffer stored highlights + + kvec_t(BufhlLine *) b_bufhl_move_space; // temporary space for highlights }; /* @@ -823,9 +818,9 @@ struct tabpage_S { buf_T *(tp_diffbuf[DB_COUNT]); int tp_diff_invalid; ///< list of diffs is outdated frame_T *(tp_snapshot[SNAP_COUNT]); ///< window layout snapshots - dictitem_T tp_winvar; ///< variable for "t:" Dictionary - dict_T *tp_vars; ///< internal variables, local to tab page - char_u *tp_localdir; ///< Absolute path of local CWD or NULL + ScopeDictDictItem tp_winvar; ///< Variable for "t:" Dictionary. + dict_T *tp_vars; ///< Internal variables, local to tab page. + char_u *tp_localdir; ///< Absolute path of local cwd or NULL. }; /* @@ -944,6 +939,14 @@ struct window_S { synblock_T *w_s; /* for :ownsyntax */ + int w_hl_id_normal; ///< 'winhighlight' normal id + int w_hl_attr_normal; ///< 'winhighlight' normal final attrs + + int w_hl_ids[HLF_COUNT]; ///< 'winhighlight' id + int w_hl_attrs[HLF_COUNT]; ///< 'winhighlight' final attrs + + int w_hl_needs_update; ///< attrs need to be recalculated + win_T *w_prev; /* link to previous window */ win_T *w_next; /* link to next window */ bool w_closing; /* window is being closed, don't let @@ -1117,8 +1120,8 @@ struct window_S { long w_scbind_pos; - dictitem_T w_winvar; /* variable for "w:" Dictionary */ - dict_T *w_vars; /* internal variables, local to window */ + ScopeDictDictItem w_winvar; ///< Variable for "w:" dictionary. + dict_T *w_vars; ///< Dictionary with w: variables. int w_farsi; /* for the window dependent Farsi functions */ @@ -1173,4 +1176,9 @@ struct window_S { qf_info_T *w_llist_ref; }; +static inline int win_hl_attr(win_T *wp, int hlf) +{ + return wp->w_hl_attrs[hlf]; +} + #endif // NVIM_BUFFER_DEFS_H diff --git a/src/nvim/bufhl_defs.h b/src/nvim/bufhl_defs.h index e47bb2a238..14b1afa7d9 100644 --- a/src/nvim/bufhl_defs.h +++ b/src/nvim/bufhl_defs.h @@ -3,23 +3,32 @@ #include "nvim/pos.h" #include "nvim/lib/kvec.h" +#include "nvim/lib/kbtree.h" + // bufhl: buffer specific highlighting -struct bufhl_hl_item -{ +typedef struct { int src_id; int hl_id; // highlight group colnr_T start; // first column to highlight colnr_T stop; // last column to highlight -}; -typedef struct bufhl_hl_item bufhl_hl_item_T; +} BufhlItem; -typedef kvec_t(struct bufhl_hl_item) bufhl_vec_T; +typedef kvec_t(BufhlItem) BufhlItemVec; typedef struct { - bufhl_vec_T entries; + linenr_T line; + BufhlItemVec items; +} BufhlLine; +#define BUFHLLINE_INIT(l) { l, KV_INITIAL_VALUE } + +typedef struct { + BufhlItemVec entries; int current; colnr_T valid_to; -} bufhl_lineinfo_T; +} BufhlLineInfo; +#define BUFHL_CMP(a, b) ((int)(((a)->line - (b)->line))) +KBTREE_INIT(bufhl, BufhlLine *, BUFHL_CMP, 10) // -V512 +typedef kbtree_t(bufhl) BufhlInfo; #endif // NVIM_BUFHL_DEFS_H diff --git a/src/nvim/channel.c b/src/nvim/channel.c new file mode 100644 index 0000000000..40af470bde --- /dev/null +++ b/src/nvim/channel.c @@ -0,0 +1,752 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + +#include "nvim/api/ui.h" +#include "nvim/channel.h" +#include "nvim/eval.h" +#include "nvim/event/socket.h" +#include "nvim/msgpack_rpc/channel.h" +#include "nvim/msgpack_rpc/server.h" +#include "nvim/os/shell.h" +#include "nvim/path.h" +#include "nvim/ascii.h" + +static bool did_stdio = false; +PMap(uint64_t) *channels = NULL; + +/// next free id for a job or rpc channel +/// 1 is reserved for stdio channel +/// 2 is reserved for stderr channel +static uint64_t next_chan_id = CHAN_STDERR+1; + + +typedef struct { + Channel *chan; + Callback *callback; + const char *type; + list_T *received; + int status; +} ChannelEvent; + +#ifdef INCLUDE_GENERATED_DECLARATIONS +# include "channel.c.generated.h" +#endif +/// Teardown the module +void channel_teardown(void) +{ + if (!channels) { + return; + } + + Channel *channel; + + map_foreach_value(channels, channel, { + channel_close(channel->id, kChannelPartAll, NULL); + }); +} + +/// Closes a channel +/// +/// @param id The channel id +/// @return true if successful, false otherwise +bool channel_close(uint64_t id, ChannelPart part, const char **error) +{ + Channel *chan; + Process *proc; + + const char *dummy; + if (!error) { + error = &dummy; + } + + if (!(chan = find_channel(id))) { + if (id < next_chan_id) { + // allow double close, even though we can't say what parts was valid. + return true; + } + *error = (const char *)e_invchan; + return false; + } + + bool close_main = false; + if (part == kChannelPartRpc || part == kChannelPartAll) { + close_main = true; + if (chan->is_rpc) { + rpc_close(chan); + } else if (part == kChannelPartRpc) { + *error = (const char *)e_invstream; + return false; + } + } else if ((part == kChannelPartStdin || part == kChannelPartStdout) + && chan->is_rpc) { + *error = (const char *)e_invstreamrpc; + return false; + } + + switch (chan->streamtype) { + case kChannelStreamSocket: + if (!close_main) { + *error = (const char *)e_invstream; + return false; + } + stream_may_close(&chan->stream.socket); + break; + + case kChannelStreamProc: + proc = (Process *)&chan->stream.proc; + if (part == kChannelPartStdin || close_main) { + stream_may_close(&proc->in); + } + if (part == kChannelPartStdout || close_main) { + stream_may_close(&proc->out); + } + if (part == kChannelPartStderr || part == kChannelPartAll) { + stream_may_close(&proc->err); + } + if (proc->type == kProcessTypePty && part == kChannelPartAll) { + pty_process_close_master(&chan->stream.pty); + } + + break; + + case kChannelStreamStdio: + if (part == kChannelPartStdin || close_main) { + stream_may_close(&chan->stream.stdio.in); + } + if (part == kChannelPartStdout || close_main) { + stream_may_close(&chan->stream.stdio.out); + } + if (part == kChannelPartStderr) { + *error = (const char *)e_invstream; + return false; + } + break; + + case kChannelStreamStderr: + if (part != kChannelPartAll && part != kChannelPartStderr) { + *error = (const char *)e_invstream; + return false; + } + if (!chan->stream.err.closed) { + chan->stream.err.closed = true; + // Don't close on exit, in case late error messages + if (!exiting) { + fclose(stderr); + } + channel_decref(chan); + } + break; + + case kChannelStreamInternal: + if (!close_main) { + *error = (const char *)e_invstream; + return false; + } + break; + } + + return true; +} + +/// Initializes the module +void channel_init(void) +{ + channels = pmap_new(uint64_t)(); + channel_alloc(kChannelStreamStderr); + rpc_init(); + remote_ui_init(); +} + +/// Allocates a channel. +/// +/// Channel is allocated with refcount 1, which should be decreased +/// when the underlying stream closes. +static Channel *channel_alloc(ChannelStreamType type) +{ + Channel *chan = xcalloc(1, sizeof(*chan)); + if (type == kChannelStreamStdio) { + chan->id = CHAN_STDIO; + } else if (type == kChannelStreamStderr) { + chan->id = CHAN_STDERR; + } else { + chan->id = next_chan_id++; + } + chan->events = multiqueue_new_child(main_loop.events); + chan->refcount = 1; + chan->streamtype = type; + pmap_put(uint64_t)(channels, chan->id, chan); + return chan; +} + +/// Not implemented, only logging for now +void channel_create_event(Channel *chan, char *ext_source) +{ +#if MIN_LOG_LEVEL <= INFO_LOG_LEVEL + char *stream_desc, *mode_desc, *source; + + switch (chan->streamtype) { + case kChannelStreamProc: + if (chan->stream.proc.type == kProcessTypePty) { + stream_desc = "pty job"; + } else { + stream_desc = "job"; + } + break; + + case kChannelStreamStdio: + stream_desc = "stdio"; + break; + + case kChannelStreamSocket: + stream_desc = "socket"; + break; + + case kChannelStreamInternal: + stream_desc = "socket (internal)"; + break; + + default: + stream_desc = "?"; + } + + if (chan->is_rpc) { + mode_desc = ", rpc"; + } else if (chan->term) { + mode_desc = ", terminal"; + } else { + mode_desc = ""; + } + + if (ext_source) { + // TODO(bfredl): in a future improved traceback solution, + // external events should be included. + source = ext_source; + } else { + eval_format_source_name_line((char *)IObuff, sizeof(IObuff)); + source = (char *)IObuff; + } + + ILOG("new channel %" PRIu64 " (%s%s): %s", chan->id, stream_desc, + mode_desc, source); +#else + (void)chan; + (void)ext_source; +#endif +} + +void channel_incref(Channel *channel) +{ + channel->refcount++; +} + +void channel_decref(Channel *channel) +{ + if (!(--channel->refcount)) { + multiqueue_put(main_loop.fast_events, free_channel_event, 1, channel); + } +} + +void callback_reader_free(CallbackReader *reader) +{ + callback_free(&reader->cb); + if (reader->buffered) { + ga_clear(&reader->buffer); + } +} + +void callback_reader_start(CallbackReader *reader) +{ + if (reader->buffered) { + ga_init(&reader->buffer, sizeof(char *), 32); + ga_grow(&reader->buffer, 32); + } +} + +static void free_channel_event(void **argv) +{ + Channel *channel = argv[0]; + if (channel->is_rpc) { + rpc_free(channel); + } + + callback_reader_free(&channel->on_stdout); + callback_reader_free(&channel->on_stderr); + callback_free(&channel->on_exit); + + pmap_del(uint64_t)(channels, channel->id); + multiqueue_free(channel->events); + xfree(channel); +} + +static void channel_destroy_early(Channel *chan) +{ + if ((chan->id != --next_chan_id)) { + abort(); + } + + if ((--chan->refcount != 0)) { + abort(); + } + + free_channel_event((void **)&chan); +} + + +static void close_cb(Stream *stream, void *data) +{ + channel_decref(data); +} + +Channel *channel_job_start(char **argv, CallbackReader on_stdout, + CallbackReader on_stderr, Callback on_exit, + bool pty, bool rpc, bool detach, const char *cwd, + uint16_t pty_width, uint16_t pty_height, + char *term_name, varnumber_T *status_out) +{ + Channel *chan = channel_alloc(kChannelStreamProc); + chan->on_stdout = on_stdout; + chan->on_stderr = on_stderr; + chan->on_exit = on_exit; + chan->is_rpc = rpc; + + if (pty) { + if (detach) { + EMSG2(_(e_invarg2), "terminal/pty job cannot be detached"); + shell_free_argv(argv); + xfree(term_name); + channel_destroy_early(chan); + *status_out = 0; + return NULL; + } + chan->stream.pty = pty_process_init(&main_loop, chan); + if (pty_width > 0) { + chan->stream.pty.width = pty_width; + } + if (pty_height > 0) { + chan->stream.pty.height = pty_height; + } + if (term_name) { + chan->stream.pty.term_name = term_name; + } + } else { + chan->stream.uv = libuv_process_init(&main_loop, chan); + } + + Process *proc = (Process *)&chan->stream.proc; + proc->argv = argv; + proc->cb = channel_process_exit_cb; + proc->events = chan->events; + proc->detach = detach; + proc->cwd = cwd; + + char *cmd = xstrdup(proc->argv[0]); + bool has_out, has_err; + if (proc->type == kProcessTypePty) { + has_out = true; + has_err = false; + } else { + has_out = chan->is_rpc || callback_reader_set(chan->on_stdout); + has_err = callback_reader_set(chan->on_stderr); + } + int status = process_spawn(proc, true, has_out, has_err); + if (status) { + EMSG3(_(e_jobspawn), os_strerror(status), cmd); + xfree(cmd); + if (proc->type == kProcessTypePty) { + xfree(chan->stream.pty.term_name); + } + channel_destroy_early(chan); + *status_out = proc->status; + return NULL; + } + xfree(cmd); + + wstream_init(&proc->in, 0); + if (has_out) { + rstream_init(&proc->out, 0); + } + + if (chan->is_rpc) { + // the rpc takes over the in and out streams + rpc_start(chan); + } else { + if (has_out) { + callback_reader_start(&chan->on_stdout); + rstream_start(&proc->out, on_job_stdout, chan); + } + } + + if (has_err) { + callback_reader_start(&chan->on_stderr); + rstream_init(&proc->err, 0); + rstream_start(&proc->err, on_job_stderr, chan); + } + + *status_out = (varnumber_T)chan->id; + return chan; +} + + +uint64_t channel_connect(bool tcp, const char *address, + bool rpc, CallbackReader on_output, + int timeout, const char **error) +{ + if (!tcp && rpc) { + char *path = fix_fname(address); + if (server_owns_pipe_address(path)) { + // avoid deadlock + xfree(path); + return channel_create_internal_rpc(); + } + xfree(path); + } + + Channel *channel = channel_alloc(kChannelStreamSocket); + if (!socket_connect(&main_loop, &channel->stream.socket, + tcp, address, timeout, error)) { + channel_destroy_early(channel); + return 0; + } + + channel->stream.socket.internal_close_cb = close_cb; + channel->stream.socket.internal_data = channel; + wstream_init(&channel->stream.socket, 0); + rstream_init(&channel->stream.socket, 0); + + if (rpc) { + rpc_start(channel); + } else { + channel->on_stdout = on_output; + callback_reader_start(&channel->on_stdout); + rstream_start(&channel->stream.socket, on_socket_output, channel); + } + + channel_create_event(channel, NULL); + return channel->id; +} + +/// Creates an RPC channel from a tcp/pipe socket connection +/// +/// @param watcher The SocketWatcher ready to accept the connection +void channel_from_connection(SocketWatcher *watcher) +{ + Channel *channel = channel_alloc(kChannelStreamSocket); + socket_watcher_accept(watcher, &channel->stream.socket); + channel->stream.socket.internal_close_cb = close_cb; + channel->stream.socket.internal_data = channel; + wstream_init(&channel->stream.socket, 0); + rstream_init(&channel->stream.socket, 0); + rpc_start(channel); + channel_create_event(channel, watcher->addr); +} + +/// Creates a loopback channel. This is used to avoid deadlock +/// when an instance connects to its own named pipe. +static uint64_t channel_create_internal_rpc(void) +{ + Channel *channel = channel_alloc(kChannelStreamInternal); + rpc_start(channel); + return channel->id; +} + +/// Creates an API channel from stdin/stdout. This is used when embedding +/// Neovim +uint64_t channel_from_stdio(bool rpc, CallbackReader on_output, + const char **error) + FUNC_ATTR_NONNULL_ALL +{ + if (!headless_mode) { + *error = _("can only be opened in headless mode"); + return 0; + } + + if (did_stdio) { + *error = _("channel was already open"); + return 0; + } + did_stdio = true; + + Channel *channel = channel_alloc(kChannelStreamStdio); + + rstream_init_fd(&main_loop, &channel->stream.stdio.in, 0, 0); + wstream_init_fd(&main_loop, &channel->stream.stdio.out, 1, 0); + + if (rpc) { + rpc_start(channel); + } else { + channel->on_stdout = on_output; + callback_reader_start(&channel->on_stdout); + rstream_start(&channel->stream.stdio.in, on_stdio_input, channel); + } + + return channel->id; +} + +/// @param data will be consumed +size_t channel_send(uint64_t id, char *data, size_t len, const char **error) +{ + Channel *chan = find_channel(id); + if (!chan) { + EMSG(_(e_invchan)); + goto err; + } + + if (chan->streamtype == kChannelStreamStderr) { + if (chan->stream.err.closed) { + *error = _("Can't send data to closed stream"); + goto err; + } + // unbuffered write + size_t written = fwrite(data, len, 1, stderr); + xfree(data); + return len * written; + } + + + Stream *in = channel_instream(chan); + if (in->closed) { + *error = _("Can't send data to closed stream"); + goto err; + } + + if (chan->is_rpc) { + *error = _("Can't send raw data to rpc channel"); + goto err; + } + + WBuffer *buf = wstream_new_buffer(data, len, 1, xfree); + return wstream_write(in, buf) ? len : 0; + +err: + xfree(data); + return 0; +} + +/// NB: mutates buf in place! +static list_T *buffer_to_tv_list(char *buf, size_t count) +{ + list_T *ret = tv_list_alloc(); + char *ptr = buf; + size_t remaining = count; + size_t off = 0; + + while (off < remaining) { + // append the line + if (ptr[off] == NL) { + tv_list_append_string(ret, ptr, (ssize_t)off); + size_t skip = off + 1; + ptr += skip; + remaining -= skip; + off = 0; + continue; + } + if (ptr[off] == NUL) { + // Translate NUL to NL + ptr[off] = NL; + } + off++; + } + tv_list_append_string(ret, ptr, (ssize_t)off); + return ret; +} + +// vimscript job callbacks must be executed on Nvim main loop +static inline void process_channel_event(Channel *chan, Callback *callback, + const char *type, char *buf, + size_t count, int status) +{ + assert(callback); + ChannelEvent *event_data = xmalloc(sizeof(*event_data)); + event_data->received = NULL; + if (buf) { + event_data->received = buffer_to_tv_list(buf, count); + } else { + event_data->status = status; + } + channel_incref(chan); // Hold on ref to callback + event_data->chan = chan; + event_data->callback = callback; + event_data->type = type; + + multiqueue_put(chan->events, on_channel_event, 1, event_data); +} + +void on_job_stdout(Stream *stream, RBuffer *buf, size_t count, + void *data, bool eof) +{ + Channel *chan = data; + on_channel_output(stream, chan, buf, count, eof, &chan->on_stdout, "stdout"); +} + +void on_job_stderr(Stream *stream, RBuffer *buf, size_t count, + void *data, bool eof) +{ + Channel *chan = data; + on_channel_output(stream, chan, buf, count, eof, &chan->on_stderr, "stderr"); +} + +static void on_socket_output(Stream *stream, RBuffer *buf, size_t count, + void *data, bool eof) +{ + Channel *chan = data; + on_channel_output(stream, chan, buf, count, eof, &chan->on_stdout, "data"); +} + +static void on_stdio_input(Stream *stream, RBuffer *buf, size_t count, + void *data, bool eof) +{ + Channel *chan = data; + on_channel_output(stream, chan, buf, count, eof, &chan->on_stdout, "stdin"); +} + +static void on_channel_output(Stream *stream, Channel *chan, RBuffer *buf, + size_t count, bool eof, CallbackReader *reader, + const char *type) +{ + // stub variable, to keep reading consistent with the order of events, only + // consider the count parameter. + size_t r; + char *ptr = rbuffer_read_ptr(buf, &r); + + if (eof) { + if (reader->buffered) { + if (reader->cb.type != kCallbackNone) { + process_channel_event(chan, &reader->cb, type, reader->buffer.ga_data, + (size_t)reader->buffer.ga_len, 0); + ga_clear(&reader->buffer); + } else if (reader->self) { + list_T *data = buffer_to_tv_list(reader->buffer.ga_data, + (size_t)reader->buffer.ga_len); + tv_dict_add_list(reader->self, type, strlen(type), data); + } else { + abort(); + } + } else if (reader->cb.type != kCallbackNone) { + process_channel_event(chan, &reader->cb, type, ptr, 0, 0); + } + return; + } + + // The order here matters, the terminal must receive the data first because + // process_channel_event will modify the read buffer(convert NULs into NLs) + if (chan->term) { + terminal_receive(chan->term, ptr, count); + } + + rbuffer_consumed(buf, count); + if (reader->buffered) { + ga_concat_len(&reader->buffer, ptr, count); + } else if (callback_reader_set(*reader)) { + process_channel_event(chan, &reader->cb, type, ptr, count, 0); + } +} + +static void channel_process_exit_cb(Process *proc, int status, void *data) +{ + Channel *chan = data; + if (chan->term) { + char msg[sizeof("\r\n[Process exited ]") + NUMBUFLEN]; + snprintf(msg, sizeof msg, "\r\n[Process exited %d]", proc->status); + terminal_close(chan->term, msg); + } + + // if status is -1 the process did not really exit, + // we just closed the handle onto a detached process + if (status >= 0) { + process_channel_event(chan, &chan->on_exit, "exit", NULL, 0, status); + } + + channel_decref(chan); +} + +static void on_channel_event(void **args) +{ + ChannelEvent *ev = (ChannelEvent *)args[0]; + + typval_T argv[4]; + + argv[0].v_type = VAR_NUMBER; + argv[0].v_lock = VAR_UNLOCKED; + argv[0].vval.v_number = (varnumber_T)ev->chan->id; + + if (ev->received) { + argv[1].v_type = VAR_LIST; + argv[1].v_lock = VAR_UNLOCKED; + argv[1].vval.v_list = ev->received; + argv[1].vval.v_list->lv_refcount++; + } else { + argv[1].v_type = VAR_NUMBER; + argv[1].v_lock = VAR_UNLOCKED; + argv[1].vval.v_number = ev->status; + } + + argv[2].v_type = VAR_STRING; + argv[2].v_lock = VAR_UNLOCKED; + argv[2].vval.v_string = (uint8_t *)ev->type; + + typval_T rettv = TV_INITIAL_VALUE; + callback_call(ev->callback, 3, argv, &rettv); + tv_clear(&rettv); + channel_decref(ev->chan); + xfree(ev); +} + + +/// Open terminal for channel +/// +/// Channel `chan` is assumed to be an open pty channel, +/// and curbuf is assumed to be a new, unmodified buffer. +void channel_terminal_open(Channel *chan) +{ + TerminalOptions topts; + topts.data = chan; + topts.width = chan->stream.pty.width; + topts.height = chan->stream.pty.height; + topts.write_cb = term_write; + topts.resize_cb = term_resize; + topts.close_cb = term_close; + curbuf->b_p_channel = (long)chan->id; // 'channel' option + Terminal *term = terminal_open(topts); + chan->term = term; + channel_incref(chan); +} + +static void term_write(char *buf, size_t size, void *data) +{ + Channel *chan = data; + if (chan->stream.proc.in.closed) { + // If the backing stream was closed abruptly, there may be write events + // ahead of the terminal close event. Just ignore the writes. + ILOG("write failed: stream is closed"); + return; + } + WBuffer *wbuf = wstream_new_buffer(xmemdup(buf, size), size, 1, xfree); + wstream_write(&chan->stream.proc.in, wbuf); +} + +static void term_resize(uint16_t width, uint16_t height, void *data) +{ + Channel *chan = data; + pty_process_resize(&chan->stream.pty, width, height); +} + +static inline void term_delayed_free(void **argv) +{ + Channel *chan = argv[0]; + if (chan->stream.proc.in.pending_reqs || chan->stream.proc.out.pending_reqs) { + multiqueue_put(chan->events, term_delayed_free, 1, chan); + return; + } + + terminal_destroy(chan->term); + chan->term = NULL; + channel_decref(chan); +} + +static void term_close(void *data) +{ + Channel *chan = data; + process_stop(&chan->stream.proc); + multiqueue_put(chan->events, term_delayed_free, 1, data); +} + diff --git a/src/nvim/channel.h b/src/nvim/channel.h new file mode 100644 index 0000000000..b856d197f1 --- /dev/null +++ b/src/nvim/channel.h @@ -0,0 +1,134 @@ +#ifndef NVIM_CHANNEL_H +#define NVIM_CHANNEL_H + +#include "nvim/main.h" +#include "nvim/event/socket.h" +#include "nvim/event/process.h" +#include "nvim/os/pty_process.h" +#include "nvim/event/libuv_process.h" +#include "nvim/eval/typval.h" +#include "nvim/msgpack_rpc/channel_defs.h" + +#define CHAN_STDIO 1 +#define CHAN_STDERR 2 + +typedef enum { + kChannelStreamProc, + kChannelStreamSocket, + kChannelStreamStdio, + kChannelStreamStderr, + kChannelStreamInternal +} ChannelStreamType; + +typedef enum { + kChannelPartStdin, + kChannelPartStdout, + kChannelPartStderr, + kChannelPartRpc, + kChannelPartAll +} ChannelPart; + + +typedef struct { + Stream in; + Stream out; +} StdioPair; + +typedef struct { + bool closed; +} StderrState; + +typedef struct { + Callback cb; + dict_T *self; + garray_T buffer; + bool buffered; +} CallbackReader; + +#define CALLBACK_READER_INIT ((CallbackReader){ .cb = CALLBACK_NONE, \ + .self = NULL, \ + .buffer = GA_EMPTY_INIT_VALUE, \ + .buffered = false }) +static inline bool callback_reader_set(CallbackReader reader) +{ + return reader.cb.type != kCallbackNone || reader.self; +} + +struct Channel { + uint64_t id; + size_t refcount; + MultiQueue *events; + + ChannelStreamType streamtype; + union { + Process proc; + LibuvProcess uv; + PtyProcess pty; + Stream socket; + StdioPair stdio; + StderrState err; + } stream; + + bool is_rpc; + RpcState rpc; + Terminal *term; + + CallbackReader on_stdout; + CallbackReader on_stderr; + Callback on_exit; +}; + +EXTERN PMap(uint64_t) *channels; + +#ifdef INCLUDE_GENERATED_DECLARATIONS +# include "channel.h.generated.h" +#endif + +/// @returns Channel with the id or NULL if not found +static inline Channel *find_channel(uint64_t id) +{ + return pmap_get(uint64_t)(channels, id); +} + +static inline Stream *channel_instream(Channel *chan) + FUNC_ATTR_NONNULL_ALL +{ + switch (chan->streamtype) { + case kChannelStreamProc: + return &chan->stream.proc.in; + + case kChannelStreamSocket: + return &chan->stream.socket; + + case kChannelStreamStdio: + return &chan->stream.stdio.out; + + case kChannelStreamInternal: + case kChannelStreamStderr: + abort(); + } + abort(); +} + +static inline Stream *channel_outstream(Channel *chan) + FUNC_ATTR_NONNULL_ALL +{ + switch (chan->streamtype) { + case kChannelStreamProc: + return &chan->stream.proc.out; + + case kChannelStreamSocket: + return &chan->stream.socket; + + case kChannelStreamStdio: + return &chan->stream.stdio.in; + + case kChannelStreamInternal: + case kChannelStreamStderr: + abort(); + } + abort(); +} + + +#endif // NVIM_CHANNEL_H diff --git a/src/nvim/charset.c b/src/nvim/charset.c index 9e240fd38b..577fc13a31 100644 --- a/src/nvim/charset.c +++ b/src/nvim/charset.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /// @file charset.c /// /// Code related to character sets. @@ -15,6 +18,7 @@ #include "nvim/func_attr.h" #include "nvim/indent.h" #include "nvim/main.h" +#include "nvim/mark.h" #include "nvim/mbyte.h" #include "nvim/memline.h" #include "nvim/memory.h" @@ -41,8 +45,10 @@ static bool chartab_initialized = false; (buf)->b_chartab[(unsigned)(c) >> 6] |= (1ull << ((c) & 0x3f)) #define RESET_CHARTAB(buf, c) \ (buf)->b_chartab[(unsigned)(c) >> 6] &= ~(1ull << ((c) & 0x3f)) +#define GET_CHARTAB_TAB(chartab, c) \ + ((chartab)[(unsigned)(c) >> 6] & (1ull << ((c) & 0x3f))) #define GET_CHARTAB(buf, c) \ - ((buf)->b_chartab[(unsigned)(c) >> 6] & (1ull << ((c) & 0x3f))) + GET_CHARTAB_TAB((buf)->b_chartab, c) // Table used below, see init_chartab() for an explanation static char_u g_chartab[256]; @@ -88,7 +94,6 @@ int buf_init_chartab(buf_T *buf, int global) { int c; int c2; - char_u *p; int i; bool tilde; bool do_isalpha; @@ -142,7 +147,8 @@ int buf_init_chartab(buf_T *buf, int global) // Walk through the 'isident', 'iskeyword', 'isfname' and 'isprint' // options Each option is a list of characters, character numbers or // ranges, separated by commas, e.g.: "200-210,x,#-178,-" - for (i = global ? 0 : 3; i <= 3; ++i) { + for (i = global ? 0 : 3; i <= 3; i++) { + const char_u *p; if (i == 0) { // first round: 'isident' p = p_isi; @@ -167,7 +173,7 @@ int buf_init_chartab(buf_T *buf, int global) } if (ascii_isdigit(*p)) { - c = getdigits_int(&p); + c = getdigits_int((char_u **)&p); } else { c = mb_ptr2char_adv(&p); } @@ -177,7 +183,7 @@ int buf_init_chartab(buf_T *buf, int global) ++p; if (ascii_isdigit(*p)) { - c2 = getdigits_int(&p); + c2 = getdigits_int((char_u **)&p); } else { c2 = mb_ptr2char_adv(&p); } @@ -210,8 +216,8 @@ int buf_init_chartab(buf_T *buf, int global) // work properly when 'encoding' is "latin1" and the locale is // "C". if (!do_isalpha - || vim_islower(c) - || vim_isupper(c) + || mb_islower(c) + || mb_isupper(c) || (p_altkeymap && (F_isalpha(c) || F_isdigit(c)))) { if (i == 0) { // (re)set ID flag @@ -415,11 +421,11 @@ char_u* str_foldcase(char_u *str, int orglen, char_u *buf, int buflen) while (STR_CHAR(i) != NUL) { int c = utf_ptr2char(STR_PTR(i)); int olen = utf_ptr2len(STR_PTR(i)); - int lc = utf_tolower(c); + int lc = mb_tolower(c); // Only replace the character when it is not an invalid // sequence (ASCII character or more than one byte) and - // utf_tolower() doesn't return the original character. + // mb_tolower() doesn't return the original character. if (((c < 0x80) || (olen > 1)) && (c != lc)) { int nlen = utf_char2len(lc); @@ -538,19 +544,9 @@ void transchar_nonprint(char_u *buf, int c) // DEL displayed as ^? buf[1] = (char_u)(c ^ 0x40); - buf[2] = NUL; - } else if (c >= 0x80) { - transchar_hex(buf, c); - } else if ((c >= ' ' + 0x80) && (c <= '~' + 0x80)) { - // 0xa0 - 0xfe - buf[0] = '|'; - buf[1] = (char_u)(c - 0x80); buf[2] = NUL; } else { - // 0x80 - 0x9f and 0xff - buf[0] = '~'; - buf[1] = (char_u)((c - 0x80) ^ 0x40); - buf[2] = NUL; + transchar_hex(buf, c); } } @@ -634,7 +630,7 @@ int char2cells(int c) /// @param p /// /// @return number of display cells. -int ptr2cells(char_u *p) +int ptr2cells(const char_u *p) { // For UTF-8 we need to look at more bytes if the first byte is >= 0x80. if (*p >= 0x80) { @@ -766,7 +762,7 @@ bool vim_isIDc(int c) } /// Check that "c" is a keyword character: -/// Letters and characters from 'iskeyword' option for current buffer. +/// Letters and characters from 'iskeyword' option for the current buffer. /// For multi-byte characters mb_get_class() is used (builtin rules). /// /// @param c character to check @@ -776,6 +772,20 @@ bool vim_iswordc(int c) return vim_iswordc_buf(c, curbuf); } +/// Check that "c" is a keyword character +/// Letters and characters from 'iskeyword' option for given buffer. +/// For multi-byte characters mb_get_class() is used (builtin rules). +/// +/// @param[in] c Character to check. +/// @param[in] chartab Buffer chartab. +bool vim_iswordc_tab(const int c, const uint64_t *const chartab) + FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL +{ + return (c >= 0x100 + ? (utf_class(c) >= 2) + : (c > 0 && GET_CHARTAB_TAB(chartab, c) != 0)); +} + /// Check that "c" is a keyword character: /// Letters and characters from 'iskeyword' option for given buffer. /// For multi-byte characters mb_get_class() is used (builtin rules). @@ -785,10 +795,7 @@ bool vim_iswordc(int c) bool vim_iswordc_buf(int c, buf_T *buf) FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ARG(2) { - if (c >= 0x100) { - return utf_class(c) >= 2; - } - return c > 0 && c < 0x100 && GET_CHARTAB(buf, c) != 0; + return vim_iswordc_tab(c, buf->b_chartab); } /// Just like vim_iswordc() but uses a pointer to the (multi-byte) character. @@ -974,10 +981,8 @@ int win_lbr_chartabsize(win_T *wp, char_u *line, char_u *s, colnr_T col, int *he mb_ptr_adv(s); c = *s; - if (!((c != NUL) - && (vim_isbreak(c) - || (!vim_isbreak(c) - && ((col2 == col) || !vim_isbreak(*ps)))))) { + if (!(c != NUL + && (vim_isbreak(c) || col2 == col || !vim_isbreak(*ps)))) { break; } @@ -1160,7 +1165,13 @@ void getvcol(win_T *wp, pos_T *pos, colnr_T *start, colnr_T *cursor, // continue until the NUL posptr = NULL; } else { + // Special check for an empty line, which can happen on exit, when + // ml_get_buf() always returns an empty string. + if (*ptr == NUL) { + pos->col = 0; + } posptr = ptr + pos->col; + posptr -= utf_head_off(line, posptr); } // This function is used very often, do some speed optimizations. @@ -1347,7 +1358,7 @@ void getvcols(win_T *wp, pos_T *pos1, pos_T *pos2, colnr_T *left, colnr_T to1; colnr_T to2; - if (ltp(pos1, pos2)) { + if (lt(*pos1, *pos2)) { getvvcol(wp, pos1, &from1, NULL, &to1); getvvcol(wp, pos2, &from2, NULL, &to2); } else { @@ -1378,7 +1389,8 @@ void getvcols(win_T *wp, pos_T *pos1, pos_T *pos2, colnr_T *left, /// /// @return Pointer to character after the skipped whitespace. char_u *skipwhite(const char_u *q) - FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT + FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL + FUNC_ATTR_NONNULL_RET { const char_u *p = q; while (ascii_iswhite(*p)) { @@ -1387,19 +1399,21 @@ char_u *skipwhite(const char_u *q) return (char_u *)p; } -/// skip over digits +/// Skip over digits /// -/// @param q +/// @param[in] q String to skip digits in. /// /// @return Pointer to the character after the skipped digits. -char_u* skipdigits(char_u *q) +char_u *skipdigits(const char_u *q) + FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_NONNULL_ALL + FUNC_ATTR_NONNULL_RET { - char_u *p = q; + const char_u *p = q; while (ascii_isdigit(*p)) { // skip to next non-digit p++; } - return p; + return (char_u *)p; } /// skip over binary digits @@ -1484,78 +1498,17 @@ char_u* skiptohex(char_u *q) return p; } -// Vim's own character class functions. These exist because many library -// islower()/toupper() etc. do not work properly: they crash when used with -// invalid values or can't handle latin1 when the locale is C. -// Speed is most important here. - -/// Check that the character is lower-case +/// Skip over text until ' ' or '\t' or NUL /// -/// @param c character to check -bool vim_islower(int c) - FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT -{ - if (c <= '@') { - return false; - } - - if (c >= 0x80) { - return utf_islower(c); - } - return islower(c); -} - -/// Check that the character is upper-case -/// -/// @param c character to check -bool vim_isupper(int c) - FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT -{ - if (c <= '@') { - return false; - } - - if (c >= 0x80) { - return utf_isupper(c); - } - return isupper(c); -} - -int vim_toupper(int c) -{ - if (c <= '@') { - return c; - } - - if (c >= 0x80) { - return utf_toupper(c); - } - return TOUPPER_LOC(c); -} - -int vim_tolower(int c) -{ - if (c <= '@') { - return c; - } - - if (c >= 0x80) { - return utf_tolower(c); - } - return TOLOWER_LOC(c); -} - -/// skiptowhite: skip over text until ' ' or '\t' or NUL. -/// -/// @param p +/// @param[in] p Text to skip over. /// /// @return Pointer to the next whitespace or NUL character. -char_u* skiptowhite(char_u *p) +char_u *skiptowhite(const char_u *p) { while (*p != ' ' && *p != '\t' && *p != NUL) { p++; } - return p; + return (char_u *)p; } /// skiptowhite_esc: Like skiptowhite(), but also skip escaped chars @@ -1666,13 +1619,13 @@ bool vim_isblankline(char_u *lbuf) /// @param unptr Returns the unsigned result. /// @param maxlen Max length of string to check. void vim_str2nr(const char_u *const start, int *const prep, int *const len, - const int what, long *const nptr, unsigned long *const unptr, - const int maxlen) + const int what, varnumber_T *const nptr, + uvarnumber_T *const unptr, const int maxlen) { const char_u *ptr = start; int pre = 0; // default is decimal bool negative = false; - unsigned long un = 0; + uvarnumber_T un = 0; if (ptr[0] == '-') { negative = true; @@ -1728,7 +1681,12 @@ void vim_str2nr(const char_u *const start, int *const prep, int *const len, n += 2; // skip over "0b" } while ('0' <= *ptr && *ptr <= '1') { - un = 2 * un + (unsigned long)(*ptr - '0'); + // avoid ubsan error for overflow + if (un < UVARNUMBER_MAX / 2) { + un = 2 * un + (uvarnumber_T)(*ptr - '0'); + } else { + un = UVARNUMBER_MAX; + } ptr++; if (n++ == maxlen) { break; @@ -1737,7 +1695,12 @@ void vim_str2nr(const char_u *const start, int *const prep, int *const len, } else if ((pre == '0') || what == STR2NR_OCT + STR2NR_FORCE) { // octal while ('0' <= *ptr && *ptr <= '7') { - un = 8 * un + (unsigned long)(*ptr - '0'); + // avoid ubsan error for overflow + if (un < UVARNUMBER_MAX / 8) { + un = 8 * un + (uvarnumber_T)(*ptr - '0'); + } else { + un = UVARNUMBER_MAX; + } ptr++; if (n++ == maxlen) { break; @@ -1750,7 +1713,12 @@ void vim_str2nr(const char_u *const start, int *const prep, int *const len, n += 2; // skip over "0x" } while (ascii_isxdigit(*ptr)) { - un = 16 * un + (unsigned long)hex2nr(*ptr); + // avoid ubsan error for overflow + if (un < UVARNUMBER_MAX / 16) { + un = 16 * un + (uvarnumber_T)hex2nr(*ptr); + } else { + un = UVARNUMBER_MAX; + } ptr++; if (n++ == maxlen) { break; @@ -1759,7 +1727,12 @@ void vim_str2nr(const char_u *const start, int *const prep, int *const len, } else { // decimal while (ascii_isdigit(*ptr)) { - un = 10 * un + (unsigned long)(*ptr - '0'); + // avoid ubsan error for overflow + if (un < UVARNUMBER_MAX / 10) { + un = 10 * un + (uvarnumber_T)(*ptr - '0'); + } else { + un = UVARNUMBER_MAX; + } ptr++; if (n++ == maxlen) { break; @@ -1776,11 +1749,18 @@ void vim_str2nr(const char_u *const start, int *const prep, int *const len, } if (nptr != NULL) { - if (negative) { - // account for leading '-' for decimal numbers - *nptr = -(long)un; + if (negative) { // account for leading '-' for decimal numbers + // avoid ubsan error for overflow + if (un > VARNUMBER_MAX) { + *nptr = VARNUMBER_MIN; + } else { + *nptr = -(varnumber_T)un; + } } else { - *nptr = (long)un; + if (un > VARNUMBER_MAX) { + un = VARNUMBER_MAX; + } + *nptr = (varnumber_T)un; } } diff --git a/src/nvim/charset.h b/src/nvim/charset.h index 78d6f2a76c..c69582c4c6 100644 --- a/src/nvim/charset.h +++ b/src/nvim/charset.h @@ -1,6 +1,20 @@ #ifndef NVIM_CHARSET_H #define NVIM_CHARSET_H +#include "nvim/types.h" +#include "nvim/pos.h" +#include "nvim/buffer_defs.h" + +/// Return the folded-case equivalent of the given character +/// +/// @param[in] c Character to transform. +/// +/// @return Folded variant. +#define CH_FOLD(c) \ + utf_fold((sizeof(c) == sizeof(char)) \ + ?((int)(uint8_t)(c)) \ + :((int)(c))) + #ifdef INCLUDE_GENERATED_DECLARATIONS # include "charset.h.generated.h" #endif diff --git a/src/nvim/cursor.c b/src/nvim/cursor.c index 3ba9da34f2..0e97e2203f 100644 --- a/src/nvim/cursor.c +++ b/src/nvim/cursor.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include @@ -12,6 +15,7 @@ #include "nvim/state.h" #include "nvim/vim.h" #include "nvim/ascii.h" +#include "nvim/mark.h" #ifdef INCLUDE_GENERATED_DECLARATIONS # include "cursor.c.generated.h" @@ -227,9 +231,10 @@ static int coladvance2( } } - /* prevent from moving onto a trail byte */ - if (has_mbyte) - mb_adjustpos(curbuf, pos); + // Prevent from moving onto a trail byte. + if (has_mbyte) { + mark_mb_adjustpos(curbuf, pos); + } if (col < wcol) return FAIL; @@ -294,6 +299,26 @@ linenr_T get_cursor_rel_lnum(win_T *wp, linenr_T lnum) return (lnum < cursor) ? -retval : retval; } +// Make sure "pos.lnum" and "pos.col" are valid in "buf". +// This allows for the col to be on the NUL byte. +void check_pos(buf_T *buf, pos_T *pos) +{ + char_u *line; + colnr_T len; + + if (pos->lnum > buf->b_ml.ml_line_count) { + pos->lnum = buf->b_ml.ml_line_count; + } + + if (pos->col > 0) { + line = ml_get_buf(buf, pos->lnum, false); + len = (colnr_T)STRLEN(line); + if (pos->col > len) { + pos->col = len; + } + } +} + /* * Make sure curwin->w_cursor.lnum is valid. */ @@ -318,9 +343,8 @@ void check_cursor_col(void) check_cursor_col_win(curwin); } -/* - * Make sure win->w_cursor.col is valid. - */ +/// Make sure win->w_cursor.col is valid. Special handling of insert-mode. +/// @see mb_check_adjust_col void check_cursor_col_win(win_T *win) { colnr_T len; @@ -342,25 +366,39 @@ void check_cursor_col_win(win_T *win) win->w_cursor.col = len; } else { win->w_cursor.col = len - 1; - /* Move the cursor to the head byte. */ - if (has_mbyte) - mb_adjustpos(win->w_buffer, &win->w_cursor); + // Move the cursor to the head byte. + if (has_mbyte) { + mark_mb_adjustpos(win->w_buffer, &win->w_cursor); + } } } else if (win->w_cursor.col < 0) { win->w_cursor.col = 0; } - /* If virtual editing is on, we can leave the cursor on the old position, - * only we must set it to virtual. But don't do it when at the end of the - * line. */ - if (oldcol == MAXCOL) + // If virtual editing is on, we can leave the cursor on the old position, + // only we must set it to virtual. But don't do it when at the end of the + // line. + if (oldcol == MAXCOL) { win->w_cursor.coladd = 0; - else if (ve_flags == VE_ALL) { - if (oldcoladd > win->w_cursor.col) + } else if (ve_flags == VE_ALL) { + if (oldcoladd > win->w_cursor.col) { win->w_cursor.coladd = oldcoladd - win->w_cursor.col; - else - /* avoid weird number when there is a miscalculation or overflow */ + + // Make sure that coladd is not more than the char width. + // Not for the last character, coladd is then used when the cursor + // is actually after the last character. + if (win->w_cursor.col + 1 < len && win->w_cursor.coladd > 0) { + int cs, ce; + + getvcol(win, &win->w_cursor, &cs, NULL, &ce); + if (win->w_cursor.coladd > ce - cs) { + win->w_cursor.coladd = ce - cs; + } + } + } else { + // avoid weird number when there is a miscalculation or overflow win->w_cursor.coladd = 0; + } } } diff --git a/src/nvim/cursor_shape.c b/src/nvim/cursor_shape.c index b50462664c..97fc3a3ca3 100644 --- a/src/nvim/cursor_shape.c +++ b/src/nvim/cursor_shape.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + #include #include #include "nvim/vim.h" @@ -7,40 +10,75 @@ #include "nvim/charset.h" #include "nvim/strings.h" #include "nvim/syntax.h" +#include "nvim/api/private/helpers.h" +#include "nvim/ui.h" -/* - * Handling of cursor and mouse pointer shapes in various modes. - */ - -static cursorentry_T shape_table[SHAPE_IDX_COUNT] = +/// Handling of cursor and mouse pointer shapes in various modes. +cursorentry_T shape_table[SHAPE_IDX_COUNT] = { - /* The values will be filled in from the 'guicursor' and 'mouseshape' - * defaults when Vim starts. - * Adjust the SHAPE_IDX_ defines when making changes! */ - {0, 0, 0, 700L, 400L, 250L, 0, 0, "n", SHAPE_CURSOR+SHAPE_MOUSE}, - {0, 0, 0, 700L, 400L, 250L, 0, 0, "v", SHAPE_CURSOR+SHAPE_MOUSE}, - {0, 0, 0, 700L, 400L, 250L, 0, 0, "i", SHAPE_CURSOR+SHAPE_MOUSE}, - {0, 0, 0, 700L, 400L, 250L, 0, 0, "r", SHAPE_CURSOR+SHAPE_MOUSE}, - {0, 0, 0, 700L, 400L, 250L, 0, 0, "c", SHAPE_CURSOR+SHAPE_MOUSE}, - {0, 0, 0, 700L, 400L, 250L, 0, 0, "ci", SHAPE_CURSOR+SHAPE_MOUSE}, - {0, 0, 0, 700L, 400L, 250L, 0, 0, "cr", SHAPE_CURSOR+SHAPE_MOUSE}, - {0, 0, 0, 700L, 400L, 250L, 0, 0, "o", SHAPE_CURSOR+SHAPE_MOUSE}, - {0, 0, 0, 700L, 400L, 250L, 0, 0, "ve", SHAPE_CURSOR+SHAPE_MOUSE}, - {0, 0, 0, 0L, 0L, 0L, 0, 0, "e", SHAPE_MOUSE}, - {0, 0, 0, 0L, 0L, 0L, 0, 0, "s", SHAPE_MOUSE}, - {0, 0, 0, 0L, 0L, 0L, 0, 0, "sd", SHAPE_MOUSE}, - {0, 0, 0, 0L, 0L, 0L, 0, 0, "vs", SHAPE_MOUSE}, - {0, 0, 0, 0L, 0L, 0L, 0, 0, "vd", SHAPE_MOUSE}, - {0, 0, 0, 0L, 0L, 0L, 0, 0, "m", SHAPE_MOUSE}, - {0, 0, 0, 0L, 0L, 0L, 0, 0, "ml", SHAPE_MOUSE}, - {0, 0, 0, 100L, 100L, 100L, 0, 0, "sm", SHAPE_CURSOR}, + // Values are set by 'guicursor' and 'mouseshape'. + // Adjust the SHAPE_IDX_ defines when changing this! + { "normal", 0, 0, 0, 700L, 400L, 250L, 0, 0, "n", SHAPE_CURSOR+SHAPE_MOUSE }, + { "visual", 0, 0, 0, 700L, 400L, 250L, 0, 0, "v", SHAPE_CURSOR+SHAPE_MOUSE }, + { "insert", 0, 0, 0, 700L, 400L, 250L, 0, 0, "i", SHAPE_CURSOR+SHAPE_MOUSE }, + { "replace", 0, 0, 0, 700L, 400L, 250L, 0, 0, "r", SHAPE_CURSOR+SHAPE_MOUSE }, + { "cmdline_normal", 0, 0, 0, 700L, 400L, 250L, 0, 0, "c", SHAPE_CURSOR+SHAPE_MOUSE }, + { "cmdline_insert", 0, 0, 0, 700L, 400L, 250L, 0, 0, "ci", SHAPE_CURSOR+SHAPE_MOUSE }, + { "cmdline_replace", 0, 0, 0, 700L, 400L, 250L, 0, 0, "cr", SHAPE_CURSOR+SHAPE_MOUSE }, + { "operator", 0, 0, 0, 700L, 400L, 250L, 0, 0, "o", SHAPE_CURSOR+SHAPE_MOUSE }, + { "visual_select", 0, 0, 0, 700L, 400L, 250L, 0, 0, "ve", SHAPE_CURSOR+SHAPE_MOUSE }, + { "cmdline_hover", 0, 0, 0, 0L, 0L, 0L, 0, 0, "e", SHAPE_MOUSE }, + { "statusline_hover", 0, 0, 0, 0L, 0L, 0L, 0, 0, "s", SHAPE_MOUSE }, + { "statusline_drag", 0, 0, 0, 0L, 0L, 0L, 0, 0, "sd", SHAPE_MOUSE }, + { "vsep_hover", 0, 0, 0, 0L, 0L, 0L, 0, 0, "vs", SHAPE_MOUSE }, + { "vsep_drag", 0, 0, 0, 0L, 0L, 0L, 0, 0, "vd", SHAPE_MOUSE }, + { "more", 0, 0, 0, 0L, 0L, 0L, 0, 0, "m", SHAPE_MOUSE }, + { "more_lastline", 0, 0, 0, 0L, 0L, 0L, 0, 0, "ml", SHAPE_MOUSE }, + { "showmatch", 0, 0, 0, 100L, 100L, 100L, 0, 0, "sm", SHAPE_CURSOR }, }; -/* - * Parse the 'guicursor' option ("what" is SHAPE_CURSOR) or 'mouseshape' - * ("what" is SHAPE_MOUSE). - * Returns error message for an illegal option, NULL otherwise. - */ +/// Converts cursor_shapes into an Array of Dictionaries +/// @return Array of the form {[ "cursor_shape": ... ], ...} +Array mode_style_array(void) +{ + Array all = ARRAY_DICT_INIT; + + for (int i = 0; i < SHAPE_IDX_COUNT; i++) { + Dictionary dic = ARRAY_DICT_INIT; + cursorentry_T *cur = &shape_table[i]; + if (cur->used_for & SHAPE_MOUSE) { + PUT(dic, "mouse_shape", INTEGER_OBJ(cur->mshape)); + } + if (cur->used_for & SHAPE_CURSOR) { + String shape_str; + switch (cur->shape) { + case SHAPE_BLOCK: shape_str = cstr_to_string("block"); break; + case SHAPE_VER: shape_str = cstr_to_string("vertical"); break; + case SHAPE_HOR: shape_str = cstr_to_string("horizontal"); break; + default: shape_str = cstr_to_string("unknown"); + } + PUT(dic, "cursor_shape", STRING_OBJ(shape_str)); + PUT(dic, "cell_percentage", INTEGER_OBJ(cur->percentage)); + PUT(dic, "blinkwait", INTEGER_OBJ(cur->blinkwait)); + PUT(dic, "blinkon", INTEGER_OBJ(cur->blinkon)); + PUT(dic, "blinkoff", INTEGER_OBJ(cur->blinkoff)); + PUT(dic, "hl_id", INTEGER_OBJ(cur->id)); + PUT(dic, "id_lm", INTEGER_OBJ(cur->id_lm)); + } + PUT(dic, "name", STRING_OBJ(cstr_to_string(cur->full_name))); + PUT(dic, "short_name", STRING_OBJ(cstr_to_string(cur->name))); + + ADD(all, DICTIONARY_OBJ(dic)); + } + + return all; +} + +/// Parse the 'guicursor' option +/// +/// @param what SHAPE_CURSOR or SHAPE_MOUSE ('mouseshape') +/// +/// @returns error message for an illegal option, NULL otherwise. char_u *parse_shape_opt(int what) { char_u *modep; @@ -55,14 +93,13 @@ char_u *parse_shape_opt(int what) int found_ve = false; /* found "ve" flag */ int round; - /* - * First round: check for errors; second round: do it for real. - */ - for (round = 1; round <= 2; ++round) { - /* - * Repeat for all comma separated parts. - */ + // First round: check for errors; second round: do it for real. + for (round = 1; round <= 2; round++) { + // Repeat for all comma separated parts. modep = p_guicursor; + if (*p_guicursor == NUL) { + modep = (char_u *)"a:block-blinkon0"; + } while (*modep != NUL) { colonp = vim_strchr(modep, ':'); if (colonp == NULL) @@ -71,19 +108,18 @@ char_u *parse_shape_opt(int what) return (char_u *)N_("E546: Illegal mode"); commap = vim_strchr(modep, ','); - /* - * Repeat for all mode's before the colon. - * For the 'a' mode, we loop to handle all the modes. - */ + // Repeat for all modes before the colon. + // For the 'a' mode, we loop to handle all the modes. all_idx = -1; assert(modep < colonp); while (modep < colonp || all_idx >= 0) { if (all_idx < 0) { - /* Find the mode. */ - if (modep[1] == '-' || modep[1] == ':') + // Find the mode + if (modep[1] == '-' || modep[1] == ':') { len = 1; - else + } else { len = 2; + } if (len == 1 && TOLOWER_ASC(modep[0]) == 'a') { all_idx = SHAPE_IDX_COUNT - 1; @@ -100,15 +136,15 @@ char_u *parse_shape_opt(int what) modep += len + 1; } - if (all_idx >= 0) + if (all_idx >= 0) { idx = all_idx--; - else if (round == 2) { + } else if (round == 2) { { - /* Set the defaults, for the missing parts */ + // Set the defaults, for the missing parts shape_table[idx].shape = SHAPE_BLOCK; - shape_table[idx].blinkwait = 700L; - shape_table[idx].blinkon = 400L; - shape_table[idx].blinkoff = 250L; + shape_table[idx].blinkwait = 0L; + shape_table[idx].blinkon = 0L; + shape_table[idx].blinkoff = 0L; } } @@ -208,6 +244,55 @@ char_u *parse_shape_opt(int what) shape_table[SHAPE_IDX_VE].id_lm = shape_table[SHAPE_IDX_V].id_lm; } } - + ui_mode_info_set(); return NULL; } + + +/// Map cursor mode from string to integer +/// +/// @param mode Fullname of the mode whose id we are looking for +/// @return -1 in case of failure, else the matching SHAPE_ID* integer +int cursor_mode_str2int(const char *mode) +{ + for (int current_mode = 0; current_mode < SHAPE_IDX_COUNT; current_mode++) { + if (strcmp(shape_table[current_mode].full_name, mode) == 0) { + return current_mode; + } + } + WLOG("Unknown mode %s", mode); + return -1; +} + + +/// Return the index into shape_table[] for the current mode. +int cursor_get_mode_idx(void) +{ + if (State == SHOWMATCH) { + return SHAPE_IDX_SM; + } else if (State & VREPLACE_FLAG) { + return SHAPE_IDX_R; + } else if (State & REPLACE_FLAG) { + return SHAPE_IDX_R; + } else if (State & INSERT) { + return SHAPE_IDX_I; + } else if (State & CMDLINE) { + if (cmdline_at_end()) { + return SHAPE_IDX_C; + } else if (cmdline_overstrike()) { + return SHAPE_IDX_CR; + } else { + return SHAPE_IDX_CI; + } + } else if (finish_op) { + return SHAPE_IDX_O; + } else if (VIsual_active) { + if (*p_sel == 'e') { + return SHAPE_IDX_VE; + } else { + return SHAPE_IDX_V; + } + } else { + return SHAPE_IDX_N; + } +} diff --git a/src/nvim/cursor_shape.h b/src/nvim/cursor_shape.h index 9ce1b6e0a0..2c466603f0 100644 --- a/src/nvim/cursor_shape.h +++ b/src/nvim/cursor_shape.h @@ -1,32 +1,37 @@ #ifndef NVIM_CURSOR_SHAPE_H #define NVIM_CURSOR_SHAPE_H -/* - * struct to store values from 'guicursor' and 'mouseshape' - */ -/* Indexes in shape_table[] */ -#define SHAPE_IDX_N 0 /* Normal mode */ -#define SHAPE_IDX_V 1 /* Visual mode */ -#define SHAPE_IDX_I 2 /* Insert mode */ -#define SHAPE_IDX_R 3 /* Replace mode */ -#define SHAPE_IDX_C 4 /* Command line Normal mode */ -#define SHAPE_IDX_CI 5 /* Command line Insert mode */ -#define SHAPE_IDX_CR 6 /* Command line Replace mode */ -#define SHAPE_IDX_O 7 /* Operator-pending mode */ -#define SHAPE_IDX_VE 8 /* Visual mode with 'selection' exclusive */ -#define SHAPE_IDX_CLINE 9 /* On command line */ -#define SHAPE_IDX_STATUS 10 /* A status line */ -#define SHAPE_IDX_SDRAG 11 /* dragging a status line */ -#define SHAPE_IDX_VSEP 12 /* A vertical separator line */ -#define SHAPE_IDX_VDRAG 13 /* dragging a vertical separator line */ -#define SHAPE_IDX_MORE 14 /* Hit-return or More */ -#define SHAPE_IDX_MOREL 15 /* Hit-return or More in last line */ -#define SHAPE_IDX_SM 16 /* showing matching paren */ -#define SHAPE_IDX_COUNT 17 +#include "nvim/types.h" +#include "nvim/api/private/defs.h" -#define SHAPE_BLOCK 0 /* block cursor */ -#define SHAPE_HOR 1 /* horizontal bar cursor */ -#define SHAPE_VER 2 /* vertical bar cursor */ +/// struct to store values from 'guicursor' and 'mouseshape' +/// Indexes in shape_table[] +typedef enum { +SHAPE_IDX_N = 0, ///< Normal mode +SHAPE_IDX_V = 1, ///< Visual mode +SHAPE_IDX_I = 2, ///< Insert mode +SHAPE_IDX_R = 3, ///< Replace mode +SHAPE_IDX_C = 4, ///< Command line Normal mode +SHAPE_IDX_CI = 5, ///< Command line Insert mode +SHAPE_IDX_CR = 6, ///< Command line Replace mode +SHAPE_IDX_O = 7, ///< Operator-pending mode +SHAPE_IDX_VE = 8, ///< Visual mode with 'selection' exclusive +SHAPE_IDX_CLINE = 9, ///< On command line +SHAPE_IDX_STATUS = 10, ///< On status line +SHAPE_IDX_SDRAG = 11, ///< dragging a status line +SHAPE_IDX_VSEP = 12, ///< On vertical separator line +SHAPE_IDX_VDRAG = 13, ///< dragging a vertical separator line +SHAPE_IDX_MORE = 14, ///< Hit-return or More +SHAPE_IDX_MOREL = 15, ///< Hit-return or More in last line +SHAPE_IDX_SM = 16, ///< showing matching paren +SHAPE_IDX_COUNT = 17 +} ModeShape; + +typedef enum { +SHAPE_BLOCK = 0, ///< block cursor +SHAPE_HOR = 1, ///< horizontal bar cursor +SHAPE_VER = 2 ///< vertical bar cursor +} CursorShape; #define MSHAPE_NUMBERED 1000 /* offset for shapes identified by number */ #define MSHAPE_HIDE 1 /* hide mouse pointer */ @@ -35,18 +40,20 @@ #define SHAPE_CURSOR 2 /* used for text cursor shape */ typedef struct cursor_entry { - int shape; /* one of the SHAPE_ defines */ - int mshape; /* one of the MSHAPE defines */ - int percentage; /* percentage of cell for bar */ - long blinkwait; /* blinking, wait time before blinking starts */ - long blinkon; /* blinking, on time */ - long blinkoff; /* blinking, off time */ - int id; /* highlight group ID */ - int id_lm; /* highlight group ID for :lmap mode */ - char *name; /* mode name (fixed) */ - char used_for; /* SHAPE_MOUSE and/or SHAPE_CURSOR */ + char *full_name; ///< mode description + CursorShape shape; ///< cursor shape: one of the SHAPE_ defines + int mshape; ///< mouse shape: one of the MSHAPE defines + int percentage; ///< percentage of cell for bar + long blinkwait; ///< blinking, wait time before blinking starts + long blinkon; ///< blinking, on time + long blinkoff; ///< blinking, off time + int id; ///< highlight group ID + int id_lm; ///< highlight group ID for :lmap mode + char *name; ///< mode short name + char used_for; ///< SHAPE_MOUSE and/or SHAPE_CURSOR } cursorentry_T; +extern cursorentry_T shape_table[SHAPE_IDX_COUNT]; #ifdef INCLUDE_GENERATED_DECLARATIONS # include "cursor_shape.h.generated.h" diff --git a/src/nvim/diff.c b/src/nvim/diff.c index 11ade20c1c..cc0f3b2629 100644 --- a/src/nvim/diff.c +++ b/src/nvim/diff.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /// @file diff.c /// /// Code for diff'ing two, three or four buffers. @@ -132,6 +135,20 @@ void diff_buf_add(buf_T *buf) EMSGN(_("E96: Cannot diff more than %" PRId64 " buffers"), DB_COUNT); } +/// +/// Remove all buffers to make diffs for. +/// +static void diff_buf_clear(void) +{ + for (int i = 0; i < DB_COUNT; i++) { + if (curtab->tp_diffbuf[i] != NULL) { + curtab->tp_diffbuf[i] = NULL; + curtab->tp_diff_invalid = true; + diff_redraw(true); + } + } +} + /// Find buffer "buf" in the list of diff buffers for the current tab page. /// /// @param buf The buffer to find. @@ -1030,10 +1047,7 @@ void ex_diffsplit(exarg_T *eap) if (bufref_valid(&old_curbuf)) { // Move the cursor position to that of the old window. curwin->w_cursor.lnum = diff_get_corresponding_line( - old_curbuf.br_buf, - old_curwin->w_cursor.lnum, - curbuf, - curwin->w_cursor.lnum); + old_curbuf.br_buf, old_curwin->w_cursor.lnum); } } // Now that lines are folded scroll to show the cursor at the same @@ -1076,8 +1090,8 @@ void diff_win_options(win_T *wp, int addbuf) if (!wp->w_p_diff) { wp->w_p_wrap_save = wp->w_p_wrap; } - wp->w_p_wrap = FALSE; - curwin = wp; + wp->w_p_wrap = false; + curwin = wp; // -V519 curbuf = curwin->w_buffer; if (!wp->w_p_diff) { @@ -1175,6 +1189,11 @@ void ex_diffoff(exarg_T *eap) diffwin |= wp->w_p_diff; } + // Also remove hidden buffers from the list. + if (eap->forceit) { + diff_buf_clear(); + } + // Remove "hor" from from 'scrollopt' if there are no diff windows left. if (!diffwin && (vim_strchr(p_sbo, 'h') != NULL)) { do_cmdline_cmd("set sbo-=hor"); @@ -1586,7 +1605,7 @@ static int diff_cmp(char_u *s1, char_u *s2) } if ((diff_flags & DIFF_ICASE) && !(diff_flags & DIFF_IWHITE)) { - return mb_stricmp(s1, s2); + return mb_stricmp((const char *)s1, (const char *)s2); } // Ignore white space changes and possibly ignore case. @@ -2308,7 +2327,7 @@ void ex_diffgetput(exarg_T *eap) // Adjust marks. This will change the following entries! if (added != 0) { - mark_adjust(lnum, lnum + count - 1, (long)MAXLNUM, (long)added); + mark_adjust(lnum, lnum + count - 1, (long)MAXLNUM, (long)added, false); if (curwin->w_cursor.lnum >= lnum) { // Adjust the cursor position if it's in/after the changed // lines. @@ -2460,25 +2479,17 @@ int diff_move_to(int dir, long count) return OK; } -/// Finds the corresponding line in a diff. -/// -/// @param buf1 -/// @param lnum1 -/// @param buf2 -/// @param lnum3 -/// -/// @return The corresponding line. -linenr_T diff_get_corresponding_line(buf_T *buf1, linenr_T lnum1, buf_T *buf2, - linenr_T lnum3) +/// Return the line number in the current window that is closest to "lnum1" in +/// "buf1" in diff mode. +static linenr_T diff_get_corresponding_line_int(buf_T *buf1, linenr_T lnum1) { int idx1; int idx2; diff_T *dp; int baseline = 0; - linenr_T lnum2; idx1 = diff_buf_idx(buf1); - idx2 = diff_buf_idx(buf2); + idx2 = diff_buf_idx(curbuf); if ((idx1 == DB_COUNT) || (idx2 == DB_COUNT) @@ -2498,15 +2509,9 @@ linenr_T diff_get_corresponding_line(buf_T *buf1, linenr_T lnum1, buf_T *buf2, for (dp = curtab->tp_first_diff; dp != NULL; dp = dp->df_next) { if (dp->df_lnum[idx1] > lnum1) { - lnum2 = lnum1 - baseline; - - // don't end up past the end of the file - if (lnum2 > buf2->b_ml.ml_line_count) { - lnum2 = buf2->b_ml.ml_line_count; - } - - return lnum2; - } else if ((dp->df_lnum[idx1] + dp->df_count[idx1]) > lnum1) { + return lnum1 - baseline; + } + if ((dp->df_lnum[idx1] + dp->df_count[idx1]) > lnum1) { // Inside the diffblock baseline = lnum1 - dp->df_lnum[idx1]; @@ -2515,30 +2520,42 @@ linenr_T diff_get_corresponding_line(buf_T *buf1, linenr_T lnum1, buf_T *buf2, } return dp->df_lnum[idx2] + baseline; - } else if ((dp->df_lnum[idx1] == lnum1) - && (dp->df_count[idx1] == 0) - && (dp->df_lnum[idx2] <= lnum3) - && ((dp->df_lnum[idx2] + dp->df_count[idx2]) > lnum3)) { + } + if ((dp->df_lnum[idx1] == lnum1) + && (dp->df_count[idx1] == 0) + && (dp->df_lnum[idx2] <= curwin->w_cursor.lnum) + && ((dp->df_lnum[idx2] + dp->df_count[idx2]) + > curwin->w_cursor.lnum)) { // Special case: if the cursor is just after a zero-count // block (i.e. all filler) and the target cursor is already // inside the corresponding block, leave the target cursor // unmoved. This makes repeated CTRL-W W operations work // as expected. - return lnum3; + return curwin->w_cursor.lnum; } baseline = (dp->df_lnum[idx1] + dp->df_count[idx1]) - - (dp->df_lnum[idx2] + dp->df_count[idx2]); + - (dp->df_lnum[idx2] + dp->df_count[idx2]); } // If we get here then the cursor is after the last diff - lnum2 = lnum1 - baseline; + return lnum1 - baseline; +} + +/// Finds the corresponding line in a diff. +/// +/// @param buf1 +/// @param lnum1 +/// +/// @return The corresponding line. +linenr_T diff_get_corresponding_line(buf_T *buf1, linenr_T lnum1) +{ + linenr_T lnum = diff_get_corresponding_line_int(buf1, lnum1); // don't end up past the end of the file - if (lnum2 > buf2->b_ml.ml_line_count) { - lnum2 = buf2->b_ml.ml_line_count; + if (lnum > curbuf->b_ml.ml_line_count) { + return curbuf->b_ml.ml_line_count; } - - return lnum2; + return lnum; } /// For line "lnum" in the current window find the equivalent lnum in window diff --git a/src/nvim/diff.h b/src/nvim/diff.h index f6cef1cafd..3624ce29bb 100644 --- a/src/nvim/diff.h +++ b/src/nvim/diff.h @@ -1,6 +1,9 @@ #ifndef NVIM_DIFF_H #define NVIM_DIFF_H +#include "nvim/pos.h" +#include "nvim/ex_cmds_defs.h" + #ifdef INCLUDE_GENERATED_DECLARATIONS # include "diff.h.generated.h" #endif diff --git a/src/nvim/digraph.c b/src/nvim/digraph.c index 6ba6e659a6..dbcc8db109 100644 --- a/src/nvim/digraph.c +++ b/src/nvim/digraph.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /// @file digraph.c /// /// code for digraphs @@ -790,6 +793,7 @@ static digr_T digraphdefault[] = { '/', '-', 0x2020 }, { '/', '=', 0x2021 }, { '.', '.', 0x2025 }, + { ',', '.', 0x2026 }, { '%', '0', 0x2030 }, { '1', '\'', 0x2032 }, { '2', '\'', 0x2033 }, @@ -1448,10 +1452,8 @@ int get_digraph(int cmdline) { int cc; no_mapping++; - allow_keys++; int c = plain_vgetc(); no_mapping--; - allow_keys--; if (c != ESC) { // ESC cancels CTRL-K @@ -1468,10 +1470,8 @@ int get_digraph(int cmdline) add_to_showcmd(c); } no_mapping++; - allow_keys++; cc = plain_vgetc(); no_mapping--; - allow_keys--; if (cc != ESC) { // ESC cancels CTRL-K @@ -1573,7 +1573,8 @@ int getdigraph(int char1, int char2, int meta_char) if (((retval = getexactdigraph(char1, char2, meta_char)) == char2) && (char1 != char2) - && ((retval = getexactdigraph(char2, char1, meta_char)) == char1)) { + && ((retval = getexactdigraph(char2, char1, meta_char)) // -V764 + == char1)) { return char2; } return retval; @@ -1679,11 +1680,7 @@ static void printdigraph(digr_T *dp) int list_width; - if ((dy_flags & DY_UHEX) || has_mbyte) { - list_width = 13; - } else { - list_width = 11; - } + list_width = 13; if (dp->result != 0) { if (msg_col > Columns - list_width) { @@ -1699,20 +1696,16 @@ static void printdigraph(digr_T *dp) } } - p = buf; + p = &buf[0]; *p++ = dp->char1; *p++ = dp->char2; *p++ = ' '; - if (has_mbyte) { - // add a space to draw a composing char on - if (enc_utf8 && utf_iscomposing(dp->result)) { - *p++ = ' '; - } - p += (*mb_char2bytes)(dp->result, p); - } else { - *p++ = (char_u)dp->result; + // add a space to draw a composing char on + if (utf_iscomposing(dp->result)) { + *p++ = ' '; } + p += (*mb_char2bytes)(dp->result, p); if (char2cells(dp->result) == 1) { *p++ = ' '; diff --git a/src/nvim/digraph.h b/src/nvim/digraph.h index b623969e08..1b73ccaf3f 100644 --- a/src/nvim/digraph.h +++ b/src/nvim/digraph.h @@ -1,6 +1,9 @@ #ifndef NVIM_DIGRAPH_H #define NVIM_DIGRAPH_H +#include "nvim/types.h" +#include "nvim/ex_cmds_defs.h" + #ifdef INCLUDE_GENERATED_DECLARATIONS # include "digraph.h.generated.h" #endif diff --git a/src/nvim/edit.c b/src/nvim/edit.c index aa029c38a2..2bafb77fef 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -1,3 +1,6 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /* * edit.c: functions for Insert mode */ @@ -15,6 +18,7 @@ #include "nvim/cursor.h" #include "nvim/digraph.h" #include "nvim/eval.h" +#include "nvim/eval/typval.h" #include "nvim/ex_docmd.h" #include "nvim/ex_getln.h" #include "nvim/farsi.h" @@ -458,7 +462,7 @@ static void insert_enter(InsertState *s) // Always update o_lnum, so that a "CTRL-O ." that adds a line // still puts the cursor back after the inserted text. - if (ins_at_eol && gchar_cursor() == NUL) { + if (ins_at_eol) { o_lnum = curwin->w_cursor.lnum; } @@ -689,11 +693,9 @@ static int insert_execute(VimState *state, int key) if (s->c == Ctrl_BSL) { // may need to redraw when no more chars available now ins_redraw(false); - ++no_mapping; - ++allow_keys; + no_mapping++; s->c = plain_vgetc(); - --no_mapping; - --allow_keys; + no_mapping--; if (s->c != Ctrl_N && s->c != Ctrl_G && s->c != Ctrl_O) { // it's something else vungetc(s->c); @@ -972,14 +974,6 @@ static int insert_handle_key(InsertState *s) multiqueue_process_events(main_loop.events); break; - case K_FOCUSGAINED: // Neovim has been given focus - apply_autocmds(EVENT_FOCUSGAINED, NULL, NULL, false, curbuf); - break; - - case K_FOCUSLOST: // Neovim has lost focus - apply_autocmds(EVENT_FOCUSLOST, NULL, NULL, false, curbuf); - break; - case K_HOME: // case K_KHOME: case K_S_HOME: @@ -1424,7 +1418,7 @@ static void ins_ctrl_v(void) edit_putchar('^', TRUE); did_putchar = TRUE; } - AppendToRedobuff((char_u *)CTRL_V_STR); /* CTRL-V */ + AppendToRedobuff(CTRL_V_STR); add_to_showcmd_c(Ctrl_V); @@ -1978,7 +1972,6 @@ static bool ins_compl_accept_char(int c) */ int ins_compl_add_infercase(char_u *str, int len, int icase, char_u *fname, int dir, int flags) { - char_u *p; int i, c; int actual_len; /* Take multi-byte characters */ int actual_compl_length; /* into account. */ @@ -1988,11 +1981,11 @@ int ins_compl_add_infercase(char_u *str, int len, int icase, char_u *fname, int int was_letter = FALSE; if (p_ic && curbuf->b_p_inf && len > 0) { - /* Infer case of completed part. */ + // Infer case of completed part. - /* Find actual length of completion. */ + // Find actual length of completion. if (has_mbyte) { - p = str; + const char_u *p = str; actual_len = 0; while (*p != NUL) { mb_ptr_adv(p); @@ -2003,7 +1996,7 @@ int ins_compl_add_infercase(char_u *str, int len, int icase, char_u *fname, int /* Find actual length of original text. */ if (has_mbyte) { - p = compl_orig_text; + const char_u *p = compl_orig_text; actual_compl_length = 0; while (*p != NUL) { mb_ptr_adv(p); @@ -2019,27 +2012,35 @@ int ins_compl_add_infercase(char_u *str, int len, int icase, char_u *fname, int /* Allocate wide character array for the completion and fill it. */ wca = xmalloc(actual_len * sizeof(*wca)); - p = str; - for (i = 0; i < actual_len; ++i) - if (has_mbyte) - wca[i] = mb_ptr2char_adv(&p); - else - wca[i] = *(p++); + { + const char_u *p = str; + for (i = 0; i < actual_len; i++) { + if (has_mbyte) { + wca[i] = mb_ptr2char_adv(&p); + } else { + wca[i] = *(p++); + } + } + } - /* Rule 1: Were any chars converted to lower? */ - p = compl_orig_text; - for (i = 0; i < min_len; ++i) { - if (has_mbyte) - c = mb_ptr2char_adv(&p); - else - c = *(p++); - if (vim_islower(c)) { - has_lower = TRUE; - if (vim_isupper(wca[i])) { - /* Rule 1 is satisfied. */ - for (i = actual_compl_length; i < actual_len; ++i) - wca[i] = vim_tolower(wca[i]); - break; + // Rule 1: Were any chars converted to lower? + { + const char_u *p = compl_orig_text; + for (i = 0; i < min_len; i++) { + if (has_mbyte) { + c = mb_ptr2char_adv(&p); + } else { + c = *(p++); + } + if (mb_islower(c)) { + has_lower = true; + if (mb_isupper(wca[i])) { + // Rule 1 is satisfied. + for (i = actual_compl_length; i < actual_len; i++) { + wca[i] = mb_tolower(wca[i]); + } + break; + } } } } @@ -2049,84 +2050,110 @@ int ins_compl_add_infercase(char_u *str, int len, int icase, char_u *fname, int * upper case. */ if (!has_lower) { - p = compl_orig_text; - for (i = 0; i < min_len; ++i) { - if (has_mbyte) + const char_u *p = compl_orig_text; + for (i = 0; i < min_len; i++) { + if (has_mbyte) { c = mb_ptr2char_adv(&p); - else + } else { c = *(p++); - if (was_letter && vim_isupper(c) && vim_islower(wca[i])) { - /* Rule 2 is satisfied. */ - for (i = actual_compl_length; i < actual_len; ++i) - wca[i] = vim_toupper(wca[i]); + } + if (was_letter && mb_isupper(c) && mb_islower(wca[i])) { + // Rule 2 is satisfied. + for (i = actual_compl_length; i < actual_len; i++) { + wca[i] = mb_toupper(wca[i]); + } break; } - was_letter = vim_islower(c) || vim_isupper(c); + was_letter = mb_islower(c) || mb_isupper(c); } } - /* Copy the original case of the part we typed. */ - p = compl_orig_text; - for (i = 0; i < min_len; ++i) { - if (has_mbyte) - c = mb_ptr2char_adv(&p); - else - c = *(p++); - if (vim_islower(c)) - wca[i] = vim_tolower(wca[i]); - else if (vim_isupper(c)) - wca[i] = vim_toupper(wca[i]); + // Copy the original case of the part we typed. + { + const char_u *p = compl_orig_text; + for (i = 0; i < min_len; i++) { + if (has_mbyte) { + c = mb_ptr2char_adv(&p); + } else { + c = *(p++); + } + if (mb_islower(c)) { + wca[i] = mb_tolower(wca[i]); + } else if (mb_isupper(c)) { + wca[i] = mb_toupper(wca[i]); + } + } } - /* - * Generate encoding specific output from wide character array. - * Multi-byte characters can occupy up to five bytes more than - * ASCII characters, and we also need one byte for NUL, so stay - * six bytes away from the edge of IObuff. - */ - p = IObuff; - i = 0; - while (i < actual_len && (p - IObuff + 6) < IOSIZE) - if (has_mbyte) - p += (*mb_char2bytes)(wca[i++], p); - else - *(p++) = wca[i++]; - *p = NUL; + // Generate encoding specific output from wide character array. + // Multi-byte characters can occupy up to five bytes more than + // ASCII characters, and we also need one byte for NUL, so stay + // six bytes away from the edge of IObuff. + { + char_u *p = IObuff; + i = 0; + while (i < actual_len && (p - IObuff + 6) < IOSIZE) { + if (has_mbyte) { + p += (*mb_char2bytes)(wca[i++], p); + } else { + *(p++) = wca[i++]; + } + } + *p = NUL; + } xfree(wca); - return ins_compl_add(IObuff, len, icase, fname, NULL, dir, - flags, FALSE); + return ins_compl_add(IObuff, len, icase, fname, NULL, false, dir, flags, + false); } - return ins_compl_add(str, len, icase, fname, NULL, dir, flags, FALSE); + return ins_compl_add(str, len, icase, fname, NULL, false, dir, flags, false); } -/* - * Add a match to the list of matches. - * If the given string is already in the list of completions, then return - * NOTDONE, otherwise add it to the list and return OK. If there is an error - * then FAIL is returned. - */ -static int -ins_compl_add ( - char_u *str, - int len, - int icase, - char_u *fname, - char_u **cptext, /* extra text for popup menu or NULL */ - int cdir, - int flags, - int adup /* accept duplicate match */ -) +/// Add a match to the list of matches +/// +/// @param[in] str Match to add. +/// @param[in] len Match length, -1 to use #STRLEN. +/// @param[in] icase Whether case is to be ignored. +/// @param[in] fname File name match comes from. May be NULL. +/// @param[in] cptext Extra text for popup menu. May be NULL. If not NULL, +/// must have exactly #CPT_COUNT items. +/// @param[in] cptext_allocated If true, will not copy cptext strings. +/// +/// @note Will free strings in case of error. +/// cptext itself will not be freed. +/// @param[in] cdir Completion direction. +/// @param[in] adup True if duplicate matches are to be accepted. +/// +/// @return NOTDONE if the given string is already in the list of completions, +/// otherwise it is added to the list and OK is returned. FAIL will be +/// returned in case of error. +static int ins_compl_add(char_u *const str, int len, + const bool icase, char_u *const fname, + char_u *const *const cptext, + const bool cptext_allocated, + const Direction cdir, int flags, const bool adup) + FUNC_ATTR_NONNULL_ARG(1) { compl_T *match; - int dir = (cdir == 0 ? compl_direction : cdir); + int dir = (cdir == kDirectionNotSet ? compl_direction : cdir); os_breakcheck(); - if (got_int) +#define FREE_CPTEXT(cptext, cptext_allocated) \ + do { \ + if (cptext != NULL && cptext_allocated) { \ + for (size_t i = 0; i < CPT_COUNT; i++) { \ + xfree(cptext[i]); \ + } \ + } \ + } while (0) + if (got_int) { + FREE_CPTEXT(cptext, cptext_allocated); return FAIL; - if (len < 0) + } + if (len < 0) { len = (int)STRLEN(str); + } /* * If the same match is already present, don't add it. @@ -2134,10 +2161,12 @@ ins_compl_add ( if (compl_first_match != NULL && !adup) { match = compl_first_match; do { - if ( !(match->cp_flags & ORIGINAL_TEXT) - && STRNCMP(match->cp_str, str, len) == 0 - && match->cp_str[len] == NUL) + if (!(match->cp_flags & ORIGINAL_TEXT) + && STRNCMP(match->cp_str, str, len) == 0 + && match->cp_str[len] == NUL) { + FREE_CPTEXT(cptext, cptext_allocated); return NOTDONE; + } match = match->cp_next; } while (match != NULL && match != compl_first_match); } @@ -2168,16 +2197,26 @@ ins_compl_add ( else if (fname != NULL) { match->cp_fname = vim_strsave(fname); flags |= FREE_FNAME; - } else + } else { match->cp_fname = NULL; + } match->cp_flags = flags; if (cptext != NULL) { int i; - for (i = 0; i < CPT_COUNT; ++i) - if (cptext[i] != NULL && *cptext[i] != NUL) - match->cp_text[i] = vim_strsave(cptext[i]); + for (i = 0; i < CPT_COUNT; i++) { + if (cptext[i] == NULL) { + continue; + } + if (*cptext[i] != NUL) { + match->cp_text[i] = (cptext_allocated + ? cptext[i] + : (char_u *)xstrdup((char *)cptext[i])); + } else if (cptext_allocated) { + xfree(cptext[i]); + } + } } /* @@ -2258,9 +2297,10 @@ static void ins_compl_longest_match(compl_T *match) c1 = *p; c2 = *s; } - if (match->cp_icase ? (vim_tolower(c1) != vim_tolower(c2)) - : (c1 != c2)) + if (match->cp_icase ? (mb_tolower(c1) != mb_tolower(c2)) + : (c1 != c2)) { break; + } if (has_mbyte) { mb_ptr_adv(p); mb_ptr_adv(s); @@ -2300,9 +2340,10 @@ static void ins_compl_add_matches(int num_matches, char_u **matches, int icase) for (i = 0; i < num_matches && add_r != FAIL; i++) if ((add_r = ins_compl_add(matches[i], -1, icase, - NULL, NULL, dir, 0, FALSE)) == OK) - /* if dir was BACKWARD then honor it just once */ + NULL, NULL, false, dir, 0, false)) == OK) { + // If dir was BACKWARD then honor it just once. dir = FORWARD; + } FreeWild(num_matches, matches); } @@ -2357,6 +2398,7 @@ void set_completion(colnr_T startcol, list_T *list) ins_compl_prep(' '); } ins_compl_clear(); + ins_compl_free(); compl_direction = FORWARD; if (startcol > curwin->w_cursor.col) @@ -2366,8 +2408,8 @@ void set_completion(colnr_T startcol, list_T *list) /* compl_pattern doesn't need to be set */ compl_orig_text = vim_strnsave(get_cursor_line_ptr() + compl_col, compl_length); - if (ins_compl_add(compl_orig_text, -1, p_ic, NULL, NULL, 0, - ORIGINAL_TEXT, FALSE) != OK) { + if (ins_compl_add(compl_orig_text, -1, p_ic, NULL, NULL, false, 0, + ORIGINAL_TEXT, false) != OK) { return; } @@ -2889,7 +2931,7 @@ static void ins_compl_clear(void) compl_orig_text = NULL; compl_enter_selects = FALSE; // clear v:completed_item - set_vim_var_dict(VV_COMPLETED_ITEM, dict_alloc()); + set_vim_var_dict(VV_COMPLETED_ITEM, tv_dict_alloc()); } /// Check that Insert completion is active. @@ -3117,8 +3159,7 @@ static bool ins_compl_prep(int c) /* Ignore end of Select mode mapping and mouse scroll buttons. */ if (c == K_SELECT || c == K_MOUSEDOWN || c == K_MOUSEUP - || c == K_MOUSELEFT || c == K_MOUSERIGHT || c == K_EVENT - || c == K_FOCUSGAINED || c == K_FOCUSLOST) { + || c == K_MOUSELEFT || c == K_MOUSERIGHT || c == K_EVENT) { return retval; } @@ -3381,10 +3422,10 @@ static void ins_compl_fixRedoBufForLeader(char_u *ptr_arg) len -= (*mb_head_off)(p, p + len); for (p += len; *p != NUL; mb_ptr_adv(p)) AppendCharToRedobuff(K_BS); - } else + } else { len = 0; - if (ptr != NULL) - AppendToRedobuffLit(ptr + len, -1); + } + AppendToRedobuffLit(ptr + len, -1); } /* @@ -3434,7 +3475,6 @@ expand_by_function ( { list_T *matchlist = NULL; dict_T *matchdict = NULL; - char_u *args[2]; char_u *funcname; pos_T pos; win_T *curwin_save; @@ -3445,9 +3485,8 @@ expand_by_function ( if (*funcname == NUL) return; - /* Call 'completefunc' to obtain the list of matches. */ - args[0] = (char_u *)"0"; - args[1] = base; + // Call 'completefunc' to obtain the list of matches. + const char_u *const args[2] = { (char_u *)"0", base }; pos = curwin->w_cursor; curwin_save = curwin; @@ -3463,8 +3502,8 @@ expand_by_function ( matchdict = rettv.vval.v_dict; break; default: - /* TODO: Give error message? */ - clear_tv(&rettv); + // TODO(brammool): Give error message? + tv_clear(&rettv); break; } } @@ -3486,10 +3525,12 @@ expand_by_function ( ins_compl_add_dict(matchdict); theend: - if (matchdict != NULL) - dict_unref(matchdict); - if (matchlist != NULL) - list_unref(matchlist); + if (matchdict != NULL) { + tv_dict_unref(matchdict); + } + if (matchlist != NULL) { + tv_list_unref(matchlist); + } } /* @@ -3518,53 +3559,60 @@ static void ins_compl_add_dict(dict_T *dict) dictitem_T *di_refresh; dictitem_T *di_words; - /* Check for optional "refresh" item. */ - compl_opt_refresh_always = FALSE; - di_refresh = dict_find(dict, (char_u *)"refresh", 7); + // Check for optional "refresh" item. + compl_opt_refresh_always = false; + di_refresh = tv_dict_find(dict, S_LEN("refresh")); if (di_refresh != NULL && di_refresh->di_tv.v_type == VAR_STRING) { - char_u *v = di_refresh->di_tv.vval.v_string; + const char *v = (const char *)di_refresh->di_tv.vval.v_string; - if (v != NULL && STRCMP(v, (char_u *)"always") == 0) - compl_opt_refresh_always = TRUE; + if (v != NULL && strcmp(v, "always") == 0) { + compl_opt_refresh_always = true; + } } - /* Add completions from a "words" list. */ - di_words = dict_find(dict, (char_u *)"words", 5); - if (di_words != NULL && di_words->di_tv.v_type == VAR_LIST) + // Add completions from a "words" list. + di_words = tv_dict_find(dict, S_LEN("words")); + if (di_words != NULL && di_words->di_tv.v_type == VAR_LIST) { ins_compl_add_list(di_words->di_tv.vval.v_list); + } } -/* - * Add a match to the list of matches from a typeval_T. - * If the given string is already in the list of completions, then return - * NOTDONE, otherwise add it to the list and return OK. If there is an error - * then FAIL is returned. - */ -int ins_compl_add_tv(typval_T *tv, int dir) +/// Add a match to the list of matches from VimL object +/// +/// @param[in] tv Object to get matches from. +/// @param[in] dir Completion direction. +/// +/// @return NOTDONE if the given string is already in the list of completions, +/// otherwise it is added to the list and OK is returned. FAIL will be +/// returned in case of error. +int ins_compl_add_tv(typval_T *const tv, const Direction dir) + FUNC_ATTR_NONNULL_ALL { - char_u *word; - int icase = FALSE; - int adup = FALSE; - int aempty = FALSE; - char_u *(cptext[CPT_COUNT]); + const char *word; + bool icase = false; + bool adup = false; + bool aempty = false; + char *(cptext[CPT_COUNT]); if (tv->v_type == VAR_DICT && tv->vval.v_dict != NULL) { - word = get_dict_string(tv->vval.v_dict, "word", false); - cptext[CPT_ABBR] = get_dict_string(tv->vval.v_dict, "abbr", false); - cptext[CPT_MENU] = get_dict_string(tv->vval.v_dict, "menu", false); - cptext[CPT_KIND] = get_dict_string(tv->vval.v_dict, "kind", false); - cptext[CPT_INFO] = get_dict_string(tv->vval.v_dict, "info", false); + word = tv_dict_get_string(tv->vval.v_dict, "word", false); + cptext[CPT_ABBR] = tv_dict_get_string(tv->vval.v_dict, "abbr", true); + cptext[CPT_MENU] = tv_dict_get_string(tv->vval.v_dict, "menu", true); + cptext[CPT_KIND] = tv_dict_get_string(tv->vval.v_dict, "kind", true); + cptext[CPT_INFO] = tv_dict_get_string(tv->vval.v_dict, "info", true); - icase = get_dict_number(tv->vval.v_dict, "icase"); - adup = get_dict_number(tv->vval.v_dict, "dup"); - aempty = get_dict_number(tv->vval.v_dict, "empty"); + icase = (bool)tv_dict_get_number(tv->vval.v_dict, "icase"); + adup = (bool)tv_dict_get_number(tv->vval.v_dict, "dup"); + aempty = (bool)tv_dict_get_number(tv->vval.v_dict, "empty"); } else { - word = get_tv_string_chk(tv); + word = (const char *)tv_get_string_chk(tv); memset(cptext, 0, sizeof(cptext)); } - if (word == NULL || (!aempty && *word == NUL)) + if (word == NULL || (!aempty && *word == NUL)) { return FAIL; - return ins_compl_add(word, -1, icase, NULL, cptext, dir, 0, adup); + } + return ins_compl_add((char_u *)word, -1, icase, NULL, + (char_u **)cptext, true, dir, 0, adup); } /* @@ -3979,7 +4027,7 @@ static void ins_compl_delete(void) // causes flicker, thus we can't do that. changed_cline_bef_curs(); // clear v:completed_item - set_vim_var_dict(VV_COMPLETED_ITEM, dict_alloc()); + set_vim_var_dict(VV_COMPLETED_ITEM, tv_dict_alloc()); } // Insert the new text being completed. @@ -3994,17 +4042,21 @@ static void ins_compl_insert(int in_compl_func) // Set completed item. // { word, abbr, menu, kind, info } - dict_T *dict = dict_alloc(); - dict_add_nr_str(dict, "word", 0L, - EMPTY_IF_NULL(compl_shown_match->cp_str)); - dict_add_nr_str(dict, "abbr", 0L, - EMPTY_IF_NULL(compl_shown_match->cp_text[CPT_ABBR])); - dict_add_nr_str(dict, "menu", 0L, - EMPTY_IF_NULL(compl_shown_match->cp_text[CPT_MENU])); - dict_add_nr_str(dict, "kind", 0L, - EMPTY_IF_NULL(compl_shown_match->cp_text[CPT_KIND])); - dict_add_nr_str(dict, "info", 0L, - EMPTY_IF_NULL(compl_shown_match->cp_text[CPT_INFO])); + dict_T *dict = tv_dict_alloc(); + tv_dict_add_str(dict, S_LEN("word"), + (const char *)EMPTY_IF_NULL(compl_shown_match->cp_str)); + tv_dict_add_str( + dict, S_LEN("abbr"), + (const char *)EMPTY_IF_NULL(compl_shown_match->cp_text[CPT_ABBR])); + tv_dict_add_str( + dict, S_LEN("menu"), + (const char *)EMPTY_IF_NULL(compl_shown_match->cp_text[CPT_MENU])); + tv_dict_add_str( + dict, S_LEN("kind"), + (const char *)EMPTY_IF_NULL(compl_shown_match->cp_text[CPT_KIND])); + tv_dict_add_str( + dict, S_LEN("info"), + (const char *)EMPTY_IF_NULL(compl_shown_match->cp_text[CPT_INFO])); set_vim_var_dict(VV_COMPLETED_ITEM, dict); if (!in_compl_func) { compl_curr_match = compl_shown_match; @@ -4546,7 +4598,6 @@ static int ins_complete(int c, bool enable_pum) * Call user defined function 'completefunc' with "a:findstart" * set to 1 to obtain the length of text to use for completion. */ - char_u *args[2]; int col; char_u *funcname; pos_T pos; @@ -4565,8 +4616,7 @@ static int ins_complete(int c, bool enable_pum) return FAIL; } - args[0] = (char_u *)"1"; - args[1] = NULL; + const char_u *const args[2] = { (char_u *)"1", NULL }; pos = curwin->w_cursor; curwin_save = curwin; curbuf_save = curbuf; @@ -4666,8 +4716,8 @@ static int ins_complete(int c, bool enable_pum) /* Always add completion for the original text. */ xfree(compl_orig_text); compl_orig_text = vim_strnsave(line + compl_col, compl_length); - if (ins_compl_add(compl_orig_text, -1, p_ic, NULL, NULL, 0, - ORIGINAL_TEXT, FALSE) != OK) { + if (ins_compl_add(compl_orig_text, -1, p_ic, NULL, NULL, false, 0, + ORIGINAL_TEXT, false) != OK) { xfree(compl_pattern); compl_pattern = NULL; xfree(compl_orig_text); @@ -4856,14 +4906,17 @@ static unsigned quote_meta(char_u *dest, char_u *src, int len) if (ctrl_x_mode == CTRL_X_DICTIONARY || ctrl_x_mode == CTRL_X_THESAURUS) break; + // fallthrough case '~': if (!p_magic) /* quote these only if magic is set */ break; + // fallthrough case '\\': if (ctrl_x_mode == CTRL_X_DICTIONARY || ctrl_x_mode == CTRL_X_THESAURUS) break; - case '^': /* currently it's not needed. */ + // fallthrough + case '^': // currently it's not needed. case '$': m++; if (dest != NULL) @@ -5746,15 +5799,16 @@ comp_textwidth ( */ static void redo_literal(int c) { - char_u buf[10]; + char buf[10]; - /* Only digits need special treatment. Translate them into a string of - * three digits. */ + // Only digits need special treatment. Translate them into a string of + // three digits. if (ascii_isdigit(c)) { - vim_snprintf((char *)buf, sizeof(buf), "%03d", c); + vim_snprintf(buf, sizeof(buf), "%03d", c); AppendToRedobuff(buf); - } else + } else { AppendCharToRedobuff(c); + } } // start_arrow() is called when an arrow key is used in insert mode. @@ -5783,8 +5837,8 @@ static void start_arrow_common(pos_T *end_insert_pos, bool end_change) { if (!arrow_used && end_change) { // something has been inserted AppendToRedobuff(ESC_STR); - stop_insert(end_insert_pos, FALSE, FALSE); - arrow_used = TRUE; /* this means we stopped the current insert */ + stop_insert(end_insert_pos, false, false); + arrow_used = true; // This means we stopped the current insert. } check_spell_redraw(); } @@ -5841,7 +5895,7 @@ int stop_arrow(void) vr_lines_changed = 1; } ResetRedobuff(); - AppendToRedobuff((char_u *)"1i"); /* pretend we start an insertion */ + AppendToRedobuff("1i"); // Pretend we start an insertion. new_insert_skip = 2; } else if (ins_need_undo) { if (u_save_cursor() == OK) @@ -6306,12 +6360,13 @@ stuff_inserted ( } do { - stuffReadbuff(ptr); - /* a trailing "0" is inserted as "048", "^" as "^" */ - if (last) - stuffReadbuff((char_u *)(last == '0' - ? "\026\060\064\070" - : "\026^")); + stuffReadbuff((const char *)ptr); + // A trailing "0" is inserted as "048", "^" as "^". + if (last) { + stuffReadbuff((last == '0' + ? "\026\060\064\070" + : "\026^")); + } } while (--count > 0); if (last) @@ -7068,8 +7123,8 @@ static void ins_ctrl_g(void) */ static void ins_ctrl_hat(void) { - if (map_to_exists_mode((char_u *)"", LANGMAP, FALSE)) { - /* ":lmap" mappings exists, Toggle use of ":lmap" mappings. */ + if (map_to_exists_mode("", LANGMAP, false)) { + // ":lmap" mappings exists, Toggle use of ":lmap" mappings. if (State & LANGMAP) { curbuf->b_p_iminsert = B_IMODE_NONE; State &= ~LANGMAP; @@ -7104,13 +7159,12 @@ static bool ins_esc(long *count, int cmdchar, bool nomove) disabled_redraw = false; } if (!arrow_used) { - /* - * Don't append the ESC for "r" and "grx". - * When 'insertmode' is set only CTRL-L stops Insert mode. Needed for - * when "count" is non-zero. - */ - if (cmdchar != 'r' && cmdchar != 'v') - AppendToRedobuff(p_im ? (char_u *)"\014" : ESC_STR); + // Don't append the ESC for "r" and "grx". + // When 'insertmode' is set only CTRL-L stops Insert mode. Needed for + // when "count" is non-zero. + if (cmdchar != 'r' && cmdchar != 'v') { + AppendToRedobuff(p_im ? "\014" : ESC_STR); + } /* * Repeating insert may take a long time. Check for @@ -7264,7 +7318,8 @@ static bool ins_start_select(int c) // Execute the key in (insert) Select mode. stuffcharReadbuff(Ctrl_O); if (mod_mask) { - char_u buf[4] = { K_SPECIAL, KS_MODIFIER, mod_mask, NUL }; + const char buf[] = { (char)K_SPECIAL, (char)KS_MODIFIER, + (char)(uint8_t)mod_mask, NUL }; stuffReadbuff(buf); } stuffcharReadbuff(c); @@ -8072,11 +8127,11 @@ static bool ins_tab(void) return true; } - did_ai = FALSE; - did_si = FALSE; - can_si = FALSE; - can_si_back = FALSE; - AppendToRedobuff((char_u *)"\t"); + did_ai = false; + did_si = false; + can_si = false; + can_si_back = false; + AppendToRedobuff("\t"); if (p_sta && ind) { // insert tab in indent, use "shiftwidth" temp = get_sw_value(curbuf); @@ -8303,17 +8358,16 @@ static int ins_digraph(void) } - /* don't map the digraph chars. This also prevents the - * mode message to be deleted when ESC is hit */ - ++no_mapping; - ++allow_keys; + // don't map the digraph chars. This also prevents the + // mode message to be deleted when ESC is hit + no_mapping++; c = plain_vgetc(); - --no_mapping; - --allow_keys; - if (did_putchar) - /* when the line fits in 'columns' the '?' is at the start of the next - * line and will not be removed by the redraw */ + no_mapping--; + if (did_putchar) { + // when the line fits in 'columns' the '?' is at the start of the next + // line and will not be removed by the redraw edit_unputchar(); + } if (IS_SPECIAL(c) || mod_mask) { /* special key */ clear_showcmd(); @@ -8333,18 +8387,17 @@ static int ins_digraph(void) } add_to_showcmd_c(c); } - ++no_mapping; - ++allow_keys; + no_mapping++; cc = plain_vgetc(); - --no_mapping; - --allow_keys; - if (did_putchar) - /* when the line fits in 'columns' the '?' is at the start of the - * next line and will not be removed by a redraw */ + no_mapping--; + if (did_putchar) { + // when the line fits in 'columns' the '?' is at the start of the + // next line and will not be removed by a redraw edit_unputchar(); + } if (cc != ESC) { - AppendToRedobuff((char_u *)CTRL_V_STR); - c = getdigraph(c, cc, TRUE); + AppendToRedobuff(CTRL_V_STR); + c = getdigraph(c, cc, true); clear_showcmd(); return c; } @@ -8406,12 +8459,13 @@ static int ins_ctrl_ey(int tc) if (c != NUL) { long tw_save; - /* The character must be taken literally, insert like it - * was typed after a CTRL-V, and pretend 'textwidth' - * wasn't set. Digits, 'o' and 'x' are special after a - * CTRL-V, don't use it for these. */ - if (c < 256 && !isalnum(c)) - AppendToRedobuff((char_u *)CTRL_V_STR); /* CTRL-V */ + // The character must be taken literally, insert like it + // was typed after a CTRL-V, and pretend 'textwidth' + // wasn't set. Digits, 'o' and 'x' are special after a + // CTRL-V, don't use it for these. + if (c < 256 && !isalnum(c)) { + AppendToRedobuff(CTRL_V_STR); + } tw_save = curbuf->b_p_tw; curbuf->b_p_tw = -1; insert_special(c, TRUE, FALSE); diff --git a/src/nvim/eval.c b/src/nvim/eval.c index d4daffb469..577aa67c60 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -1,8 +1,12 @@ +// This is an open source non-commercial project. Dear PVS-Studio, please check +// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com + /* * eval.c: Expression evaluation. */ #include +#include #include #include #include @@ -20,6 +24,7 @@ #endif #include "nvim/eval.h" #include "nvim/buffer.h" +#include "nvim/channel.h" #include "nvim/charset.h" #include "nvim/cursor.h" #include "nvim/diff.h" @@ -43,6 +48,7 @@ #include "nvim/mbyte.h" #include "nvim/memline.h" #include "nvim/memory.h" +#include "nvim/menu.h" #include "nvim/message.h" #include "nvim/misc1.h" #include "nvim/keymap.h" @@ -94,7 +100,13 @@ #include "nvim/lib/kvec.h" #include "nvim/lib/khash.h" #include "nvim/lib/queue.h" -#include "nvim/eval/typval_encode.h" +#include "nvim/lua/executor.h" +#include "nvim/eval/typval.h" +#include "nvim/eval/executor.h" +#include "nvim/eval/gc.h" +#include "nvim/macros.h" + +// TODO(ZyX-I): Remove DICT_MAXNEST, make users be non-recursive instead #define DICT_MAXNEST 100 /* maximum nesting of lists and dicts */ @@ -132,31 +144,28 @@ * "newkey" is the key for the new item. */ typedef struct lval_S { - char_u *ll_name; /* start of variable name (can be NULL) */ - char_u *ll_exp_name; /* NULL or expanded name in allocated memory. */ - typval_T *ll_tv; /* Typeval of item being used. If "newkey" - isn't NULL it's the Dict to which to add - the item. */ - listitem_T *ll_li; /* The list item or NULL. */ - list_T *ll_list; /* The list or NULL. */ - int ll_range; /* TRUE when a [i:j] range was used */ - long ll_n1; /* First index for list */ - long ll_n2; /* Second index for list range */ - int ll_empty2; /* Second index is empty: [i:] */ - dict_T *ll_dict; /* The Dictionary or NULL */ - dictitem_T *ll_di; /* The dictitem or NULL */ - char_u *ll_newkey; /* New key for Dict in alloc. mem or NULL. */ + const char *ll_name; ///< Start of variable name (can be NULL). + size_t ll_name_len; ///< Length of the .ll_name. + char *ll_exp_name; ///< NULL or expanded name in allocated memory. + typval_T *ll_tv; ///< Typeval of item being used. If "newkey" + ///< isn't NULL it's the Dict to which to add the item. + listitem_T *ll_li; ///< The list item or NULL. + list_T *ll_list; ///< The list or NULL. + int ll_range; ///< TRUE when a [i:j] range was used. + long ll_n1; ///< First index for list. + long ll_n2; ///< Second index for list range. + int ll_empty2; ///< Second index is empty: [i:]. + dict_T *ll_dict; ///< The Dictionary or NULL. + dictitem_T *ll_di; ///< The dictitem or NULL. + char_u *ll_newkey; ///< New key for Dict in allocated memory or NULL. } lval_T; static char *e_letunexp = N_("E18: Unexpected characters in :let"); -static char *e_listidx = N_("E684: list index out of range: %" PRId64); -static char *e_undefvar = N_("E121: Undefined variable: %s"); static char *e_missbrac = N_("E111: Missing ']'"); static char *e_listarg = N_("E686: Argument of %s must be a List"); static char *e_listdictarg = N_( "E712: Argument of %s must be a List or Dictionary"); -static char *e_emptykey = N_("E713: Cannot use empty key for Dictionary"); static char *e_listreq = N_("E714: List required"); static char *e_dictreq = N_("E715: Dictionary required"); static char *e_stringreq = N_("E928: String required"); @@ -167,17 +176,20 @@ static char *e_funcexts = N_( static char *e_funcdict = N_("E717: Dictionary entry already exists"); static char *e_funcref = N_("E718: Funcref required"); static char *e_dictrange = N_("E719: Cannot use [:] with a Dictionary"); -static char *e_letwrong = N_("E734: Wrong variable type for %s="); static char *e_nofunc = N_("E130: Unknown function: %s"); static char *e_illvar = N_("E461: Illegal variable name: %s"); -static char *e_float_as_string = N_("E806: using Float as a String"); static const char *e_readonlyvar = N_( "E46: Cannot change read-only variable \"%.*s\""); -static char_u * const empty_string = (char_u *)""; +// TODO(ZyX-I): move to eval/executor +static char *e_letwrong = N_("E734: Wrong variable type for %s="); + static char_u * const namespace_char = (char_u *)"abglstvw"; -static dictitem_T globvars_var; /* variable used for g: */ +/// Variable used for g: +static ScopeDictDictItem globvars_var; + +/// g: value #define globvarht globvardict.dv_hashtab /* @@ -188,12 +200,15 @@ static hashtab_T compat_hashtab; hashtab_T func_hashtab; +// Used for checking if local variables or arguments used in a lambda. +static int *eval_lavars_used = NULL; + /* * Array to hold the hashtab with variables local to each sourced script. * Each item holds a variable (nameless) that points to the dict_T. */ typedef struct { - dictitem_T sv_var; + ScopeDictDictItem sv_var; dict_T sv_dict; } scriptvar_T; @@ -231,17 +246,44 @@ typedef enum { // The names of packages that once were loaded are remembered. static garray_T ga_loaded = { 0, 0, sizeof(char_u *), 4, NULL }; -// List heads for garbage collection. Although there can be a reference loop -// from partial to dict to partial, we don't need to keep track of the partial, -// since it will get freed when the dict is unused and gets freed. -static dict_T *first_dict = NULL; // list of all dicts -static list_T *first_list = NULL; // list of all lists - -#define FLEN_FIXED 40 - #define FUNCARG(fp, j) ((char_u **)(fp->uf_args.ga_data))[j] #define FUNCLINE(fp, j) ((char_u **)(fp->uf_lines.ga_data))[j] +/// Short variable name length +#define VAR_SHORT_LEN 20 +/// Number of fixed variables used for arguments +#define FIXVAR_CNT 12 + +struct funccall_S { + ufunc_T *func; ///< Function being called. + int linenr; ///< Next line to be executed. + int returned; ///< ":return" used. + /// Fixed variables for arguments. + TV_DICTITEM_STRUCT(VAR_SHORT_LEN + 1) fixvar[FIXVAR_CNT]; + dict_T l_vars; ///< l: local function variables. + ScopeDictDictItem l_vars_var; ///< Variable for l: scope. + dict_T l_avars; ///< a: argument variables. + ScopeDictDictItem l_avars_var; ///< Variable for a: scope. + list_T l_varlist; ///< List for a:000. + listitem_T l_listitems[MAX_FUNC_ARGS]; ///< List items for a:000. + typval_T *rettv; ///< Return value. + linenr_T breakpoint; ///< Next line with breakpoint or zero. + int dbg_tick; ///< Debug_tick when breakpoint was set. + int level; ///< Top nesting level of executed function. + proftime_T prof_child; ///< Time spent in a child. + funccall_T *caller; ///< Calling function or NULL. + int fc_refcount; ///< Number of user functions that reference this funccall. + int fc_copyID; ///< CopyID used for garbage collection. + garray_T fc_funcs; ///< List of ufunc_T* which keep a reference to "func". +}; + +///< Structure used by trans_function_name() +typedef struct { + dict_T *fd_dict; ///< Dictionary used. + char_u *fd_newkey; ///< New key in "dict" in allocated memory. + dictitem_T *fd_di; ///< Dictionary item used. +} funcdict_T; + /* * Info used by a ":for" loop. */ @@ -283,8 +325,8 @@ typedef enum { // variables with the VV_ defines. static struct vimvar { char *vv_name; ///< Name of the variable, without v:. - dictitem16_T vv_di; ///< Value and name for key (max 16 chars) - char vv_flags; ///< Flags: #VV_COMPAT, #VV_RO, #VV_RO_SBX. + TV_DICTITEM_STRUCT(17) vv_di; ///< Value and name for key (max 16 chars). + char vv_flags; ///< Flags: #VV_COMPAT, #VV_RO, #VV_RO_SBX. } vimvars[] = { // VV_ tails differing from upcased string literals: @@ -293,7 +335,7 @@ static struct vimvar { // VV_SEND_SERVER "servername" // VV_REG "register" // VV_OP "operator" - VV(VV_COUNT, "count", VAR_NUMBER, VV_COMPAT+VV_RO), + VV(VV_COUNT, "count", VAR_NUMBER, VV_RO), VV(VV_COUNT1, "count1", VAR_NUMBER, VV_RO), VV(VV_PREVCOUNT, "prevcount", VAR_NUMBER, VV_RO), VV(VV_ERRMSG, "errmsg", VAR_STRING, VV_COMPAT), @@ -324,6 +366,7 @@ static struct vimvar { VV(VV_DYING, "dying", VAR_NUMBER, VV_RO), VV(VV_EXCEPTION, "exception", VAR_STRING, VV_RO), VV(VV_THROWPOINT, "throwpoint", VAR_STRING, VV_RO), + VV(VV_STDERR, "stderr", VAR_NUMBER, VV_RO), VV(VV_REG, "register", VAR_STRING, VV_RO), VV(VV_CMDBANG, "cmdbang", VAR_NUMBER, VV_RO), VV(VV_INSERTMODE, "insertmode", VAR_STRING, VV_RO), @@ -389,56 +432,12 @@ static struct vimvar { #define vv_dict vv_di.di_tv.vval.v_dict #define vv_tv vv_di.di_tv -static dictitem_T vimvars_var; // variable used for v: +/// Variable used for v: +static ScopeDictDictItem vimvars_var; + +/// v: hashtab #define vimvarht vimvardict.dv_hashtab -typedef enum { - kCallbackNone, - kCallbackFuncref, - kCallbackPartial, -} CallbackType; - -typedef struct { - union { - char_u *funcref; - partial_T *partial; - } data; - CallbackType type; -} Callback; -#define CALLBACK_NONE ((Callback){ .type = kCallbackNone }) - -typedef struct { - union { - LibuvProcess uv; - PtyProcess pty; - } proc; - Stream in, out, err; // Initialized in common_job_start(). - Terminal *term; - bool stopped; - bool exited; - bool rpc; - int refcount; - Callback on_stdout, on_stderr, on_exit; - int *status_ptr; - uint64_t id; - MultiQueue *events; -} TerminalJobData; - -typedef struct dict_watcher { - Callback callback; - char *key_pattern; - QUEUE node; - bool busy; // prevent recursion if the dict is changed in the callback -} DictWatcher; - -typedef struct { - TerminalJobData *data; - Callback *callback; - const char *type; - list_T *received; - int status; -} JobEvent; - typedef struct { TimeWatcher tw; int timer_id; @@ -446,6 +445,7 @@ typedef struct { int refcount; long timeout; bool stopped; + bool paused; Callback callback; } timer_T; @@ -465,6 +465,24 @@ typedef struct fst { KHASH_MAP_INIT_STR(functions, VimLFuncDef) +/// Type of assert_* check being performed +typedef enum +{ + ASSERT_EQUAL, + ASSERT_NOTEQUAL, + ASSERT_MATCH, + ASSERT_NOTMATCH, + ASSERT_INRANGE, + ASSERT_OTHER, +} assert_type_T; + +/// Type for dict_list function +typedef enum { + kDictListKeys, ///< List dictionary keys. + kDictListValues, ///< List dictionary values. + kDictListItems, ///< List dictionary contents: [keys, values]. +} DictListType; + #ifdef INCLUDE_GENERATED_DECLARATIONS # include "eval.c.generated.h" #endif @@ -472,7 +490,6 @@ KHASH_MAP_INIT_STR(functions, VimLFuncDef) #define FNE_INCL_BR 1 /* find_name_end(): include [] in name */ #define FNE_CHECK_START 2 /* find_name_end(): check name starts with valid character */ -static PMap(uint64_t) *jobs = NULL; static uint64_t last_timer_id = 0; static PMap(uint64_t) *timers = NULL; @@ -515,7 +532,6 @@ void eval_init(void) { vimvars[VV_VERSION].vv_nr = VIM_VERSION_100; - jobs = pmap_new(uint64_t)(); timers = pmap_new(uint64_t)(); struct vimvar *p; @@ -545,19 +561,19 @@ void eval_init(void) } vimvars[VV_VERSION].vv_nr = VIM_VERSION_100; - dict_T *const msgpack_types_dict = dict_alloc(); + dict_T *const msgpack_types_dict = tv_dict_alloc(); for (size_t i = 0; i < ARRAY_SIZE(msgpack_type_names); i++) { - list_T *const type_list = list_alloc(); + list_T *const type_list = tv_list_alloc(); type_list->lv_lock = VAR_FIXED; type_list->lv_refcount = 1; - dictitem_T *const di = dictitem_alloc((char_u *)msgpack_type_names[i]); + dictitem_T *const di = tv_dict_item_alloc(msgpack_type_names[i]); di->di_flags |= DI_FLAGS_RO|DI_FLAGS_FIX; di->di_tv = (typval_T) { .v_type = VAR_LIST, .vval = { .v_list = type_list, }, }; eval_msgpack_type_lists[i] = type_list; - if (dict_add(msgpack_types_dict, di) == FAIL) { + if (tv_dict_add(msgpack_types_dict, di) == FAIL) { // There must not be duplicate items in this dictionary by definition. assert(false); } @@ -565,12 +581,13 @@ void eval_init(void) msgpack_types_dict->dv_lock = VAR_FIXED; set_vim_var_dict(VV_MSGPACK_TYPES, msgpack_types_dict); - set_vim_var_dict(VV_COMPLETED_ITEM, dict_alloc()); + set_vim_var_dict(VV_COMPLETED_ITEM, tv_dict_alloc()); - dict_T *v_event = dict_alloc(); + dict_T *v_event = tv_dict_alloc(); v_event->dv_lock = VAR_FIXED; set_vim_var_dict(VV_EVENT, v_event); - set_vim_var_list(VV_ERRORS, list_alloc()); + set_vim_var_list(VV_ERRORS, tv_list_alloc()); + set_vim_var_nr(VV_STDERR, CHAN_STDERR); set_vim_var_nr(VV_SEARCHFORWARD, 1L); set_vim_var_nr(VV_HLSEARCH, 1L); set_vim_var_nr(VV_COUNT1, 1); @@ -601,7 +618,7 @@ void eval_clear(void) xfree(p->vv_str); p->vv_str = NULL; } else if (p->vv_di.di_tv.v_type == VAR_LIST) { - list_unref(p->vv_list); + tv_list_unref(p->vv_list); p->vv_list = NULL; } } @@ -689,18 +706,17 @@ int current_func_returned(void) */ void set_internal_string_var(char_u *name, char_u *value) { - char_u *val = vim_strsave(value); - typval_T *tvp = xcalloc(1, sizeof(typval_T)); + const typval_T tv = { + .v_type = VAR_STRING, + .vval.v_string = value, + }; - tvp->v_type = VAR_STRING; - tvp->vval.v_string = val; - set_var(name, tvp, FALSE); - free_tv(tvp); + set_var((const char *)name, STRLEN(name), (typval_T *)&tv, true); } static lval_T *redir_lval = NULL; -static garray_T redir_ga; /* only valid when redir_lval is not NULL */ -static char_u *redir_endp = NULL; +static garray_T redir_ga; // Only valid when redir_lval is not NULL. +static char_u *redir_endp = NULL; static char_u *redir_varname = NULL; /* @@ -731,11 +747,11 @@ var_redir_start ( /* The output is stored in growarray "redir_ga" until redirection ends. */ ga_init(&redir_ga, (int)sizeof(char), 500); - /* Parse the variable name (can be a dict or list entry). */ - redir_endp = get_lval(redir_varname, NULL, redir_lval, FALSE, FALSE, 0, - FNE_CHECK_START); - if (redir_endp == NULL || redir_lval->ll_name == NULL || *redir_endp != - NUL) { + // Parse the variable name (can be a dict or list entry). + redir_endp = (char_u *)get_lval(redir_varname, NULL, redir_lval, false, false, + 0, FNE_CHECK_START); + if (redir_endp == NULL || redir_lval->ll_name == NULL + || *redir_endp != NUL) { clear_lval(redir_lval); if (redir_endp != NULL && *redir_endp != NUL) /* Trailing characters are present after the variable name */ @@ -809,12 +825,13 @@ void var_redir_stop(void) ga_append(&redir_ga, NUL); /* Append the trailing NUL. */ tv.v_type = VAR_STRING; tv.vval.v_string = redir_ga.ga_data; - /* Call get_lval() again, if it's inside a Dict or List it may - * have changed. */ - redir_endp = get_lval(redir_varname, NULL, redir_lval, - FALSE, FALSE, 0, FNE_CHECK_START); - if (redir_endp != NULL && redir_lval->ll_name != NULL) - set_var_lval(redir_lval, redir_endp, &tv, FALSE, (char_u *)"."); + // Call get_lval() again, if it's inside a Dict or List it may + // have changed. + redir_endp = (char_u *)get_lval(redir_varname, NULL, redir_lval, + false, false, 0, FNE_CHECK_START); + if (redir_endp != NULL && redir_lval->ll_name != NULL) { + set_var_lval(redir_lval, redir_endp, &tv, false, (char_u *)"."); + } clear_lval(redir_lval); } @@ -832,7 +849,7 @@ void var_redir_stop(void) int eval_charconvert(const char *const enc_from, const char *const enc_to, const char *const fname_from, const char *const fname_to) { - int err = false; + bool err = false; set_vim_var_string(VV_CC_FROM, enc_from, -1); set_vim_var_string(VV_CC_TO, enc_to, -1); @@ -854,7 +871,7 @@ int eval_charconvert(const char *const enc_from, const char *const enc_to, int eval_printexpr(const char *const fname, const char *const args) { - int err = false; + bool err = false; set_vim_var_string(VV_FNAME_IN, fname, -1); set_vim_var_string(VV_CMDARG, args, -1); @@ -874,7 +891,7 @@ int eval_printexpr(const char *const fname, const char *const args) void eval_diff(const char *const origfile, const char *const newfile, const char *const outfile) { - int err = FALSE; + bool err = false; set_vim_var_string(VV_FNAME_IN, origfile, -1); set_vim_var_string(VV_FNAME_NEW, newfile, -1); @@ -888,7 +905,7 @@ void eval_diff(const char *const origfile, const char *const newfile, void eval_patch(const char *const origfile, const char *const difffile, const char *const outfile) { - int err; + bool err = false; set_vim_var_string(VV_FNAME_IN, origfile, -1); set_vim_var_string(VV_FNAME_DIFF, difffile, -1); @@ -907,56 +924,61 @@ void eval_patch(const char *const origfile, const char *const difffile, int eval_to_bool ( char_u *arg, - int *error, + bool *error, char_u **nextcmd, int skip /* only parse, don't execute */ ) { typval_T tv; - int retval = FALSE; + bool retval = false; - if (skip) - ++emsg_skip; - if (eval0(arg, &tv, nextcmd, !skip) == FAIL) - *error = TRUE; - else { - *error = FALSE; + if (skip) { + emsg_skip++; + } + if (eval0(arg, &tv, nextcmd, !skip) == FAIL) { + *error = true; + } else { + *error = false; if (!skip) { - retval = (get_tv_number_chk(&tv, error) != 0); - clear_tv(&tv); + retval = (tv_get_number_chk(&tv, error) != 0); + tv_clear(&tv); } } - if (skip) - --emsg_skip; + if (skip) { + emsg_skip--; + } return retval; } -/* - * Top level evaluation function, returning a string. If "skip" is TRUE, - * only parsing to "nextcmd" is done, without reporting errors. Return - * pointer to allocated memory, or NULL for failure or when "skip" is TRUE. - */ -char_u * -eval_to_string_skip ( - char_u *arg, - char_u **nextcmd, - int skip /* only parse, don't execute */ -) +/// Top level evaluation function, returning a string +/// +/// @param[in] arg String to evaluate. +/// @param nextcmd Pointer to the start of the next Ex command. +/// @param[in] skip If true, only do parsing to nextcmd without reporting +/// errors or actually evaluating anything. +/// +/// @return [allocated] string result of evaluation or NULL in case of error or +/// when skipping. +char *eval_to_string_skip(const char *arg, const char **nextcmd, + const bool skip) + FUNC_ATTR_MALLOC FUNC_ATTR_NONNULL_ARG(1) FUNC_ATTR_WARN_UNUSED_RESULT { typval_T tv; - char_u *retval; + char *retval; - if (skip) - ++emsg_skip; - if (eval0(arg, &tv, nextcmd, !skip) == FAIL || skip) - retval = NULL; - else { - retval = vim_strsave(get_tv_string(&tv)); - clear_tv(&tv); + if (skip) { + emsg_skip++; + } + if (eval0((char_u *)arg, &tv, (char_u **)nextcmd, !skip) == FAIL || skip) { + retval = NULL; + } else { + retval = xstrdup(tv_get_string(&tv)); + tv_clear(&tv); + } + if (skip) { + emsg_skip--; } - if (skip) - --emsg_skip; return retval; } @@ -982,31 +1004,33 @@ int skip_expr(char_u **pp) char_u *eval_to_string(char_u *arg, char_u **nextcmd, int convert) { typval_T tv; - char_u *retval; + char *retval; garray_T ga; - char_u numbuf[NUMBUFLEN]; - if (eval0(arg, &tv, nextcmd, TRUE) == FAIL) + if (eval0(arg, &tv, nextcmd, true) == FAIL) { retval = NULL; - else { + } else { if (convert && tv.v_type == VAR_LIST) { ga_init(&ga, (int)sizeof(char), 80); if (tv.vval.v_list != NULL) { - list_join(&ga, tv.vval.v_list, "\n"); - if (tv.vval.v_list->lv_len > 0) + tv_list_join(&ga, tv.vval.v_list, "\n"); + if (tv.vval.v_list->lv_len > 0) { ga_append(&ga, NL); + } } ga_append(&ga, NUL); - retval = (char_u *)ga.ga_data; + retval = (char *)ga.ga_data; } else if (convert && tv.v_type == VAR_FLOAT) { - vim_snprintf((char *)numbuf, NUMBUFLEN, "%g", tv.vval.v_float); - retval = vim_strsave(numbuf); - } else - retval = vim_strsave(get_tv_string(&tv)); - clear_tv(&tv); + char numbuf[NUMBUFLEN]; + vim_snprintf(numbuf, NUMBUFLEN, "%g", tv.vval.v_float); + retval = xstrdup(numbuf); + } else { + retval = xstrdup(tv_get_string(&tv)); + } + tv_clear(&tv); } - return retval; + return (char_u *)retval; } /* @@ -1035,19 +1059,19 @@ char_u *eval_to_string_safe(char_u *arg, char_u **nextcmd, int use_sandbox) * Evaluates "expr" silently. * Returns -1 for an error. */ -int eval_to_number(char_u *expr) +varnumber_T eval_to_number(char_u *expr) { typval_T rettv; - int retval; + varnumber_T retval; char_u *p = skipwhite(expr); ++emsg_off; - if (eval1(&p, &rettv, TRUE) == FAIL) + if (eval1(&p, &rettv, true) == FAIL) { retval = -1; - else { - retval = get_tv_number_chk(&rettv, NULL); - clear_tv(&rettv); + } else { + retval = tv_get_number_chk(&rettv, NULL); + tv_clear(&rettv); } --emsg_off; @@ -1104,11 +1128,12 @@ list_T *eval_spell_expr(char_u *badword, char_u *expr) if (p_verbose == 0) ++emsg_off; - if (eval1(&p, &rettv, TRUE) == OK) { - if (rettv.v_type != VAR_LIST) - clear_tv(&rettv); - else + if (eval1(&p, &rettv, true) == OK) { + if (rettv.v_type != VAR_LIST) { + tv_clear(&rettv); + } else { list = rettv.vval.v_list; + } } if (p_verbose == 0) @@ -1124,54 +1149,39 @@ list_T *eval_spell_expr(char_u *badword, char_u *expr) * Return -1 if anything isn't right. * Used to get the good word and score from the eval_spell_expr() result. */ -int get_spellword(list_T *list, char_u **pp) +int get_spellword(list_T *list, const char **pp) { listitem_T *li; li = list->lv_first; - if (li == NULL) + if (li == NULL) { return -1; - *pp = get_tv_string(&li->li_tv); + } + *pp = tv_get_string(&li->li_tv); li = li->li_next; - if (li == NULL) + if (li == NULL) { return -1; - return get_tv_number(&li->li_tv); -} - -/* - * Top level evaluation function. - * Returns an allocated typval_T with the result. - * Returns NULL when there is an error. - */ -typval_T *eval_expr(char_u *arg, char_u **nextcmd) -{ - typval_T *tv = xmalloc(sizeof(typval_T)); - - if (eval0(arg, tv, nextcmd, TRUE) == FAIL) { - xfree(tv); - return NULL; } - - return tv; + return tv_get_number(&li->li_tv); } -// Call some vimL function and return the result in "*rettv". +// Call some vim script function and return the result in "*rettv". // Uses argv[argc] for the function arguments. Only Number and String // arguments are currently supported. // // Return OK or FAIL. int call_vim_function( - char_u *func, + const char_u *func, int argc, - char_u **argv, + const char_u *const *const argv, int safe, // use the sandbox int str_arg_only, // all arguments are strings typval_T *rettv ) { - long n; + varnumber_T n; int len; int doesrange; void *save_funccalp = NULL; @@ -1198,7 +1208,7 @@ int call_vim_function( argvars[i].vval.v_number = n; } else { argvars[i].v_type = VAR_STRING; - argvars[i].vval.v_string = argv[i]; + argvars[i].vval.v_string = (char_u *)argv[i]; } } @@ -1207,7 +1217,7 @@ int call_vim_function( ++sandbox; } - rettv->v_type = VAR_UNKNOWN; // clear_tv() uses this + rettv->v_type = VAR_UNKNOWN; // tv_clear() uses this. ret = call_func(func, (int)STRLEN(func), rettv, argc, argvars, NULL, curwin->w_cursor.lnum, curwin->w_cursor.lnum, &doesrange, true, NULL, NULL); @@ -1218,74 +1228,72 @@ int call_vim_function( xfree(argvars); if (ret == FAIL) { - clear_tv(rettv); + tv_clear(rettv); } return ret; } -/* - * Call vimL function "func" and return the result as a number. - * Returns -1 when calling the function fails. - * Uses argv[argc] for the function arguments. - */ -long -call_func_retnr ( - char_u *func, - int argc, - char_u **argv, - int safe /* use the sandbox */ -) +/// Call Vim script function and return the result as a number +/// +/// @param[in] func Function name. +/// @param[in] argc Number of arguments. +/// @param[in] argv Array with string arguments. +/// @param[in] safe Use with sandbox. +/// +/// @return -1 when calling function fails, result of function otherwise. +varnumber_T call_func_retnr(char_u *func, int argc, + const char_u *const *const argv, int safe) { typval_T rettv; - long retval; + varnumber_T retval; /* All arguments are passed as strings, no conversion to number. */ if (call_vim_function(func, argc, argv, safe, TRUE, &rettv) == FAIL) return -1; - retval = get_tv_number_chk(&rettv, NULL); - clear_tv(&rettv); + retval = tv_get_number_chk(&rettv, NULL); + tv_clear(&rettv); return retval; } -/* - * Call vimL function "func" and return the result as a string. - * Returns NULL when calling the function fails. - * Uses argv[argc] for the function arguments. - */ -void * -call_func_retstr ( - char_u *func, - int argc, - char_u **argv, - int safe /* use the sandbox */ -) +/// Call Vim script function and return the result as a string +/// +/// @param[in] func Function name. +/// @param[in] argc Number of arguments. +/// @param[in] argv Array with string arguments. +/// @param[in] safe Use the sandbox. +/// +/// @return [allocated] NULL when calling function fails, allocated string +/// otherwise. +char *call_func_retstr(const char *const func, const int argc, + const char_u *const *const argv, + const bool safe) + FUNC_ATTR_NONNULL_ALL FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_MALLOC { typval_T rettv; - char_u *retval; - - /* All arguments are passed as strings, no conversion to number. */ - if (call_vim_function(func, argc, argv, safe, TRUE, &rettv) == FAIL) + // All arguments are passed as strings, no conversion to number. + if (call_vim_function((const char_u *)func, argc, argv, safe, true, &rettv) + == FAIL) { return NULL; + } - retval = vim_strsave(get_tv_string(&rettv)); - clear_tv(&rettv); + char *const retval = xstrdup(tv_get_string(&rettv)); + tv_clear(&rettv); return retval; } -/* - * Call vimL function "func" and return the result as a List. - * Uses argv[argc] for the function arguments. - * Returns NULL when there is something wrong. - */ -void * -call_func_retlist ( - char_u *func, - int argc, - char_u **argv, - int safe /* use the sandbox */ -) +/// Call Vim script function and return the result as a List +/// +/// @param[in] func Function name. +/// @param[in] argc Number of arguments. +/// @param[in] argv Array with string arguments. +/// @param[in] safe Use the sandbox. +/// +/// @return [allocated] NULL when calling function fails or return tv is not a +/// List, allocated List otherwise. +void *call_func_retlist(char_u *func, int argc, const char_u *const *const argv, + int safe) { typval_T rettv; @@ -1294,7 +1302,7 @@ call_func_retlist ( return NULL; if (rettv.v_type != VAR_LIST) { - clear_tv(&rettv); + tv_clear(&rettv); return NULL; } @@ -1366,7 +1374,7 @@ void prof_child_exit(proftime_T *tm /* where waittime was stored */ int eval_foldexpr(char_u *arg, int *cp) { typval_T tv; - int retval; + varnumber_T retval; char_u *s; int use_sandbox = was_set_insecurely((char_u *)"foldexpr", OPT_LOCAL); @@ -1392,14 +1400,14 @@ int eval_foldexpr(char_u *arg, int *cp) *cp = *s++; retval = atol((char *)s); } - clear_tv(&tv); + tv_clear(&tv); } --emsg_off; if (use_sandbox) --sandbox; --textlock; - return retval; + return (int)retval; } /* @@ -1423,11 +1431,13 @@ void ex_let(exarg_T *eap) char_u *argend; int first = TRUE; - argend = skip_var_list(arg, &var_count, &semicolon); - if (argend == NULL) + argend = (char_u *)skip_var_list(arg, &var_count, &semicolon); + if (argend == NULL) { return; - if (argend > arg && argend[-1] == '.') /* for var.='str' */ - --argend; + } + if (argend > arg && argend[-1] == '.') { // For var.='str'. + argend--; + } expr = skipwhite(argend); if (*expr != '=' && !(vim_strchr((char_u *)"+-.", *expr) != NULL && expr[1] == '=')) { @@ -1464,13 +1474,13 @@ void ex_let(exarg_T *eap) ++emsg_skip; i = eval0(expr, &rettv, &eap->nextcmd, !eap->skip); if (eap->skip) { - if (i != FAIL) - clear_tv(&rettv); - --emsg_skip; + if (i != FAIL) { + tv_clear(&rettv); + } + emsg_skip--; } else if (i != FAIL) { - (void)ex_let_vars(eap->arg, &rettv, FALSE, semicolon, var_count, - op); - clear_tv(&rettv); + (void)ex_let_vars(eap->arg, &rettv, false, semicolon, var_count, op); + tv_clear(&rettv); } } } @@ -1493,7 +1503,7 @@ ex_let_vars ( char_u *nextchars ) { - char_u *arg = arg_start; + char_u *arg = arg_start; list_T *l; int i; listitem_T *item; @@ -1516,7 +1526,7 @@ ex_let_vars ( return FAIL; } - i = list_len(l); + i = tv_list_len(l); if (semicolon == 0 && var_count < i) { EMSG(_("E687: Less targets than List items")); return FAIL; @@ -1538,9 +1548,9 @@ ex_let_vars ( if (*arg == ';') { /* Put the rest of the list (may be empty) in the var after ';'. * Create a new list for this. */ - l = list_alloc(); + l = tv_list_alloc(); while (item != NULL) { - list_append_tv(l, &item->li_tv); + tv_list_append_tv(l, &item->li_tv); item = item->li_next; } @@ -1549,11 +1559,12 @@ ex_let_vars ( ltv.vval.v_list = l; l->lv_refcount = 1; - arg = ex_let_one(skipwhite(arg + 1), <v, FALSE, - (char_u *)"]", nextchars); - clear_tv(<v); - if (arg == NULL) + arg = ex_let_one(skipwhite(arg + 1), <v, false, + (char_u *)"]", nextchars); + tv_clear(<v); + if (arg == NULL) { return FAIL; + } break; } else if (*arg != ',' && *arg != ']') { EMSG2(_(e_intern2), "ex_let_vars()"); @@ -1571,9 +1582,11 @@ ex_let_vars ( * for "[var, var; var]" set "semicolon". * Return NULL for an error. */ -static char_u *skip_var_list(char_u *arg, int *var_count, int *semicolon) +static const char_u *skip_var_list(const char_u *arg, int *var_count, + int *semicolon) { - char_u *p, *s; + const char_u *p; + const char_u *s; if (*arg == '[') { /* "[var, var]": find the matching ']'. */ @@ -1610,7 +1623,7 @@ static char_u *skip_var_list(char_u *arg, int *var_count, int *semicolon) * Skip one (assignable) variable name, including @r, $VAR, &option, d.key, * l[idx]. */ -static char_u *skip_var_one(char_u *arg) +static const char_u *skip_var_one(const char_u *arg) { if (*arg == '@' && arg[1] != NUL) return arg + 2; @@ -1633,7 +1646,7 @@ static void list_hashtable_vars(hashtab_T *ht, const char *prefix, int empty, for (hi = ht->ht_array; todo > 0 && !got_int; ++hi) { if (!HASHITEM_EMPTY(hi)) { todo--; - di = HI2DI(hi); + di = TV_DICT_HI2DI(hi); if (empty || di->di_tv.v_type != VAR_STRING || di->di_tv.vval.v_string != NULL) { list_one_var(di, prefix, first); @@ -1774,7 +1787,7 @@ static const char *list_arg_vars(exarg_T *eap, const char *arg, int *first) tv.v_type, s == NULL ? "" : s, first); xfree(s); } - clear_tv(&tv); + tv_clear(&tv); } } } @@ -1788,34 +1801,37 @@ static const char *list_arg_vars(exarg_T *eap, const char *arg, int *first) return arg; } -/* - * Set one item of ":let var = expr" or ":let [v1, v2] = list" to its value. - * Returns a pointer to the char just after the var name. - * Returns NULL if there is an error. - */ -static char_u * -ex_let_one ( - char_u *arg, /* points to variable name */ - typval_T *tv, /* value to assign to variable */ - int copy, /* copy value from "tv" */ - char_u *endchars, /* valid chars after variable name or NULL */ - char_u *op /* "+", "-", "." or NULL*/ -) +// TODO(ZyX-I): move to eval/ex_cmds + +/// Set one item of `:let var = expr` or `:let [v1, v2] = list` to its value +/// +/// @param[in] arg Start of the variable name. +/// @param[in] tv Value to assign to the variable. +/// @param[in] copy If true, copy value from `tv`. +/// @param[in] endchars Valid characters after variable name or NULL. +/// @param[in] op Operation performed: *op is `+`, `-`, `.` for `+=`, etc. +/// NULL for `=`. +/// +/// @return a pointer to the char just after the var name or NULL in case of +/// error. +static char_u *ex_let_one(char_u *arg, typval_T *const tv, + const bool copy, const char_u *const endchars, + const char_u *const op) + FUNC_ATTR_NONNULL_ARG(1, 2) FUNC_ATTR_WARN_UNUSED_RESULT { - char_u *name; - char_u *arg_end = NULL; + char_u *arg_end = NULL; int len; int opt_flags; - char_u *tofree = NULL; + char_u *tofree = NULL; /* * ":let $VAR = expr": Set environment variable. */ if (*arg == '$') { - /* Find the end of the name. */ - ++arg; - name = arg; - len = get_env_len(&arg); + // Find the end of the name. + arg++; + char *name = (char *)arg; + len = get_env_len((const char_u **)&arg); if (len == 0) { EMSG2(_(e_invarg2), name - 1); } else { @@ -1825,26 +1841,28 @@ ex_let_one ( && vim_strchr(endchars, *skipwhite(arg)) == NULL) { EMSG(_(e_letunexp)); } else if (!check_secure()) { - const char_u c1 = name[len]; + const char c1 = name[len]; name[len] = NUL; - char_u *p = get_tv_string_chk(tv); + const char *p = tv_get_string_chk(tv); if (p != NULL && op != NULL && *op == '.') { - char *s = vim_getenv((char *)name); + char *s = vim_getenv(name); if (s != NULL) { - p = tofree = concat_str((char_u *)s, p); + tofree = concat_str((const char_u *)s, (const char_u *)p); + p = (const char *)tofree; xfree(s); } } if (p != NULL) { - vim_setenv((char *)name, (char *)p); - if (STRICMP(name, "HOME") == 0) + vim_setenv(name, p); + if (STRICMP(name, "HOME") == 0) { init_homedir(); - else if (didset_vim && STRICMP(name, "VIM") == 0) - didset_vim = FALSE; - else if (didset_vimruntime - && STRICMP(name, "VIMRUNTIME") == 0) - didset_vimruntime = FALSE; + } else if (didset_vim && STRICMP(name, "VIM") == 0) { + didset_vim = false; + } else if (didset_vimruntime + && STRICMP(name, "VIMRUNTIME") == 0) { + didset_vimruntime = false; + } arg_end = arg; } name[len] = c1; @@ -1862,19 +1880,18 @@ ex_let_one ( && vim_strchr(endchars, *skipwhite((const char_u *)p)) == NULL)) { EMSG(_(e_letunexp)); } else { - long n; int opt_type; long numval; - char_u *stringval = NULL; - char_u *s; + char *stringval = NULL; const char c1 = *p; *p = NUL; - n = get_tv_number(tv); - s = get_tv_string_chk(tv); /* != NULL if number or string */ + varnumber_T n = tv_get_number(tv); + const char *s = tv_get_string_chk(tv); // != NULL if number or string. if (s != NULL && op != NULL && *op != '=') { - opt_type = get_option_value(arg, &numval, &stringval, opt_flags); + opt_type = get_option_value(arg, &numval, (char_u **)&stringval, + opt_flags); if ((opt_type == 1 && *op == '.') || (opt_type == 0 && *op != '.')) { EMSG2(_(e_letwrong), op); @@ -1886,44 +1903,45 @@ ex_let_one ( n = numval - n; } } else if (opt_type == 0 && stringval != NULL) { // string - s = concat_str(stringval, s); - xfree(stringval); - stringval = s; + char *const oldstringval = stringval; + stringval = (char *)concat_str((const char_u *)stringval, + (const char_u *)s); + xfree(oldstringval); + s = stringval; } } } if (s != NULL) { - set_option_value(arg, n, s, opt_flags); + set_option_value((const char *)arg, n, s, opt_flags); arg_end = (char_u *)p; } *p = c1; xfree(stringval); } - } - /* - * ":let @r = expr": Set register contents. - */ - else if (*arg == '@') { - ++arg; - if (op != NULL && (*op == '+' || *op == '-')) - EMSG2(_(e_letwrong), op); - else if (endchars != NULL - && vim_strchr(endchars, *skipwhite(arg + 1)) == NULL) - EMSG(_(e_letunexp)); - else { - char_u *ptofree = NULL; + // ":let @r = expr": Set register contents. + } else if (*arg == '@') { + arg++; + if (op != NULL && (*op == '+' || *op == '-')) { + emsgf(_(e_letwrong), op); + } else if (endchars != NULL + && vim_strchr(endchars, *skipwhite(arg + 1)) == NULL) { + emsgf(_(e_letunexp)); + } else { char_u *s; - char_u *p = get_tv_string_chk(tv); + char_u *ptofree = NULL; + const char *p = tv_get_string_chk(tv); if (p != NULL && op != NULL && *op == '.') { s = get_reg_contents(*arg == '@' ? '"' : *arg, kGRegExprSrc); if (s != NULL) { - p = ptofree = concat_str(s, p); + ptofree = concat_str(s, (const char_u *)p); + p = (const char *)ptofree; xfree(s); } } if (p != NULL) { - write_reg_contents(*arg == '@' ? '"' : *arg, p, STRLEN(p), false); + write_reg_contents(*arg == '@' ? '"' : *arg, + (const char_u *)p, STRLEN(p), false); arg_end = arg + 1; } xfree(ptofree); @@ -1938,9 +1956,9 @@ ex_let_one ( char_u *const p = get_lval(arg, tv, &lv, false, false, 0, FNE_CHECK_START); if (p != NULL && lv.ll_name != NULL) { - if (endchars != NULL && vim_strchr(endchars, *skipwhite(p)) == NULL) + if (endchars != NULL && vim_strchr(endchars, *skipwhite(p)) == NULL) { EMSG(_(e_letunexp)); - else { + } else { set_var_lval(&lv, p, tv, copy, op); arg_end = p; } @@ -1952,6 +1970,8 @@ ex_let_one ( return arg_end; } +// TODO(ZyX-I): move to eval/executor + /// Get an lvalue /// /// Lvalue may be @@ -1980,16 +2000,11 @@ static char_u *get_lval(char_u *const name, typval_T *const rettv, const int flags, const int fne_flags) FUNC_ATTR_NONNULL_ARG(1, 3) { - char_u *p; - char_u *expr_start, *expr_end; - int cc; dictitem_T *v; typval_T var1; typval_T var2; int empty1 = FALSE; listitem_T *ni; - char_u *key = NULL; - int len; hashtab_T *ht; int quiet = flags & GLV_QUIET; @@ -1997,13 +2012,19 @@ static char_u *get_lval(char_u *const name, typval_T *const rettv, memset(lp, 0, sizeof(lval_T)); if (skip) { - /* When skipping just find the end of the name. */ - lp->ll_name = name; - return find_name_end(name, NULL, NULL, FNE_INCL_BR | fne_flags); + // When skipping just find the end of the name. + lp->ll_name = (const char *)name; + return (char_u *)find_name_end((const char_u *)name, NULL, NULL, + FNE_INCL_BR | fne_flags); } - /* Find the end of the name. */ - p = find_name_end(name, &expr_start, &expr_end, fne_flags); + // Find the end of the name. + char_u *expr_start; + char_u *expr_end; + char_u *p = (char_u *)find_name_end(name, + (const char_u **)&expr_start, + (const char_u **)&expr_end, + fne_flags); if (expr_start != NULL) { /* Don't expand the name when we already know there is an error. */ if (unlet && !ascii_iswhite(*p) && !ends_excmd(*p) @@ -2012,7 +2033,9 @@ static char_u *get_lval(char_u *const name, typval_T *const rettv, return NULL; } - lp->ll_exp_name = make_expanded_name(name, expr_start, expr_end, p); + lp->ll_exp_name = (char *)make_expanded_name(name, expr_start, expr_end, + (char_u *)p); + lp->ll_name = lp->ll_exp_name; if (lp->ll_exp_name == NULL) { /* Report an invalid expression in braces, unless the * expression evaluation has been cancelled due to an @@ -2022,25 +2045,28 @@ static char_u *get_lval(char_u *const name, typval_T *const rettv, EMSG2(_(e_invarg2), name); return NULL; } + lp->ll_name_len = 0; + } else { + lp->ll_name_len = strlen(lp->ll_name); } - lp->ll_name = lp->ll_exp_name; - } else - lp->ll_name = name; - - /* Without [idx] or .key we are done. */ - if ((*p != '[' && *p != '.') || lp->ll_name == NULL) - return p; - - cc = *p; - *p = NUL; - v = find_var((const char *)lp->ll_name, STRLEN(lp->ll_name), &ht, - flags & GLV_NO_AUTOLOAD); - if (v == NULL && !quiet) { - EMSG2(_(e_undefvar), lp->ll_name); + } else { + lp->ll_name = (const char *)name; + lp->ll_name_len = (size_t)((const char *)p - lp->ll_name); } - *p = cc; - if (v == NULL) + + // Without [idx] or .key we are done. + if ((*p != '[' && *p != '.') || lp->ll_name == NULL) { + return p; + } + + v = find_var(lp->ll_name, lp->ll_name_len, &ht, flags & GLV_NO_AUTOLOAD); + if (v == NULL && !quiet) { + emsgf(_("E121: Undefined variable: %.*s"), + (int)lp->ll_name_len, lp->ll_name); + } + if (v == NULL) { return NULL; + } /* * Loop until no more [idx] or .key is following. @@ -2060,29 +2086,32 @@ static char_u *get_lval(char_u *const name, typval_T *const rettv, return NULL; } - len = -1; + int len = -1; + char_u *key = NULL; if (*p == '.') { key = p + 1; - for (len = 0; ASCII_ISALNUM(key[len]) || key[len] == '_'; ++len) - ; + for (len = 0; ASCII_ISALNUM(key[len]) || key[len] == '_'; len++) { + } if (len == 0) { - if (!quiet) - EMSG(_(e_emptykey)); + if (!quiet) { + EMSG(_("E713: Cannot use empty key after .")); + } return NULL; } p = key + len; } else { /* Get the index [expr] or the first index [expr: ]. */ p = skipwhite(p + 1); - if (*p == ':') - empty1 = TRUE; - else { - empty1 = FALSE; - if (eval1(&p, &var1, TRUE) == FAIL) /* recursive! */ + if (*p == ':') { + empty1 = true; + } else { + empty1 = false; + if (eval1(&p, &var1, true) == FAIL) { // Recursive! return NULL; - if (get_tv_string_chk(&var1) == NULL) { - /* not a number or string */ - clear_tv(&var1); + } + if (!tv_check_str(&var1)) { + // Not a number or string. + tv_clear(&var1); return NULL; } } @@ -2090,35 +2119,41 @@ static char_u *get_lval(char_u *const name, typval_T *const rettv, /* Optionally get the second index [ :expr]. */ if (*p == ':') { if (lp->ll_tv->v_type == VAR_DICT) { - if (!quiet) + if (!quiet) { EMSG(_(e_dictrange)); - if (!empty1) - clear_tv(&var1); + } + if (!empty1) { + tv_clear(&var1); + } return NULL; } if (rettv != NULL && (rettv->v_type != VAR_LIST || rettv->vval.v_list == NULL)) { - if (!quiet) - EMSG(_("E709: [:] requires a List value")); - if (!empty1) - clear_tv(&var1); + if (!quiet) { + emsgf(_("E709: [:] requires a List value")); + } + if (!empty1) { + tv_clear(&var1); + } return NULL; } p = skipwhite(p + 1); - if (*p == ']') - lp->ll_empty2 = TRUE; - else { - lp->ll_empty2 = FALSE; - if (eval1(&p, &var2, TRUE) == FAIL) { /* recursive! */ - if (!empty1) - clear_tv(&var1); + if (*p == ']') { + lp->ll_empty2 = true; + } else { + lp->ll_empty2 = false; + if (eval1(&p, &var2, true) == FAIL) { // Recursive! + if (!empty1) { + tv_clear(&var1); + } return NULL; } - if (get_tv_string_chk(&var2) == NULL) { - /* not a number or string */ - if (!empty1) - clear_tv(&var1); - clear_tv(&var2); + if (!tv_check_str(&var2)) { + // Not a number or string. + if (!empty1) { + tv_clear(&var1); + } + tv_clear(&var2); return NULL; } } @@ -2127,12 +2162,15 @@ static char_u *get_lval(char_u *const name, typval_T *const rettv, lp->ll_range = FALSE; if (*p != ']') { - if (!quiet) - EMSG(_(e_missbrac)); - if (!empty1) - clear_tv(&var1); - if (lp->ll_range && !lp->ll_empty2) - clear_tv(&var2); + if (!quiet) { + emsgf(_(e_missbrac)); + } + if (!empty1) { + tv_clear(&var1); + } + if (lp->ll_range && !lp->ll_empty2) { + tv_clear(&var2); + } return NULL; } @@ -2143,15 +2181,11 @@ static char_u *get_lval(char_u *const name, typval_T *const rettv, if (lp->ll_tv->v_type == VAR_DICT) { if (len == -1) { // "[key]": get key from "var1" - key = get_tv_string_chk(&var1); // is number or string - if (key == NULL) { - clear_tv(&var1); - return NULL; - } + key = (char_u *)tv_get_string(&var1); // is number or string } lp->ll_list = NULL; lp->ll_dict = lp->ll_tv->vval.v_dict; - lp->ll_di = dict_find(lp->ll_dict, key, len); + lp->ll_di = tv_dict_find(lp->ll_dict, (const char *)key, len); /* When assigning to a scope dictionary check that a function and * variable name is valid (only variable name unless it is l: or @@ -2163,16 +2197,19 @@ static char_u *get_lval(char_u *const name, typval_T *const rettv, if (len != -1) { prevval = key[len]; key[len] = NUL; - } else - prevval = 0; /* avoid compiler warning */ - wrong = (lp->ll_dict->dv_scope == VAR_DEF_SCOPE - && rettv->v_type == VAR_FUNC - && var_check_func_name(key, lp->ll_di == NULL)) - || !valid_varname(key); - if (len != -1) + } else { + prevval = 0; // Avoid compiler warning. + } + wrong = ((lp->ll_dict->dv_scope == VAR_DEF_SCOPE + && tv_is_func(*rettv) + && !var_check_func_name((const char *)key, lp->ll_di == NULL)) + || !valid_varname((const char *)key)); + if (len != -1) { key[len] = prevval; - if (wrong) + } + if (wrong) { return NULL; + } } if (lp->ll_di == NULL) { @@ -2184,56 +2221,61 @@ static char_u *get_lval(char_u *const name, typval_T *const rettv, /* Key does not exist in dict: may need to add it. */ if (*p == '[' || *p == '.' || unlet) { - if (!quiet) - EMSG2(_(e_dictkey), key); - if (len == -1) - clear_tv(&var1); + if (!quiet) { + emsgf(_(e_dictkey), key); + } + if (len == -1) { + tv_clear(&var1); + } return NULL; } - if (len == -1) + if (len == -1) { lp->ll_newkey = vim_strsave(key); - else + } else { lp->ll_newkey = vim_strnsave(key, len); - if (len == -1) - clear_tv(&var1); + } + if (len == -1) { + tv_clear(&var1); + } break; // existing variable, need to check if it can be changed } else if (!(flags & GLV_READ_ONLY) && var_check_ro(lp->ll_di->di_flags, (const char *)name, (size_t)(p - name))) { if (len == -1) { - clear_tv(&var1); + tv_clear(&var1); } return NULL; } - if (len == -1) - clear_tv(&var1); + if (len == -1) { + tv_clear(&var1); + } lp->ll_tv = &lp->ll_di->di_tv; } else { - /* - * Get the number and item for the only or first index of the List. - */ - if (empty1) + // Get the number and item for the only or first index of the List. + if (empty1) { lp->ll_n1 = 0; - else { - lp->ll_n1 = get_tv_number(&var1); /* is number or string */ - clear_tv(&var1); + } else { + lp->ll_n1 = (long)tv_get_number(&var1); // Is number or string. + tv_clear(&var1); } lp->ll_dict = NULL; lp->ll_list = lp->ll_tv->vval.v_list; - lp->ll_li = list_find(lp->ll_list, lp->ll_n1); + lp->ll_li = tv_list_find(lp->ll_list, lp->ll_n1); if (lp->ll_li == NULL) { if (lp->ll_n1 < 0) { lp->ll_n1 = 0; - lp->ll_li = list_find(lp->ll_list, lp->ll_n1); + lp->ll_li = tv_list_find(lp->ll_list, lp->ll_n1); } } if (lp->ll_li == NULL) { - if (lp->ll_range && !lp->ll_empty2) - clear_tv(&var2); - if (!quiet) + if (lp->ll_range && !lp->ll_empty2) { + tv_clear(&var2); + } + if (!quiet) { EMSGN(_(e_listidx), lp->ll_n1); + } return NULL; } @@ -2244,24 +2286,26 @@ static char_u *get_lval(char_u *const name, typval_T *const rettv, * Otherwise "lp->ll_n2" is set to the second index. */ if (lp->ll_range && !lp->ll_empty2) { - lp->ll_n2 = get_tv_number(&var2); /* is number or string */ - clear_tv(&var2); + lp->ll_n2 = (long)tv_get_number(&var2); // Is number or string. + tv_clear(&var2); if (lp->ll_n2 < 0) { - ni = list_find(lp->ll_list, lp->ll_n2); + ni = tv_list_find(lp->ll_list, lp->ll_n2); if (ni == NULL) { if (!quiet) EMSGN(_(e_listidx), lp->ll_n2); return NULL; } - lp->ll_n2 = list_idx_of_item(lp->ll_list, ni); + lp->ll_n2 = tv_list_idx_of_item(lp->ll_list, ni); } - /* Check that lp->ll_n2 isn't before lp->ll_n1. */ - if (lp->ll_n1 < 0) - lp->ll_n1 = list_idx_of_item(lp->ll_list, lp->ll_li); + // Check that lp->ll_n2 isn't before lp->ll_n1. + if (lp->ll_n1 < 0) { + lp->ll_n1 = tv_list_idx_of_item(lp->ll_list, lp->ll_li); + } if (lp->ll_n2 < lp->ll_n1) { - if (!quiet) + if (!quiet) { EMSGN(_(e_listidx), lp->ll_n2); + } return NULL; } } @@ -2273,6 +2317,8 @@ static char_u *get_lval(char_u *const name, typval_T *const rettv, return p; } +// TODO(ZyX-I): move to eval/executor + /* * Clear lval "lp" that was filled by get_lval(). */ @@ -2282,12 +2328,15 @@ static void clear_lval(lval_T *lp) xfree(lp->ll_newkey); } +// TODO(ZyX-I): move to eval/executor + /* * Set a variable that was parsed by get_lval() to "rettv". * "endp" points to just after the parsed name. * "op" is NULL, "+" for "+=", "-" for "-=", "." for ".=" or "=" for "=". */ -static void set_var_lval(lval_T *lp, char_u *endp, typval_T *rettv, int copy, char_u *op) +static void set_var_lval(lval_T *lp, char_u *endp, typval_T *rettv, + int copy, const char_u *op) { int cc; listitem_T *ri; @@ -2305,22 +2354,22 @@ static void set_var_lval(lval_T *lp, char_u *endp, typval_T *rettv, int copy, ch &tv, &di, true, false) == OK) { if ((di == NULL || (!var_check_ro(di->di_flags, (const char *)lp->ll_name, - STRLEN(lp->ll_name)) + TV_CSTRING) && !tv_check_lock(di->di_tv.v_lock, (const char *)lp->ll_name, - STRLEN(lp->ll_name)))) - && tv_op(&tv, rettv, op) == OK) { - set_var(lp->ll_name, &tv, false); + TV_CSTRING))) + && eexe_mod_op(&tv, rettv, (const char *)op) == OK) { + set_var(lp->ll_name, lp->ll_name_len, &tv, false); } - clear_tv(&tv); + tv_clear(&tv); } } else { - set_var(lp->ll_name, rettv, copy); + set_var(lp->ll_name, lp->ll_name_len, rettv, copy); } *endp = cc; } else if (tv_check_lock(lp->ll_newkey == NULL ? lp->ll_tv->v_lock : lp->ll_tv->vval.v_dict->dv_lock, - (const char *)lp->ll_name, STRLEN(lp->ll_name))) { + (const char *)lp->ll_name, TV_CSTRING)) { } else if (lp->ll_range) { listitem_T *ll_li = lp->ll_li; int ll_n1 = lp->ll_n1; @@ -2329,7 +2378,7 @@ static void set_var_lval(lval_T *lp, char_u *endp, typval_T *rettv, int copy, ch for (listitem_T *ri = rettv->vval.v_list->lv_first; ri != NULL && ll_li != NULL; ) { if (tv_check_lock(ll_li->li_tv.v_lock, (const char *)lp->ll_name, - STRLEN(lp->ll_name))) { + TV_CSTRING)) { return; } ri = ri->li_next; @@ -2344,18 +2393,18 @@ static void set_var_lval(lval_T *lp, char_u *endp, typval_T *rettv, int copy, ch * Assign the List values to the list items. */ for (ri = rettv->vval.v_list->lv_first; ri != NULL; ) { - if (op != NULL && *op != '=') - tv_op(&lp->ll_li->li_tv, &ri->li_tv, op); - else { - clear_tv(&lp->ll_li->li_tv); - copy_tv(&ri->li_tv, &lp->ll_li->li_tv); + if (op != NULL && *op != '=') { + eexe_mod_op(&lp->ll_li->li_tv, &ri->li_tv, (const char *)op); + } else { + tv_clear(&lp->ll_li->li_tv); + tv_copy(&ri->li_tv, &lp->ll_li->li_tv); } ri = ri->li_next; if (ri == NULL || (!lp->ll_empty2 && lp->ll_n2 == lp->ll_n1)) break; if (lp->ll_li->li_next == NULL) { - /* Need to add an empty item. */ - list_append_number(lp->ll_list, 0); + // Need to add an empty item. + tv_list_append_number(lp->ll_list, 0); assert(lp->ll_li->li_next); } lp->ll_li = lp->ll_li->li_next; @@ -2368,198 +2417,60 @@ static void set_var_lval(lval_T *lp, char_u *endp, typval_T *rettv, int copy, ch : lp->ll_n1 != lp->ll_n2) EMSG(_("E711: List value has not enough items")); } else { - typval_T oldtv; + typval_T oldtv = TV_INITIAL_VALUE; dict_T *dict = lp->ll_dict; - bool watched = is_watched(dict); + bool watched = tv_dict_is_watched(dict); - if (watched) { - init_tv(&oldtv); - } - - /* - * Assign to a List or Dictionary item. - */ + // Assign to a List or Dictionary item. if (lp->ll_newkey != NULL) { if (op != NULL && *op != '=') { EMSG2(_(e_letwrong), op); return; } - /* Need to add an item to the Dictionary. */ - di = dictitem_alloc(lp->ll_newkey); - if (dict_add(lp->ll_tv->vval.v_dict, di) == FAIL) { + // Need to add an item to the Dictionary. + di = tv_dict_item_alloc((const char *)lp->ll_newkey); + if (tv_dict_add(lp->ll_tv->vval.v_dict, di) == FAIL) { xfree(di); return; } lp->ll_tv = &di->di_tv; } else { if (watched) { - copy_tv(lp->ll_tv, &oldtv); + tv_copy(lp->ll_tv, &oldtv); } if (op != NULL && *op != '=') { - tv_op(lp->ll_tv, rettv, op); + eexe_mod_op(lp->ll_tv, rettv, (const char *)op); goto notify; } else { - clear_tv(lp->ll_tv); + tv_clear(lp->ll_tv); } } // Assign the value to the variable or list item. if (copy) { - copy_tv(rettv, lp->ll_tv); + tv_copy(rettv, lp->ll_tv); } else { *lp->ll_tv = *rettv; lp->ll_tv->v_lock = 0; - init_tv(rettv); + tv_init(rettv); } notify: if (watched) { if (oldtv.v_type == VAR_UNKNOWN) { - dictwatcher_notify(dict, (char *)lp->ll_newkey, lp->ll_tv, NULL); + tv_dict_watcher_notify(dict, (char *)lp->ll_newkey, lp->ll_tv, NULL); } else { dictitem_T *di = lp->ll_di; - dictwatcher_notify(dict, (char *)di->di_key, lp->ll_tv, &oldtv); - clear_tv(&oldtv); + tv_dict_watcher_notify(dict, (char *)di->di_key, lp->ll_tv, &oldtv); + tv_clear(&oldtv); } } } } -/* - * Handle "tv1 += tv2", "tv1 -= tv2" and "tv1 .= tv2" - * Returns OK or FAIL. - */ -static int tv_op(typval_T *tv1, typval_T *tv2, char_u *op) -{ - long n; - char_u numbuf[NUMBUFLEN]; - char_u *s; - - // Can't do anything with a Funcref, a Dict or special value on the right. - if (tv2->v_type != VAR_FUNC && tv2->v_type != VAR_DICT) { - switch (tv1->v_type) { - case VAR_DICT: - case VAR_FUNC: - case VAR_PARTIAL: - case VAR_SPECIAL: - break; - - case VAR_LIST: - if (*op != '+' || tv2->v_type != VAR_LIST) - break; - /* List += List */ - if (tv1->vval.v_list != NULL && tv2->vval.v_list != NULL) - list_extend(tv1->vval.v_list, tv2->vval.v_list, NULL); - return OK; - - case VAR_NUMBER: - case VAR_STRING: - if (tv2->v_type == VAR_LIST) - break; - if (*op == '+' || *op == '-') { - /* nr += nr or nr -= nr*/ - n = get_tv_number(tv1); - if (tv2->v_type == VAR_FLOAT) { - float_T f = n; - - if (*op == '+') - f += tv2->vval.v_float; - else - f -= tv2->vval.v_float; - clear_tv(tv1); - tv1->v_type = VAR_FLOAT; - tv1->vval.v_float = f; - } else { - if (*op == '+') - n += get_tv_number(tv2); - else - n -= get_tv_number(tv2); - clear_tv(tv1); - tv1->v_type = VAR_NUMBER; - tv1->vval.v_number = n; - } - } else { - if (tv2->v_type == VAR_FLOAT) - break; - - /* str .= str */ - s = get_tv_string(tv1); - s = concat_str(s, get_tv_string_buf(tv2, numbuf)); - clear_tv(tv1); - tv1->v_type = VAR_STRING; - tv1->vval.v_string = s; - } - return OK; - - case VAR_FLOAT: - { - float_T f; - - if (*op == '.' || (tv2->v_type != VAR_FLOAT - && tv2->v_type != VAR_NUMBER - && tv2->v_type != VAR_STRING)) - break; - if (tv2->v_type == VAR_FLOAT) - f = tv2->vval.v_float; - else - f = get_tv_number(tv2); - if (*op == '+') - tv1->vval.v_float += f; - else - tv1->vval.v_float -= f; - } - return OK; - - case VAR_UNKNOWN: - assert(false); - } - } - - EMSG2(_(e_letwrong), op); - return FAIL; -} - -/* - * Add a watcher to a list. - */ -void list_add_watch(list_T *l, listwatch_T *lw) -{ - lw->lw_next = l->lv_watch; - l->lv_watch = lw; -} - -/* - * Remove a watcher from a list. - * No warning when it isn't found... - */ -void list_rem_watch(list_T *l, listwatch_T *lwrem) -{ - listwatch_T *lw, **lwp; - - lwp = &l->lv_watch; - for (lw = l->lv_watch; lw != NULL; lw = lw->lw_next) { - if (lw == lwrem) { - *lwp = lw->lw_next; - break; - } - lwp = &lw->lw_next; - } -} - -/* - * Just before removing an item from a list: advance watchers to the next - * item. - */ -static void list_fix_watch(list_T *l, listitem_T *item) -{ - listwatch_T *lw; - - for (lw = l->lv_watch; lw != NULL; lw = lw->lw_next) - if (lw->lw_item == item) - lw->lw_item = item->li_next; -} +// TODO(ZyX-I): move to eval/ex_cmds /* * Evaluate the expression used in a ":for var in expr" command. @@ -2567,14 +2478,14 @@ static void list_fix_watch(list_T *l, listitem_T *item) * Set "*errp" to TRUE for an error, FALSE otherwise; * Return a pointer that holds the info. Null when there is an error. */ -void *eval_for_line(char_u *arg, int *errp, char_u **nextcmdp, int skip) +void *eval_for_line(const char_u *arg, bool *errp, char_u **nextcmdp, int skip) { forinfo_T *fi = xcalloc(1, sizeof(forinfo_T)); - char_u *expr; + const char_u *expr; typval_T tv; list_T *l; - *errp = TRUE; /* default: there is an error */ + *errp = true; // Default: there is an error. expr = skip_var_list(arg, &fi->fi_varcount, &fi->fi_semicolon); if (expr == NULL) @@ -2589,20 +2500,20 @@ void *eval_for_line(char_u *arg, int *errp, char_u **nextcmdp, int skip) if (skip) ++emsg_skip; if (eval0(skipwhite(expr + 2), &tv, nextcmdp, !skip) == OK) { - *errp = FALSE; + *errp = false; if (!skip) { l = tv.vval.v_list; if (tv.v_type != VAR_LIST) { EMSG(_(e_listreq)); - clear_tv(&tv); + tv_clear(&tv); } else if (l == NULL) { // a null list is like an empty list: do nothing - clear_tv(&tv); + tv_clear(&tv); } else { /* No need to increment the refcount, it's already set for the * list being used in "tv". */ fi->fi_list = l; - list_add_watch(l, &fi->fi_lw); + tv_list_watch_add(l, &fi->fi_lw); fi->fi_lw.lw_item = l->lv_first; } } @@ -2613,6 +2524,8 @@ void *eval_for_line(char_u *arg, int *errp, char_u **nextcmdp, int skip) return fi; } +// TODO(ZyX-I): move to eval/ex_cmds + /* * Use the first item in a ":for" list. Advance to the next. * Assign the values to the variable (list). "arg" points to the first one. @@ -2636,6 +2549,8 @@ int next_for_item(void *fi_void, char_u *arg) return result; } +// TODO(ZyX-I): move to eval/ex_cmds + /* * Free the structure used to store info used by ":for". */ @@ -2644,8 +2559,8 @@ void free_for_info(void *fi_void) forinfo_T *fi = (forinfo_T *)fi_void; if (fi != NULL && fi->fi_list != NULL) { - list_rem_watch(fi->fi_list, &fi->fi_lw); - list_unref(fi->fi_list); + tv_list_watch_remove(fi->fi_list, &fi->fi_lw); + tv_list_unref(fi->fi_list); } xfree(fi); } @@ -2733,6 +2648,7 @@ void set_context_for_expression(expand_T *xp, char_u *arg, cmdidx_T cmdidx) xp->xp_pattern = arg; } +// TODO(ZyX-I): move to eval/ex_cmds /* * ":1,25call func(arg1, arg2)" function call. @@ -2752,13 +2668,14 @@ void ex_call(exarg_T *eap) partial_T *partial = NULL; if (eap->skip) { - /* trans_function_name() doesn't work well when skipping, use eval0() - * instead to skip to any following command, e.g. for: - * :if 0 | call dict.foo().bar() | endif */ - ++emsg_skip; - if (eval0(eap->arg, &rettv, &eap->nextcmd, FALSE) != FAIL) - clear_tv(&rettv); - --emsg_skip; + // trans_function_name() doesn't work well when skipping, use eval0() + // instead to skip to any following command, e.g. for: + // :if 0 | call dict.foo().bar() | endif. + emsg_skip++; + if (eval0(eap->arg, &rettv, &eap->nextcmd, false) != FAIL) { + tv_clear(&rettv); + } + emsg_skip--; return; } @@ -2786,7 +2703,7 @@ void ex_call(exarg_T *eap) /* Skip white space to allow ":call func ()". Not good, but required for * backward compatibility. */ startarg = skipwhite(arg); - rettv.v_type = VAR_UNKNOWN; /* clear_tv() uses this */ + rettv.v_type = VAR_UNKNOWN; // tv_clear() uses this. if (*startarg != '(') { EMSG2(_("E107: Missing parentheses: %s"), eap->arg); @@ -2800,12 +2717,13 @@ void ex_call(exarg_T *eap) * call, and the loop is broken. */ if (eap->skip) { - ++emsg_skip; - lnum = eap->line2; /* do it once, also with an invalid range */ - } else + emsg_skip++; + lnum = eap->line2; // Do it once, also with an invalid range. + } else { lnum = eap->line1; - for (; lnum <= eap->line2; ++lnum) { - if (!eap->skip && eap->addr_count > 0) { + } + for (; lnum <= eap->line2; lnum++) { + if (!eap->skip && eap->addr_count > 0) { // -V560 curwin->w_cursor.lnum = lnum; curwin->w_cursor.col = 0; curwin->w_cursor.coladd = 0; @@ -2825,9 +2743,10 @@ void ex_call(exarg_T *eap) break; } - clear_tv(&rettv); - if (doesrange || eap->skip) + tv_clear(&rettv); + if (doesrange || eap->skip) { // -V560 break; + } /* Stop when immediately aborting on error, or when an interrupt * occurred or an exception was thrown but not caught. @@ -2849,10 +2768,12 @@ void ex_call(exarg_T *eap) } end: - dict_unref(fudi.fd_dict); + tv_dict_unref(fudi.fd_dict); xfree(tofree); } +// TODO(ZyX-I): move to eval/ex_cmds + /* * ":unlet[!] var1 ... " command. */ @@ -2861,6 +2782,8 @@ void ex_unlet(exarg_T *eap) ex_unletlock(eap, eap->arg, 0); } +// TODO(ZyX-I): move to eval/ex_cmds + /* * ":lockvar" and ":unlockvar" commands */ @@ -2879,22 +2802,25 @@ void ex_lockvar(exarg_T *eap) ex_unletlock(eap, arg, deep); } +// TODO(ZyX-I): move to eval/ex_cmds + /* * ":unlet", ":lockvar" and ":unlockvar" are quite similar. */ static void ex_unletlock(exarg_T *eap, char_u *argstart, int deep) { char_u *arg = argstart; - char_u *name_end; - int error = FALSE; + bool error = false; lval_T lv; do { - /* Parse the name and find the end. */ - name_end = get_lval(arg, NULL, &lv, TRUE, eap->skip || error, 0, - FNE_CHECK_START); - if (lv.ll_name == NULL) - error = TRUE; /* error but continue parsing */ + // Parse the name and find the end. + char_u *const name_end = (char_u *)get_lval(arg, NULL, &lv, true, + eap->skip || error, + 0, FNE_CHECK_START); + if (lv.ll_name == NULL) { + error = true; // error, but continue parsing. + } if (name_end == NULL || (!ascii_iswhite(*name_end) && !ends_excmd(*name_end))) { if (name_end != NULL) { @@ -2912,8 +2838,9 @@ static void ex_unletlock(exarg_T *eap, char_u *argstart, int deep) error = TRUE; } else { if (do_lock_var(&lv, name_end, deep, - eap->cmdidx == CMD_lockvar) == FAIL) - error = TRUE; + eap->cmdidx == CMD_lockvar) == FAIL) { + error = true; + } } } @@ -2926,7 +2853,9 @@ static void ex_unletlock(exarg_T *eap, char_u *argstart, int deep) eap->nextcmd = check_nextcmd(arg); } -static int do_unlet_var(lval_T *lp, char_u *name_end, int forceit) +// TODO(ZyX-I): move to eval/ex_cmds + +static int do_unlet_var(lval_T *const lp, char_u *const name_end, int forceit) { int ret = OK; int cc; @@ -2936,17 +2865,17 @@ static int do_unlet_var(lval_T *lp, char_u *name_end, int forceit) *name_end = NUL; // Normal name or expanded name. - if (do_unlet(lp->ll_name, forceit) == FAIL) { + if (do_unlet(lp->ll_name, lp->ll_name_len, forceit) == FAIL) { ret = FAIL; } *name_end = cc; } else if ((lp->ll_list != NULL && tv_check_lock(lp->ll_list->lv_lock, (const char *)lp->ll_name, - STRLEN(lp->ll_name))) + lp->ll_name_len)) || (lp->ll_dict != NULL && tv_check_lock(lp->ll_dict->dv_lock, (const char *)lp->ll_name, - STRLEN(lp->ll_name)))) { + lp->ll_name_len))) { return FAIL; } else if (lp->ll_range) { listitem_T *li; @@ -2956,7 +2885,7 @@ static int do_unlet_var(lval_T *lp, char_u *name_end, int forceit) while (ll_li != NULL && (lp->ll_empty2 || lp->ll_n2 >= ll_n1)) { li = ll_li->li_next; if (tv_check_lock(ll_li->li_tv.v_lock, (const char *)lp->ll_name, - STRLEN(lp->ll_name))) { + lp->ll_name_len)) { return false; } ll_li = li; @@ -2966,33 +2895,33 @@ static int do_unlet_var(lval_T *lp, char_u *name_end, int forceit) /* Delete a range of List items. */ while (lp->ll_li != NULL && (lp->ll_empty2 || lp->ll_n2 >= lp->ll_n1)) { li = lp->ll_li->li_next; - listitem_remove(lp->ll_list, lp->ll_li); + tv_list_item_remove(lp->ll_list, lp->ll_li); lp->ll_li = li; ++lp->ll_n1; } } else { if (lp->ll_list != NULL) { // unlet a List item. - listitem_remove(lp->ll_list, lp->ll_li); + tv_list_item_remove(lp->ll_list, lp->ll_li); } else { // unlet a Dictionary item. dict_T *d = lp->ll_dict; dictitem_T *di = lp->ll_di; - bool watched = is_watched(d); + bool watched = tv_dict_is_watched(d); char *key = NULL; typval_T oldtv; if (watched) { - copy_tv(&di->di_tv, &oldtv); + tv_copy(&di->di_tv, &oldtv); // need to save key because dictitem_remove will free it key = xstrdup((char *)di->di_key); } - dictitem_remove(d, di); + tv_dict_item_remove(d, di); if (watched) { - dictwatcher_notify(d, key, NULL, &oldtv); - clear_tv(&oldtv); + tv_dict_watcher_notify(d, key, NULL, &oldtv); + tv_clear(&oldtv); xfree(key); } } @@ -3001,22 +2930,24 @@ static int do_unlet_var(lval_T *lp, char_u *name_end, int forceit) return ret; } -/* - * "unlet" a variable. Return OK if it existed, FAIL if not. - * When "forceit" is TRUE don't complain if the variable doesn't exist. - */ -int do_unlet(char_u *name, int forceit) +// TODO(ZyX-I): move to eval/ex_cmds + +/// unlet a variable +/// +/// @param[in] name Variable name to unlet. +/// @param[in] name_len Variable name length. +/// @param[in] fonceit If true, do not complain if variable doesn’t exist. +/// +/// @return OK if it existed, FAIL otherwise. +int do_unlet(const char *const name, const size_t name_len, const int forceit) + FUNC_ATTR_NONNULL_ALL { - hashtab_T *ht; - hashitem_T *hi; - char_u *varname; - dict_T *d; - dictitem_T *di; + const char *varname; dict_T *dict; - ht = find_var_ht_dict((const char *)name, STRLEN(name), - (const char **)&varname, &dict); + hashtab_T *ht = find_var_ht_dict(name, name_len, &varname, &dict); if (ht != NULL && *varname != NUL) { + dict_T *d; if (ht == &globvarht) { d = &globvardict; } else if (current_funccal != NULL @@ -3025,42 +2956,41 @@ int do_unlet(char_u *name, int forceit) } else if (ht == &compat_hashtab) { d = &vimvardict; } else { - di = find_var_in_ht(ht, *name, "", 0, false); + dictitem_T *const di = find_var_in_ht(ht, *name, "", 0, false); d = di->di_tv.vval.v_dict; } if (d == NULL) { EMSG2(_(e_intern2), "do_unlet()"); return FAIL; } - hi = hash_find(ht, varname); + hashitem_T *hi = hash_find(ht, (const char_u *)varname); if (HASHITEM_EMPTY(hi)) { hi = find_hi_in_scoped_ht((const char *)name, &ht); } if (hi != NULL && !HASHITEM_EMPTY(hi)) { - di = HI2DI(hi); - if (var_check_fixed(di->di_flags, (const char *)name, STRLEN(name)) - || var_check_ro(di->di_flags, (const char *)name, STRLEN(name)) - || tv_check_lock(d->dv_lock, (const char *)name, STRLEN(name))) { + dictitem_T *const di = TV_DICT_HI2DI(hi); + if (var_check_fixed(di->di_flags, (const char *)name, TV_CSTRING) + || var_check_ro(di->di_flags, (const char *)name, TV_CSTRING) + || tv_check_lock(d->dv_lock, (const char *)name, TV_CSTRING)) { return FAIL; } - if (d == NULL - || tv_check_lock(d->dv_lock, (const char *)name, STRLEN(name))) { + if (tv_check_lock(d->dv_lock, (const char *)name, TV_CSTRING)) { return FAIL; } typval_T oldtv; - bool watched = is_watched(dict); + bool watched = tv_dict_is_watched(dict); if (watched) { - copy_tv(&di->di_tv, &oldtv); + tv_copy(&di->di_tv, &oldtv); } delete_var(ht, hi); if (watched) { - dictwatcher_notify(dict, (char *)varname, NULL, &oldtv); - clear_tv(&oldtv); + tv_dict_watcher_notify(dict, varname, NULL, &oldtv); + tv_clear(&oldtv); } return OK; } @@ -3071,12 +3001,15 @@ int do_unlet(char_u *name, int forceit) return FAIL; } +// TODO(ZyX-I): move to eval/ex_cmds + /* * Lock or unlock variable indicated by "lp". * "deep" is the levels to go (-1 for unlimited); * "lock" is TRUE for ":lockvar", FALSE for ":unlockvar". */ -static int do_lock_var(lval_T *lp, char_u *name_end, int deep, int lock) +static int do_lock_var(lval_T *lp, char_u *const name_end, const int deep, + const bool lock) { int ret = OK; @@ -3086,9 +3019,8 @@ static int do_lock_var(lval_T *lp, char_u *name_end, int deep, int lock) if (lp->ll_tv == NULL) { // Normal name or expanded name. - const size_t name_len = (size_t)(name_end - lp->ll_name); dictitem_T *const di = find_var( - (const char *)lp->ll_name, name_len, NULL, + (const char *)lp->ll_name, lp->ll_name_len, NULL, true); if (di == NULL) { ret = FAIL; @@ -3104,134 +3036,39 @@ static int do_lock_var(lval_T *lp, char_u *name_end, int deep, int lock) } else { di->di_flags &= ~DI_FLAGS_LOCK; } - item_lock(&di->di_tv, deep, lock); + tv_item_lock(&di->di_tv, deep, lock); } } else if (lp->ll_range) { listitem_T *li = lp->ll_li; /* (un)lock a range of List items. */ while (li != NULL && (lp->ll_empty2 || lp->ll_n2 >= lp->ll_n1)) { - item_lock(&li->li_tv, deep, lock); + tv_item_lock(&li->li_tv, deep, lock); li = li->li_next; ++lp->ll_n1; } } else if (lp->ll_list != NULL) { // (un)lock a List item. - item_lock(&lp->ll_li->li_tv, deep, lock); + tv_item_lock(&lp->ll_li->li_tv, deep, lock); } else { // (un)lock a Dictionary item. - item_lock(&lp->ll_di->di_tv, deep, lock); + tv_item_lock(&lp->ll_di->di_tv, deep, lock); } return ret; } -/* - * Lock or unlock an item. "deep" is nr of levels to go. - */ -static void item_lock(typval_T *tv, int deep, int lock) -{ - static int recurse = 0; - - if (recurse >= DICT_MAXNEST) { - EMSG(_("E743: variable nested too deep for (un)lock")); - return; - } - if (deep == 0) { - return; - } - recurse++; - - // lock/unlock the item itself -#define CHANGE_LOCK(var, lock) \ - do { \ - var = ((VarLockStatus[]) { \ - [VAR_UNLOCKED] = (lock ? VAR_LOCKED : VAR_UNLOCKED), \ - [VAR_LOCKED] = (lock ? VAR_LOCKED : VAR_UNLOCKED), \ - [VAR_FIXED] = VAR_FIXED, \ - })[var]; \ - } while (0) - CHANGE_LOCK(tv->v_lock, lock); - - switch (tv->v_type) { - case VAR_LIST: { - list_T *const l = tv->vval.v_list; - if (l != NULL) { - CHANGE_LOCK(l->lv_lock, lock); - if (deep < 0 || deep > 1) { - // Recursive: lock/unlock the items the List contains. - for (listitem_T *li = l->lv_first; li != NULL; li = li->li_next) { - item_lock(&li->li_tv, deep - 1, lock); - } - } - } - break; - } - case VAR_DICT: { - dict_T *const d = tv->vval.v_dict; - if (d != NULL) { - CHANGE_LOCK(d->dv_lock, lock); - if (deep < 0 || deep > 1) { - // Recursive: lock/unlock the items the List contains. - int todo = (int)d->dv_hashtab.ht_used; - for (hashitem_T *hi = d->dv_hashtab.ht_array; todo > 0; hi++) { - if (!HASHITEM_EMPTY(hi)) { - todo--; - item_lock(&HI2DI(hi)->di_tv, deep - 1, lock); - } - } - } - } - break; - } - case VAR_NUMBER: - case VAR_FLOAT: - case VAR_STRING: - case VAR_FUNC: - case VAR_PARTIAL: - case VAR_SPECIAL: { - break; - } - case VAR_UNKNOWN: { - assert(false); - } - } -#undef CHANGE_LOCK - recurse--; -} - -/* - * Return TRUE if typeval "tv" is locked: Either that value is locked itself - * or it refers to a List or Dictionary that is locked. - */ -static int tv_islocked(typval_T *tv) -{ - return (tv->v_lock & VAR_LOCKED) - || (tv->v_type == VAR_LIST - && tv->vval.v_list != NULL - && (tv->vval.v_list->lv_lock & VAR_LOCKED)) - || (tv->v_type == VAR_DICT - && tv->vval.v_dict != NULL - && (tv->vval.v_dict->dv_lock & VAR_LOCKED)); -} - /* * Delete all "menutrans_" variables. */ void del_menutrans_vars(void) { - hashitem_T *hi; - int todo; - hash_lock(&globvarht); - todo = (int)globvarht.ht_used; - for (hi = globvarht.ht_array; todo > 0 && !got_int; ++hi) { - if (!HASHITEM_EMPTY(hi)) { - --todo; - if (STRNCMP(HI2DI(hi)->di_key, "menutrans_", 10) == 0) - delete_var(&globvarht, hi); + HASHTAB_ITER(&globvarht, hi, { + if (STRNCMP(hi->hi_key, "menutrans_", 10) == 0) { + delete_var(&globvarht, hi); } - } + }); hash_unlock(&globvarht); } @@ -3343,6 +3180,7 @@ char_u *get_user_var_name(expand_T *xp, int idx) return NULL; } +// TODO(ZyX-I): move to eval/expressions /// Return TRUE if "pat" matches "text". /// Does not use 'cpo' and always uses 'magic'. @@ -3379,6 +3217,8 @@ typedef enum { , TYPE_NOMATCH /* !~ */ } exptype_T; +// TODO(ZyX-I): move to eval/expressions + /* * The "evaluate" argument: When FALSE, the argument is only parsed but not * executed. The function may return OK, but the rettv will be of type @@ -3392,7 +3232,7 @@ typedef enum { * Note: "rettv.v_lock" is not set. * Return OK or FAIL. */ -static int eval0(char_u *arg, typval_T *rettv, char_u **nextcmd, int evaluate) +int eval0(char_u *arg, typval_T *rettv, char_u **nextcmd, int evaluate) { int ret; char_u *p; @@ -3400,15 +3240,15 @@ static int eval0(char_u *arg, typval_T *rettv, char_u **nextcmd, int evaluate) p = skipwhite(arg); ret = eval1(&p, rettv, evaluate); if (ret == FAIL || !ends_excmd(*p)) { - if (ret != FAIL) - clear_tv(rettv); - /* - * Report the invalid expression unless the expression evaluation has - * been cancelled due to an aborting error, an interrupt, or an - * exception. - */ - if (!aborting()) - EMSG2(_(e_invexpr2), arg); + if (ret != FAIL) { + tv_clear(rettv); + } + // Report the invalid expression unless the expression evaluation has + // been cancelled due to an aborting error, an interrupt, or an + // exception. + if (!aborting()) { + emsgf(_(e_invexpr2), arg); + } ret = FAIL; } if (nextcmd != NULL) @@ -3417,6 +3257,8 @@ static int eval0(char_u *arg, typval_T *rettv, char_u **nextcmd, int evaluate) return ret; } +// TODO(ZyX-I): move to eval/expressions + /* * Handle top level expression: * expr2 ? expr1 : expr1 @@ -3442,13 +3284,15 @@ static int eval1(char_u **arg, typval_T *rettv, int evaluate) if ((*arg)[0] == '?') { result = FALSE; if (evaluate) { - int error = FALSE; + bool error = false; - if (get_tv_number_chk(rettv, &error) != 0) - result = TRUE; - clear_tv(rettv); - if (error) + if (tv_get_number_chk(rettv, &error) != 0) { + result = true; + } + tv_clear(rettv); + if (error) { return FAIL; + } } /* @@ -3462,9 +3306,10 @@ static int eval1(char_u **arg, typval_T *rettv, int evaluate) * Check for the ":". */ if ((*arg)[0] != ':') { - EMSG(_("E109: Missing ':' after '?'")); - if (evaluate && result) - clear_tv(rettv); + emsgf(_("E109: Missing ':' after '?'")); + if (evaluate && result) { + tv_clear(rettv); + } return FAIL; } @@ -3472,9 +3317,10 @@ static int eval1(char_u **arg, typval_T *rettv, int evaluate) * Get the third variable. */ *arg = skipwhite(*arg + 1); - if (eval1(arg, &var2, evaluate && !result) == FAIL) { /* recursive! */ - if (evaluate && result) - clear_tv(rettv); + if (eval1(arg, &var2, evaluate && !result) == FAIL) { // Recursive! + if (evaluate && result) { + tv_clear(rettv); + } return FAIL; } if (evaluate && !result) @@ -3484,6 +3330,8 @@ static int eval1(char_u **arg, typval_T *rettv, int evaluate) return OK; } +// TODO(ZyX-I): move to eval/expressions + /* * Handle first level expression: * expr2 || expr2 || expr2 logical OR @@ -3498,7 +3346,7 @@ static int eval2(char_u **arg, typval_T *rettv, int evaluate) typval_T var2; long result; int first; - int error = FALSE; + bool error = false; /* * Get the first variable. @@ -3513,12 +3361,14 @@ static int eval2(char_u **arg, typval_T *rettv, int evaluate) result = FALSE; while ((*arg)[0] == '|' && (*arg)[1] == '|') { if (evaluate && first) { - if (get_tv_number_chk(rettv, &error) != 0) - result = TRUE; - clear_tv(rettv); - if (error) + if (tv_get_number_chk(rettv, &error) != 0) { + result = true; + } + tv_clear(rettv); + if (error) { return FAIL; - first = FALSE; + } + first = false; } /* @@ -3532,11 +3382,13 @@ static int eval2(char_u **arg, typval_T *rettv, int evaluate) * Compute the result. */ if (evaluate && !result) { - if (get_tv_number_chk(&var2, &error) != 0) - result = TRUE; - clear_tv(&var2); - if (error) + if (tv_get_number_chk(&var2, &error) != 0) { + result = true; + } + tv_clear(&var2); + if (error) { return FAIL; + } } if (evaluate) { rettv->v_type = VAR_NUMBER; @@ -3547,6 +3399,8 @@ static int eval2(char_u **arg, typval_T *rettv, int evaluate) return OK; } +// TODO(ZyX-I): move to eval/expressions + /* * Handle second level expression: * expr3 && expr3 && expr3 logical AND @@ -3561,7 +3415,7 @@ static int eval3(char_u **arg, typval_T *rettv, int evaluate) typval_T var2; long result; int first; - int error = FALSE; + bool error = false; /* * Get the first variable. @@ -3576,12 +3430,14 @@ static int eval3(char_u **arg, typval_T *rettv, int evaluate) result = TRUE; while ((*arg)[0] == '&' && (*arg)[1] == '&') { if (evaluate && first) { - if (get_tv_number_chk(rettv, &error) == 0) - result = FALSE; - clear_tv(rettv); - if (error) + if (tv_get_number_chk(rettv, &error) == 0) { + result = false; + } + tv_clear(rettv); + if (error) { return FAIL; - first = FALSE; + } + first = false; } /* @@ -3595,11 +3451,13 @@ static int eval3(char_u **arg, typval_T *rettv, int evaluate) * Compute the result. */ if (evaluate && result) { - if (get_tv_number_chk(&var2, &error) == 0) - result = FALSE; - clear_tv(&var2); - if (error) + if (tv_get_number_chk(&var2, &error) == 0) { + result = false; + } + tv_clear(&var2); + if (error) { return FAIL; + } } if (evaluate) { rettv->v_type = VAR_NUMBER; @@ -3610,6 +3468,8 @@ static int eval3(char_u **arg, typval_T *rettv, int evaluate) return OK; } +// TODO(ZyX-I): move to eval/expressions + /* * Handle third level expression: * var1 == var2 @@ -3636,9 +3496,7 @@ static int eval4(char_u **arg, typval_T *rettv, int evaluate) exptype_T type = TYPE_UNKNOWN; int type_is = FALSE; /* TRUE for "is" and "isnot" */ int len = 2; - long n1, n2; - char_u *s1, *s2; - char_u buf1[NUMBUFLEN], buf2[NUMBUFLEN]; + varnumber_T n1, n2; int ic; /* @@ -3706,7 +3564,7 @@ static int eval4(char_u **arg, typval_T *rettv, int evaluate) */ *arg = skipwhite(p + len); if (eval5(arg, &var2, evaluate) == FAIL) { - clear_tv(rettv); + tv_clear(rettv); return FAIL; } @@ -3728,15 +3586,15 @@ static int eval4(char_u **arg, typval_T *rettv, int evaluate) } else { EMSG(_("E692: Invalid operation for List")); } - clear_tv(rettv); - clear_tv(&var2); + tv_clear(rettv); + tv_clear(&var2); return FAIL; } else { - /* Compare two Lists for being equal or unequal. */ - n1 = list_equal(rettv->vval.v_list, var2.vval.v_list, - ic, FALSE); - if (type == TYPE_NEQUAL) + // Compare two Lists for being equal or unequal. + n1 = tv_list_equal(rettv->vval.v_list, var2.vval.v_list, ic, false); + if (type == TYPE_NEQUAL) { n1 = !n1; + } } } else if (rettv->v_type == VAR_DICT || var2.v_type == VAR_DICT) { if (type_is) { @@ -3750,23 +3608,22 @@ static int eval4(char_u **arg, typval_T *rettv, int evaluate) EMSG(_("E735: Can only compare Dictionary with Dictionary")); else EMSG(_("E736: Invalid operation for Dictionary")); - clear_tv(rettv); - clear_tv(&var2); + tv_clear(rettv); + tv_clear(&var2); return FAIL; } else { - /* Compare two Dictionaries for being equal or unequal. */ - n1 = dict_equal(rettv->vval.v_dict, var2.vval.v_dict, - ic, FALSE); - if (type == TYPE_NEQUAL) + // Compare two Dictionaries for being equal or unequal. + n1 = tv_dict_equal(rettv->vval.v_dict, var2.vval.v_dict, + ic, false); + if (type == TYPE_NEQUAL) { n1 = !n1; + } } - } else if (rettv->v_type == VAR_FUNC || var2.v_type == VAR_FUNC - || rettv->v_type == VAR_PARTIAL - || var2.v_type == VAR_PARTIAL) { + } else if (tv_is_func(*rettv) || tv_is_func(var2)) { if (type != TYPE_EQUAL && type != TYPE_NEQUAL) { EMSG(_("E694: Invalid operation for Funcrefs")); - clear_tv(rettv); - clear_tv(&var2); + tv_clear(rettv); + tv_clear(&var2); return FAIL; } if ((rettv->v_type == VAR_PARTIAL @@ -3801,25 +3658,27 @@ static int eval4(char_u **arg, typval_T *rettv, int evaluate) && type != TYPE_MATCH && type != TYPE_NOMATCH) { float_T f1, f2; - if (rettv->v_type == VAR_FLOAT) + if (rettv->v_type == VAR_FLOAT) { f1 = rettv->vval.v_float; - else - f1 = get_tv_number(rettv); - if (var2.v_type == VAR_FLOAT) + } else { + f1 = tv_get_number(rettv); + } + if (var2.v_type == VAR_FLOAT) { f2 = var2.vval.v_float; - else - f2 = get_tv_number(&var2); - n1 = FALSE; + } else { + f2 = tv_get_number(&var2); + } + n1 = false; switch (type) { - case TYPE_EQUAL: n1 = (f1 == f2); break; - case TYPE_NEQUAL: n1 = (f1 != f2); break; - case TYPE_GREATER: n1 = (f1 > f2); break; - case TYPE_GEQUAL: n1 = (f1 >= f2); break; - case TYPE_SMALLER: n1 = (f1 < f2); break; - case TYPE_SEQUAL: n1 = (f1 <= f2); break; - case TYPE_UNKNOWN: - case TYPE_MATCH: - case TYPE_NOMATCH: break; /* avoid gcc warning */ + case TYPE_EQUAL: n1 = (f1 == f2); break; + case TYPE_NEQUAL: n1 = (f1 != f2); break; + case TYPE_GREATER: n1 = (f1 > f2); break; + case TYPE_GEQUAL: n1 = (f1 >= f2); break; + case TYPE_SMALLER: n1 = (f1 < f2); break; + case TYPE_SEQUAL: n1 = (f1 <= f2); break; + case TYPE_UNKNOWN: + case TYPE_MATCH: + case TYPE_NOMATCH: break; } } /* @@ -3828,48 +3687,51 @@ static int eval4(char_u **arg, typval_T *rettv, int evaluate) */ else if ((rettv->v_type == VAR_NUMBER || var2.v_type == VAR_NUMBER) && type != TYPE_MATCH && type != TYPE_NOMATCH) { - n1 = get_tv_number(rettv); - n2 = get_tv_number(&var2); + n1 = tv_get_number(rettv); + n2 = tv_get_number(&var2); switch (type) { - case TYPE_EQUAL: n1 = (n1 == n2); break; - case TYPE_NEQUAL: n1 = (n1 != n2); break; - case TYPE_GREATER: n1 = (n1 > n2); break; - case TYPE_GEQUAL: n1 = (n1 >= n2); break; - case TYPE_SMALLER: n1 = (n1 < n2); break; - case TYPE_SEQUAL: n1 = (n1 <= n2); break; - case TYPE_UNKNOWN: - case TYPE_MATCH: - case TYPE_NOMATCH: break; /* avoid gcc warning */ + case TYPE_EQUAL: n1 = (n1 == n2); break; + case TYPE_NEQUAL: n1 = (n1 != n2); break; + case TYPE_GREATER: n1 = (n1 > n2); break; + case TYPE_GEQUAL: n1 = (n1 >= n2); break; + case TYPE_SMALLER: n1 = (n1 < n2); break; + case TYPE_SEQUAL: n1 = (n1 <= n2); break; + case TYPE_UNKNOWN: + case TYPE_MATCH: + case TYPE_NOMATCH: break; } } else { - s1 = get_tv_string_buf(rettv, buf1); - s2 = get_tv_string_buf(&var2, buf2); - if (type != TYPE_MATCH && type != TYPE_NOMATCH) - i = ic ? mb_stricmp(s1, s2) : STRCMP(s1, s2); - else + char buf1[NUMBUFLEN]; + char buf2[NUMBUFLEN]; + const char *const s1 = tv_get_string_buf(rettv, buf1); + const char *const s2 = tv_get_string_buf(&var2, buf2); + if (type != TYPE_MATCH && type != TYPE_NOMATCH) { + i = mb_strcmp_ic((bool)ic, s1, s2); + } else { i = 0; - n1 = FALSE; + } + n1 = false; switch (type) { - case TYPE_EQUAL: n1 = (i == 0); break; - case TYPE_NEQUAL: n1 = (i != 0); break; - case TYPE_GREATER: n1 = (i > 0); break; - case TYPE_GEQUAL: n1 = (i >= 0); break; - case TYPE_SMALLER: n1 = (i < 0); break; - case TYPE_SEQUAL: n1 = (i <= 0); break; + case TYPE_EQUAL: n1 = (i == 0); break; + case TYPE_NEQUAL: n1 = (i != 0); break; + case TYPE_GREATER: n1 = (i > 0); break; + case TYPE_GEQUAL: n1 = (i >= 0); break; + case TYPE_SMALLER: n1 = (i < 0); break; + case TYPE_SEQUAL: n1 = (i <= 0); break; - case TYPE_MATCH: - case TYPE_NOMATCH: - n1 = pattern_match(s2, s1, ic); - if (type == TYPE_NOMATCH) { - n1 = !n1; + case TYPE_MATCH: + case TYPE_NOMATCH: { + n1 = pattern_match((char_u *)s2, (char_u *)s1, ic); + if (type == TYPE_NOMATCH) { + n1 = !n1; + } + break; } - break; - - case TYPE_UNKNOWN: break; /* avoid gcc warning */ + case TYPE_UNKNOWN: break; // Avoid gcc warning. } } - clear_tv(rettv); - clear_tv(&var2); + tv_clear(rettv); + tv_clear(&var2); rettv->v_type = VAR_NUMBER; rettv->vval.v_number = n1; } @@ -3878,6 +3740,8 @@ static int eval4(char_u **arg, typval_T *rettv, int evaluate) return OK; } +// TODO(ZyX-I): move to eval/expressions + /* * Handle fourth level expression: * + number addition @@ -3894,10 +3758,8 @@ static int eval5(char_u **arg, typval_T *rettv, int evaluate) typval_T var2; typval_T var3; int op; - long n1, n2; + varnumber_T n1, n2; float_T f1 = 0, f2 = 0; - char_u *s1, *s2; - char_u buf1[NUMBUFLEN], buf2[NUMBUFLEN]; char_u *p; /* @@ -3915,17 +3777,16 @@ static int eval5(char_u **arg, typval_T *rettv, int evaluate) break; if ((op != '+' || rettv->v_type != VAR_LIST) - && (op == '.' || rettv->v_type != VAR_FLOAT) - ) { - /* For "list + ...", an illegal use of the first operand as - * a number cannot be determined before evaluating the 2nd - * operand: if this is also a list, all is ok. - * For "something . ...", "something - ..." or "non-list + ...", - * we know that the first operand needs to be a string or number - * without evaluating the 2nd operand. So check before to avoid - * side effects after an error. */ - if (evaluate && get_tv_string_chk(rettv) == NULL) { - clear_tv(rettv); + && (op == '.' || rettv->v_type != VAR_FLOAT)) { + // For "list + ...", an illegal use of the first operand as + // a number cannot be determined before evaluating the 2nd + // operand: if this is also a list, all is ok. + // For "something . ...", "something - ..." or "non-list + ...", + // we know that the first operand needs to be a string or number + // without evaluating the 2nd operand. So check before to avoid + // side effects after an error. + if (evaluate && !tv_check_str(rettv)) { + tv_clear(rettv); return FAIL; } } @@ -3935,7 +3796,7 @@ static int eval5(char_u **arg, typval_T *rettv, int evaluate) */ *arg = skipwhite(*arg + 1); if (eval6(arg, &var2, evaluate, op == '.') == FAIL) { - clear_tv(rettv); + tv_clear(rettv); return FAIL; } @@ -3944,41 +3805,44 @@ static int eval5(char_u **arg, typval_T *rettv, int evaluate) * Compute the result. */ if (op == '.') { - s1 = get_tv_string_buf(rettv, buf1); /* already checked */ - s2 = get_tv_string_buf_chk(&var2, buf2); - if (s2 == NULL) { /* type error ? */ - clear_tv(rettv); - clear_tv(&var2); + char buf1[NUMBUFLEN]; + char buf2[NUMBUFLEN]; + // s1 already checked + const char *const s1 = tv_get_string_buf(rettv, buf1); + const char *const s2 = tv_get_string_buf_chk(&var2, buf2); + if (s2 == NULL) { // Type error? + tv_clear(rettv); + tv_clear(&var2); return FAIL; } - p = concat_str(s1, s2); - clear_tv(rettv); + p = concat_str((const char_u *)s1, (const char_u *)s2); + tv_clear(rettv); rettv->v_type = VAR_STRING; rettv->vval.v_string = p; } else if (op == '+' && rettv->v_type == VAR_LIST && var2.v_type == VAR_LIST) { - /* concatenate Lists */ - if (list_concat(rettv->vval.v_list, var2.vval.v_list, - &var3) == FAIL) { - clear_tv(rettv); - clear_tv(&var2); + // Concatenate Lists. + if (tv_list_concat(rettv->vval.v_list, var2.vval.v_list, &var3) + == FAIL) { + tv_clear(rettv); + tv_clear(&var2); return FAIL; } - clear_tv(rettv); + tv_clear(rettv); *rettv = var3; } else { - int error = FALSE; + bool error = false; if (rettv->v_type == VAR_FLOAT) { f1 = rettv->vval.v_float; n1 = 0; } else { - n1 = get_tv_number_chk(rettv, &error); + n1 = tv_get_number_chk(rettv, &error); if (error) { /* This can only happen for "list + non-list". For * "non-list + ..." or "something - ...", we returned * before evaluating the 2nd operand. */ - clear_tv(rettv); + tv_clear(rettv); return FAIL; } if (var2.v_type == VAR_FLOAT) @@ -3988,16 +3852,16 @@ static int eval5(char_u **arg, typval_T *rettv, int evaluate) f2 = var2.vval.v_float; n2 = 0; } else { - n2 = get_tv_number_chk(&var2, &error); + n2 = tv_get_number_chk(&var2, &error); if (error) { - clear_tv(rettv); - clear_tv(&var2); + tv_clear(rettv); + tv_clear(&var2); return FAIL; } if (rettv->v_type == VAR_FLOAT) f2 = n2; } - clear_tv(rettv); + tv_clear(rettv); /* If there is a float on either side the result is a float. */ if (rettv->v_type == VAR_FLOAT || var2.v_type == VAR_FLOAT) { @@ -4016,37 +3880,36 @@ static int eval5(char_u **arg, typval_T *rettv, int evaluate) rettv->vval.v_number = n1; } } - clear_tv(&var2); + tv_clear(&var2); } } return OK; } -/* - * Handle fifth level expression: - * * number multiplication - * / number division - * % number modulo - * - * "arg" must point to the first non-white of the expression. - * "arg" is advanced to the next non-white after the recognized expression. - * - * Return OK or FAIL. - */ -static int -eval6 ( - char_u **arg, - typval_T *rettv, - int evaluate, - int want_string /* after "." operator */ -) +// TODO(ZyX-I): move to eval/expressions + +/// Handle fifth level expression: +/// - * number multiplication +/// - / number division +/// - % number modulo +/// +/// @param[in,out] arg Points to the first non-whitespace character of the +/// expression. Is advanced to the next non-whitespace +/// character after the recognized expression. +/// @param[out] rettv Location where result is saved. +/// @param[in] evaluate If not true, rettv is not populated. +/// @param[in] want_string True if "." is string_concatenation, otherwise +/// float +/// @return OK or FAIL. +static int eval6(char_u **arg, typval_T *rettv, int evaluate, int want_string) + FUNC_ATTR_NO_SANITIZE_UNDEFINED { typval_T var2; int op; - long n1, n2; - int use_float = FALSE; + varnumber_T n1, n2; + bool use_float = false; float_T f1 = 0, f2; - int error = FALSE; + bool error = false; /* * Get the first variable. @@ -4065,15 +3928,18 @@ eval6 ( if (evaluate) { if (rettv->v_type == VAR_FLOAT) { f1 = rettv->vval.v_float; - use_float = TRUE; + use_float = true; n1 = 0; - } else - n1 = get_tv_number_chk(rettv, &error); - clear_tv(rettv); - if (error) + } else { + n1 = tv_get_number_chk(rettv, &error); + } + tv_clear(rettv); + if (error) { return FAIL; - } else + } + } else { n1 = 0; + } /* * Get the second variable. @@ -4086,17 +3952,19 @@ eval6 ( if (var2.v_type == VAR_FLOAT) { if (!use_float) { f1 = n1; - use_float = TRUE; + use_float = true; } f2 = var2.vval.v_float; n2 = 0; } else { - n2 = get_tv_number_chk(&var2, &error); - clear_tv(&var2); - if (error) + n2 = tv_get_number_chk(&var2, &error); + tv_clear(&var2); + if (error) { return FAIL; - if (use_float) + } + if (use_float) { f2 = n2; + } } /* @@ -4127,18 +3995,20 @@ eval6 ( rettv->v_type = VAR_FLOAT; rettv->vval.v_float = f1; } else { - if (op == '*') + if (op == '*') { n1 = n1 * n2; - else if (op == '/') { - if (n2 == 0) { /* give an error message? */ - if (n1 == 0) - n1 = -0x7fffffffL - 1L; /* similar to NaN */ - else if (n1 < 0) - n1 = -0x7fffffffL; - else - n1 = 0x7fffffffL; - } else + } else if (op == '/') { + if (n2 == 0) { // give an error message? + if (n1 == 0) { + n1 = VARNUMBER_MIN; // similar to NaN + } else if (n1 < 0) { + n1 = -VARNUMBER_MAX; + } else { + n1 = VARNUMBER_MAX; + } + } else { n1 = n1 / n2; + } } else { if (n2 == 0) /* give an error message? */ n1 = 0; @@ -4154,6 +4024,8 @@ eval6 ( return OK; } +// TODO(ZyX-I): move to eval/expressions + // Handle sixth level expression: // number number constant // "string" string constant @@ -4185,18 +4057,18 @@ static int eval7( int want_string // after "." operator ) { - long n; + varnumber_T n; int len; char_u *s; char_u *start_leader, *end_leader; int ret = OK; char_u *alias; - // Initialise variable so that clear_tv() can't mistake this for a + // Initialise variable so that tv_clear() can't mistake this for a // string and free a string that isn't there. rettv->v_type = VAR_UNKNOWN; - // Skip '!' and '-' characters. They are handled later. + // Skip '!', '-' and '+' characters. They are handled later. start_leader = *arg; while (**arg == '!' || **arg == '-' || **arg == '+') { *arg = skipwhite(*arg + 1); @@ -4308,7 +4180,7 @@ static int eval7( ++*arg; } else if (ret == OK) { EMSG(_("E110: Missing ')'")); - clear_tv(rettv); + tv_clear(rettv); ret = FAIL; } break; @@ -4340,16 +4212,22 @@ static int eval7( // use its contents. s = deref_func_name((const char *)s, &len, &partial, !evaluate); + // Need to make a copy, in case evaluating the arguments makes + // the name invalid. + s = xmemdupz(s, len); + // Invoke the function. ret = get_func_tv(s, len, rettv, arg, curwin->w_cursor.lnum, curwin->w_cursor.lnum, &len, evaluate, partial, NULL); + xfree(s); + // If evaluate is false rettv->v_type was not set in // get_func_tv, but it's needed in handle_subscript() to parse // what follows. So set it here. if (rettv->v_type == VAR_UNKNOWN && !evaluate && **arg == '(') { - rettv->vval.v_string = empty_string; + rettv->vval.v_string = (char_u *)tv_empty_string; rettv->v_type = VAR_FUNC; } @@ -4358,7 +4236,7 @@ static int eval7( // an exception was thrown but not caught. if (aborting()) { if (ret == OK) { - clear_tv(rettv); + tv_clear(rettv); } ret = FAIL; } @@ -4382,17 +4260,17 @@ static int eval7( // Apply logical NOT and unary '-', from right to left, ignore '+'. if (ret == OK && evaluate && end_leader > start_leader) { - int error = false; - int val = 0; + bool error = false; + varnumber_T val = 0; float_T f = 0.0; if (rettv->v_type == VAR_FLOAT) { f = rettv->vval.v_float; } else { - val = get_tv_number_chk(rettv, &error); + val = tv_get_number_chk(rettv, &error); } if (error) { - clear_tv(rettv); + tv_clear(rettv); ret = FAIL; } else { while (end_leader > start_leader) { @@ -4412,10 +4290,10 @@ static int eval7( } } if (rettv->v_type == VAR_FLOAT) { - clear_tv(rettv); + tv_clear(rettv); rettv->vval.v_float = f; } else { - clear_tv(rettv); + tv_clear(rettv); rettv->v_type = VAR_NUMBER; rettv->vval.v_number = val; } @@ -4425,6 +4303,8 @@ static int eval7( return ret; } +// TODO(ZyX-I): move to eval/expressions + /* * Evaluate an "[expr]" or "[expr:expr]" index. Also "dict.key". * "*arg" points to the '[' or '.'. @@ -4438,12 +4318,11 @@ eval_index ( int verbose /* give error messages */ ) { - int empty1 = FALSE, empty2 = FALSE; - typval_T var1, var2; + bool empty1 = false; + bool empty2 = false; long n1, n2 = 0; - long len = -1; - int range = FALSE; - char_u *s; + ptrdiff_t len = -1; + int range = false; char_u *key = NULL; switch (rettv->v_type) { @@ -4480,8 +4359,8 @@ eval_index ( } } - init_tv(&var1); - init_tv(&var2); + typval_T var1 = TV_INITIAL_VALUE; + typval_T var2 = TV_INITIAL_VALUE; if (**arg == '.') { /* * dict.name @@ -4499,13 +4378,13 @@ eval_index ( * Get the (first) variable from inside the []. */ *arg = skipwhite(*arg + 1); - if (**arg == ':') - empty1 = TRUE; - else if (eval1(arg, &var1, evaluate) == FAIL) /* recursive! */ + if (**arg == ':') { + empty1 = true; + } else if (eval1(arg, &var1, evaluate) == FAIL) { // Recursive! return FAIL; - else if (evaluate && get_tv_string_chk(&var1) == NULL) { - /* not a number or string */ - clear_tv(&var1); + } else if (evaluate && !tv_check_str(&var1)) { + // Not a number or string. + tv_clear(&var1); return FAIL; } @@ -4515,28 +4394,32 @@ eval_index ( if (**arg == ':') { range = TRUE; *arg = skipwhite(*arg + 1); - if (**arg == ']') - empty2 = TRUE; - else if (eval1(arg, &var2, evaluate) == FAIL) { /* recursive! */ - if (!empty1) - clear_tv(&var1); + if (**arg == ']') { + empty2 = true; + } else if (eval1(arg, &var2, evaluate) == FAIL) { // Recursive! + if (!empty1) { + tv_clear(&var1); + } return FAIL; - } else if (evaluate && get_tv_string_chk(&var2) == NULL) { - /* not a number or string */ - if (!empty1) - clear_tv(&var1); - clear_tv(&var2); + } else if (evaluate && !tv_check_str(&var2)) { + // Not a number or string. + if (!empty1) { + tv_clear(&var1); + } + tv_clear(&var2); return FAIL; } } /* Check for the ']'. */ if (**arg != ']') { - if (verbose) - EMSG(_(e_missbrac)); - clear_tv(&var1); - if (range) - clear_tv(&var2); + if (verbose) { + emsgf(_(e_missbrac)); + } + tv_clear(&var1); + if (range) { + tv_clear(&var2); + } return FAIL; } *arg = skipwhite(*arg + 1); /* skip the ']' */ @@ -4545,139 +4428,155 @@ eval_index ( if (evaluate) { n1 = 0; if (!empty1 && rettv->v_type != VAR_DICT) { - n1 = get_tv_number(&var1); - clear_tv(&var1); + n1 = tv_get_number(&var1); + tv_clear(&var1); } if (range) { - if (empty2) + if (empty2) { n2 = -1; - else { - n2 = get_tv_number(&var2); - clear_tv(&var2); + } else { + n2 = tv_get_number(&var2); + tv_clear(&var2); } } switch (rettv->v_type) { - case VAR_NUMBER: - case VAR_STRING: - s = get_tv_string(rettv); - len = (long)STRLEN(s); - if (range) { - /* The resulting variable is a substring. If the indexes - * are out of range the result is empty. */ + case VAR_NUMBER: + case VAR_STRING: { + const char *const s = tv_get_string(rettv); + char *v; + len = (ptrdiff_t)strlen(s); + if (range) { + // The resulting variable is a substring. If the indexes + // are out of range the result is empty. + if (n1 < 0) { + n1 = len + n1; + if (n1 < 0) { + n1 = 0; + } + } + if (n2 < 0) { + n2 = len + n2; + } else if (n2 >= len) { + n2 = len; + } + if (n1 >= len || n2 < 0 || n1 > n2) { + v = NULL; + } else { + v = xmemdupz(s + n1, (size_t)(n2 - n1 + 1)); + } + } else { + // The resulting variable is a string of a single + // character. If the index is too big or negative the + // result is empty. + if (n1 >= len || n1 < 0) { + v = NULL; + } else { + v = xmemdupz(s + n1, 1); + } + } + tv_clear(rettv); + rettv->v_type = VAR_STRING; + rettv->vval.v_string = (char_u *)v; + break; + } + case VAR_LIST: { + len = tv_list_len(rettv->vval.v_list); if (n1 < 0) { n1 = len + n1; - if (n1 < 0) - n1 = 0; } - if (n2 < 0) - n2 = len + n2; - else if (n2 >= len) - n2 = len; - if (n1 >= len || n2 < 0 || n1 > n2) - s = NULL; - else - s = vim_strnsave(s + n1, (int)(n2 - n1 + 1)); - } else { - /* The resulting variable is a string of a single - * character. If the index is too big or negative the - * result is empty. */ - if (n1 >= len || n1 < 0) - s = NULL; - else - s = vim_strnsave(s + n1, 1); - } - clear_tv(rettv); - rettv->v_type = VAR_STRING; - rettv->vval.v_string = s; - break; + if (!empty1 && (n1 < 0 || n1 >= len)) { + // For a range we allow invalid values and return an empty + // list. A list index out of range is an error. + if (!range) { + if (verbose) { + EMSGN(_(e_listidx), n1); + } + return FAIL; + } + n1 = len; + } + if (range) { + list_T *l; + listitem_T *item; - case VAR_LIST: - len = list_len(rettv->vval.v_list); - if (n1 < 0) - n1 = len + n1; - if (!empty1 && (n1 < 0 || n1 >= len)) { - /* For a range we allow invalid values and return an empty - * list. A list index out of range is an error. */ - if (!range) { - if (verbose) - EMSGN(_(e_listidx), n1); + if (n2 < 0) { + n2 = len + n2; + } else if (n2 >= len) { + n2 = len - 1; + } + if (!empty2 && (n2 < 0 || n2 + 1 < n1)) { + n2 = -1; + } + l = tv_list_alloc(); + item = tv_list_find(rettv->vval.v_list, n1); + while (n1++ <= n2) { + tv_list_append_tv(l, &item->li_tv); + item = item->li_next; + } + tv_clear(rettv); + rettv->v_type = VAR_LIST; + rettv->vval.v_list = l; + l->lv_refcount++; + } else { + tv_copy(&tv_list_find(rettv->vval.v_list, n1)->li_tv, &var1); + tv_clear(rettv); + *rettv = var1; + } + break; + } + case VAR_DICT: { + if (range) { + if (verbose) { + emsgf(_(e_dictrange)); + } + if (len == -1) { + tv_clear(&var1); + } return FAIL; } - n1 = len; - } - if (range) { - list_T *l; - listitem_T *item; - - if (n2 < 0) - n2 = len + n2; - else if (n2 >= len) - n2 = len - 1; - if (!empty2 && (n2 < 0 || n2 + 1 < n1)) - n2 = -1; - l = list_alloc(); - item = list_find(rettv->vval.v_list, n1); - while (n1++ <= n2) { - list_append_tv(l, &item->li_tv); - item = item->li_next; - } - clear_tv(rettv); - rettv->v_type = VAR_LIST; - rettv->vval.v_list = l; - ++l->lv_refcount; - } else { - copy_tv(&list_find(rettv->vval.v_list, n1)->li_tv, &var1); - clear_tv(rettv); - *rettv = var1; - } - break; - - case VAR_DICT: - if (range) { - if (verbose) - EMSG(_(e_dictrange)); - if (len == -1) - clear_tv(&var1); - return FAIL; - } - { - dictitem_T *item; if (len == -1) { - key = get_tv_string_chk(&var1); + key = (char_u *)tv_get_string_chk(&var1); if (key == NULL) { - clear_tv(&var1); + tv_clear(&var1); return FAIL; } } - item = dict_find(rettv->vval.v_dict, key, (int)len); + dictitem_T *const item = tv_dict_find(rettv->vval.v_dict, + (const char *)key, len); - if (item == NULL && verbose) - EMSG2(_(e_dictkey), key); - if (len == -1) - clear_tv(&var1); - if (item == NULL) + if (item == NULL && verbose) { + emsgf(_(e_dictkey), key); + } + if (len == -1) { + tv_clear(&var1); + } + if (item == NULL) { return FAIL; + } - copy_tv(&item->di_tv, &var1); - clear_tv(rettv); + tv_copy(&item->di_tv, &var1); + tv_clear(rettv); *rettv = var1; + break; + } + case VAR_SPECIAL: + case VAR_FUNC: + case VAR_FLOAT: + case VAR_PARTIAL: + case VAR_UNKNOWN: { + break; // Not evaluating, skipping over subscript } - break; - case VAR_SPECIAL: - case VAR_FUNC: - case VAR_PARTIAL: - case VAR_FLOAT: - case VAR_UNKNOWN: - break; // Not evaluating, skipping over subscript } } return OK; } +// TODO(ZyX-I): move to eval/executor + /// Get an option value /// /// @param[in,out] arg Points to the '&' or '+' before the option name. Is @@ -4845,7 +4744,7 @@ static int get_string_tv(char_u **arg, typval_T *rettv, int evaluate) // Special key, e.g.: "\" case '<': - extra = trans_special((const char_u **) &p, STRLEN(p), name, true); + extra = trans_special((const char_u **)&p, STRLEN(p), name, true, true); if (extra != 0) { name += extra; break; @@ -4860,7 +4759,10 @@ static int get_string_tv(char_u **arg, typval_T *rettv, int evaluate) } *name = NUL; - *arg = p + 1; + if (*p != NUL) { // just in case + p++; + } + *arg = p; return OK; } @@ -4928,13 +4830,15 @@ char_u *partial_name(partial_T *pt) return pt->pt_func->uf_name; } +// TODO(ZyX-I): Move to eval/typval.h + static void partial_free(partial_T *pt) { for (int i = 0; i < pt->pt_argc; i++) { - clear_tv(&pt->pt_argv[i]); + tv_clear(&pt->pt_argv[i]); } xfree(pt->pt_argv); - dict_unref(pt->pt_dict); + tv_dict_unref(pt->pt_dict); if (pt->pt_name != NULL) { func_unref(pt->pt_name); xfree(pt->pt_name); @@ -4944,6 +4848,8 @@ static void partial_free(partial_T *pt) xfree(pt); } +// TODO(ZyX-I): Move to eval/typval.h + /// Unreference a closure: decrement the reference count and free it when it /// becomes zero. void partial_unref(partial_T *pt) @@ -4962,7 +4868,7 @@ static int get_list_tv(char_u **arg, typval_T *rettv, int evaluate) listitem_T *item; if (evaluate) { - l = list_alloc(); + l = tv_list_alloc(); } *arg = skipwhite(*arg + 1); @@ -4970,10 +4876,10 @@ static int get_list_tv(char_u **arg, typval_T *rettv, int evaluate) if (eval1(arg, &tv, evaluate) == FAIL) /* recursive! */ goto failret; if (evaluate) { - item = listitem_alloc(); + item = tv_list_item_alloc(); item->li_tv = tv; item->li_tv.v_lock = 0; - list_append(l, item); + tv_list_append(l, item); } if (**arg == ']') @@ -4989,7 +4895,7 @@ static int get_list_tv(char_u **arg, typval_T *rettv, int evaluate) EMSG2(_("E697: Missing end of List ']': %s"), *arg); failret: if (evaluate) { - list_free(l); + tv_list_free(l); } return FAIL; } @@ -5004,196 +4910,7 @@ failret: return OK; } -/* - * Allocate an empty header for a list. - * Caller should take care of the reference count. - */ -list_T *list_alloc(void) FUNC_ATTR_NONNULL_RET -{ - list_T *list = xcalloc(1, sizeof(list_T)); - - /* Prepend the list to the list of lists for garbage collection. */ - if (first_list != NULL) - first_list->lv_used_prev = list; - list->lv_used_prev = NULL; - list->lv_used_next = first_list; - first_list = list; - return list; -} - -/* - * Allocate an empty list for a return value. - */ -static list_T *rettv_list_alloc(typval_T *rettv) -{ - list_T *l = list_alloc(); - rettv->vval.v_list = l; - rettv->v_type = VAR_LIST; - rettv->v_lock = VAR_UNLOCKED; - l->lv_refcount++; - return l; -} - -/// Unreference a list: decrement the reference count and free it when it -/// becomes zero. -void list_unref(list_T *l) { - if (l != NULL && --l->lv_refcount <= 0) { - list_free(l); - } -} - -/// Free a list, including all items it points to. -/// Ignores the reference count. -static void list_free_contents(list_T *l) { - listitem_T *item; - - for (item = l->lv_first; item != NULL; item = l->lv_first) { - // Remove the item before deleting it. - l->lv_first = item->li_next; - clear_tv(&item->li_tv); - xfree(item); - } -} - -static void list_free_list(list_T *l) { - // Remove the list from the list of lists for garbage collection. - if (l->lv_used_prev == NULL) { - first_list = l->lv_used_next; - } else { - l->lv_used_prev->lv_used_next = l->lv_used_next; - } - if (l->lv_used_next != NULL) { - l->lv_used_next->lv_used_prev = l->lv_used_prev; - } - - xfree(l); -} - -void list_free(list_T *l) { - if (!in_free_unref_items) { - list_free_contents(l); - list_free_list(l); - } -} - -/* - * Allocate a list item. - * It is not initialized, don't forget to set v_lock. - */ -listitem_T *listitem_alloc(void) FUNC_ATTR_NONNULL_RET -{ - return xmalloc(sizeof(listitem_T)); -} - -/* - * Free a list item. Also clears the value. Does not notify watchers. - */ -void listitem_free(listitem_T *item) -{ - clear_tv(&item->li_tv); - xfree(item); -} - -/* - * Remove a list item from a List and free it. Also clears the value. - */ -void listitem_remove(list_T *l, listitem_T *item) -{ - vim_list_remove(l, item, item); - listitem_free(item); -} - -/* - * Get the number of items in a list. - */ -static long list_len(list_T *l) -{ - if (l == NULL) - return 0L; - return l->lv_len; -} - -/* - * Return TRUE when two lists have exactly the same values. - */ -static int -list_equal ( - list_T *l1, - list_T *l2, - int ic, /* ignore case for strings */ - int recursive /* TRUE when used recursively */ -) -{ - listitem_T *item1, *item2; - - if (l1 == NULL || l2 == NULL) - return FALSE; - if (l1 == l2) - return TRUE; - if (list_len(l1) != list_len(l2)) - return FALSE; - - for (item1 = l1->lv_first, item2 = l2->lv_first; - item1 != NULL && item2 != NULL; - item1 = item1->li_next, item2 = item2->li_next) - if (!tv_equal(&item1->li_tv, &item2->li_tv, ic, recursive)) - return FALSE; - return item1 == NULL && item2 == NULL; -} - -/* - * Return the dictitem that an entry in a hashtable points to. - */ -dictitem_T *dict_lookup(hashitem_T *hi) -{ - return HI2DI(hi); -} - -/* - * Return TRUE when two dictionaries have exactly the same key/values. - */ -static int -dict_equal ( - dict_T *d1, - dict_T *d2, - int ic, /* ignore case for strings */ - int recursive /* TRUE when used recursively */ -) -{ - hashitem_T *hi; - dictitem_T *item2; - int todo; - - if (d1 == NULL && d2 == NULL) { - return true; - } - if (d1 == NULL || d2 == NULL) { - return false; - } - if (d1 == d2) { - return true; - } - if (dict_len(d1) != dict_len(d2)) { - return false; - } - - todo = (int)d1->dv_hashtab.ht_used; - for (hi = d1->dv_hashtab.ht_array; todo > 0; ++hi) { - if (!HASHITEM_EMPTY(hi)) { - item2 = dict_find(d2, hi->hi_key, -1); - if (item2 == NULL) - return FALSE; - if (!tv_equal(&HI2DI(hi)->di_tv, &item2->di_tv, ic, recursive)) - return FALSE; - --todo; - } - } - return TRUE; -} - -static int tv_equal_recurse_limit; - -static bool func_equal( +bool func_equal( typval_T *tv1, typval_T *tv2, bool ic // ignore case @@ -5228,7 +4945,7 @@ static bool func_equal( if (d1 != d2) { return false; } - } else if (!dict_equal(d1, d2, ic, true)) { + } else if (!tv_dict_equal(d1, d2, ic, true)) { return false; } @@ -5247,551 +4964,6 @@ static bool func_equal( return true; } -/* - * Return TRUE if "tv1" and "tv2" have the same value. - * Compares the items just like "==" would compare them, but strings and - * numbers are different. Floats and numbers are also different. - */ -static int -tv_equal ( - typval_T *tv1, - typval_T *tv2, - int ic, /* ignore case */ - int recursive /* TRUE when used recursively */ -) -{ - char_u buf1[NUMBUFLEN], buf2[NUMBUFLEN]; - char_u *s1, *s2; - static int recursive_cnt = 0; /* catch recursive loops */ - int r; - - /* Catch lists and dicts that have an endless loop by limiting - * recursiveness to a limit. We guess they are equal then. - * A fixed limit has the problem of still taking an awful long time. - * Reduce the limit every time running into it. That should work fine for - * deeply linked structures that are not recursively linked and catch - * recursiveness quickly. */ - if (!recursive) - tv_equal_recurse_limit = 1000; - if (recursive_cnt >= tv_equal_recurse_limit) { - --tv_equal_recurse_limit; - return TRUE; - } - - // For VAR_FUNC and VAR_PARTIAL compare the function name, bound dict and - // arguments. - if ((tv1->v_type == VAR_FUNC - || (tv1->v_type == VAR_PARTIAL && tv1->vval.v_partial != NULL)) - && (tv2->v_type == VAR_FUNC - || (tv2->v_type == VAR_PARTIAL && tv2->vval.v_partial != NULL))) { - recursive_cnt++; - r = func_equal(tv1, tv2, ic); - recursive_cnt--; - return r; - } - if (tv1->v_type != tv2->v_type) { - return false; - } - - switch (tv1->v_type) { - case VAR_LIST: - ++recursive_cnt; - r = list_equal(tv1->vval.v_list, tv2->vval.v_list, ic, TRUE); - --recursive_cnt; - return r; - - case VAR_DICT: - ++recursive_cnt; - r = dict_equal(tv1->vval.v_dict, tv2->vval.v_dict, ic, TRUE); - --recursive_cnt; - return r; - - case VAR_NUMBER: - return tv1->vval.v_number == tv2->vval.v_number; - - case VAR_FLOAT: - return tv1->vval.v_float == tv2->vval.v_float; - - case VAR_STRING: - s1 = get_tv_string_buf(tv1, buf1); - s2 = get_tv_string_buf(tv2, buf2); - return (ic ? mb_stricmp(s1, s2) : STRCMP(s1, s2)) == 0; - - case VAR_SPECIAL: - return tv1->vval.v_special == tv2->vval.v_special; - - case VAR_FUNC: - case VAR_PARTIAL: - case VAR_UNKNOWN: - // VAR_UNKNOWN can be the result of an invalid expression, let’s say it does - // not equal anything, not even self. - return false; - } - - assert(false); - return false; -} - -/* - * Locate item with index "n" in list "l" and return it. - * A negative index is counted from the end; -1 is the last item. - * Returns NULL when "n" is out of range. - */ -listitem_T *list_find(list_T *l, long n) -{ - listitem_T *item; - long idx; - - if (l == NULL) - return NULL; - - /* Negative index is relative to the end. */ - if (n < 0) - n = l->lv_len + n; - - /* Check for index out of range. */ - if (n < 0 || n >= l->lv_len) - return NULL; - - /* When there is a cached index may start search from there. */ - if (l->lv_idx_item != NULL) { - if (n < l->lv_idx / 2) { - /* closest to the start of the list */ - item = l->lv_first; - idx = 0; - } else if (n > (l->lv_idx + l->lv_len) / 2) { - /* closest to the end of the list */ - item = l->lv_last; - idx = l->lv_len - 1; - } else { - /* closest to the cached index */ - item = l->lv_idx_item; - idx = l->lv_idx; - } - } else { - if (n < l->lv_len / 2) { - /* closest to the start of the list */ - item = l->lv_first; - idx = 0; - } else { - /* closest to the end of the list */ - item = l->lv_last; - idx = l->lv_len - 1; - } - } - - while (n > idx) { - /* search forward */ - item = item->li_next; - ++idx; - } - while (n < idx) { - /* search backward */ - item = item->li_prev; - --idx; - } - - /* cache the used index */ - l->lv_idx = idx; - l->lv_idx_item = item; - - return item; -} - -/* - * Get list item "l[idx]" as a number. - */ -static long -list_find_nr ( - list_T *l, - long idx, - int *errorp /* set to TRUE when something wrong */ -) -{ - listitem_T *li; - - li = list_find(l, idx); - if (li == NULL) { - if (errorp != NULL) - *errorp = TRUE; - return -1L; - } - return get_tv_number_chk(&li->li_tv, errorp); -} - -/* - * Get list item "l[idx - 1]" as a string. Returns NULL for failure. - */ -char_u *list_find_str(list_T *l, long idx) -{ - listitem_T *li; - - li = list_find(l, idx - 1); - if (li == NULL) { - EMSGN(_(e_listidx), idx); - return NULL; - } - return get_tv_string(&li->li_tv); -} - -/* - * Locate "item" list "l" and return its index. - * Returns -1 when "item" is not in the list. - */ -static long list_idx_of_item(list_T *l, listitem_T *item) -{ - long idx = 0; - listitem_T *li; - - if (l == NULL) - return -1; - idx = 0; - for (li = l->lv_first; li != NULL && li != item; li = li->li_next) - ++idx; - if (li == NULL) - return -1; - return idx; -} - -/* - * Append item "item" to the end of list "l". - */ -void list_append(list_T *l, listitem_T *item) -{ - if (l->lv_last == NULL) { - /* empty list */ - l->lv_first = item; - l->lv_last = item; - item->li_prev = NULL; - } else { - l->lv_last->li_next = item; - item->li_prev = l->lv_last; - l->lv_last = item; - } - ++l->lv_len; - item->li_next = NULL; -} - -/* - * Append typval_T "tv" to the end of list "l". - */ -void list_append_tv(list_T *l, typval_T *tv) -{ - listitem_T *li = listitem_alloc(); - copy_tv(tv, &li->li_tv); - list_append(l, li); -} - -/* - * Add a list to a list. - */ -void list_append_list(list_T *list, list_T *itemlist) -{ - listitem_T *li = listitem_alloc(); - - li->li_tv.v_type = VAR_LIST; - li->li_tv.v_lock = 0; - li->li_tv.vval.v_list = itemlist; - list_append(list, li); - ++itemlist->lv_refcount; -} - -/* - * Add a dictionary to a list. Used by getqflist(). - */ -void list_append_dict(list_T *list, dict_T *dict) -{ - listitem_T *li = listitem_alloc(); - - li->li_tv.v_type = VAR_DICT; - li->li_tv.v_lock = 0; - li->li_tv.vval.v_dict = dict; - list_append(list, li); - ++dict->dv_refcount; -} - -/// Make a copy of "str" and append it as an item to list "l" -/// -/// @param[out] l List to append to. -/// @param[in] str String to append. -/// @param[in] len Length of the appended string. May be negative, in this -/// case string is considered to be usual zero-terminated -/// string. -void list_append_string(list_T *l, const char_u *str, int len) - FUNC_ATTR_NONNULL_ARG(1) -{ - if (str == NULL) { - list_append_allocated_string(l, NULL); - } else { - list_append_allocated_string(l, (len >= 0 - ? xmemdupz((char *) str, len) - : xstrdup((char *) str))); - } -} - -/// Append given string to the list -/// -/// Unlike list_append_string this function does not copy the string. -/// -/// @param[out] l List to append to. -/// @param[in] str String to append. -void list_append_allocated_string(list_T *l, char *const str) - FUNC_ATTR_NONNULL_ARG(1) -{ - listitem_T *li = listitem_alloc(); - - list_append(l, li); - li->li_tv.v_type = VAR_STRING; - li->li_tv.v_lock = 0; - li->li_tv.vval.v_string = (char_u *) str; -} - -/* - * Append "n" to list "l". - */ -void list_append_number(list_T *l, varnumber_T n) -{ - listitem_T *li = listitem_alloc(); - li->li_tv.v_type = VAR_NUMBER; - li->li_tv.v_lock = 0; - li->li_tv.vval.v_number = n; - list_append(l, li); -} - -/* - * Insert typval_T "tv" in list "l" before "item". - * If "item" is NULL append at the end. - */ -void list_insert_tv(list_T *l, typval_T *tv, listitem_T *item) -{ - listitem_T *ni = listitem_alloc(); - - copy_tv(tv, &ni->li_tv); - list_insert(l, ni, item); -} - -void list_insert(list_T *l, listitem_T *ni, listitem_T *item) -{ - if (item == NULL) - /* Append new item at end of list. */ - list_append(l, ni); - else { - /* Insert new item before existing item. */ - ni->li_prev = item->li_prev; - ni->li_next = item; - if (item->li_prev == NULL) { - l->lv_first = ni; - ++l->lv_idx; - } else { - item->li_prev->li_next = ni; - l->lv_idx_item = NULL; - } - item->li_prev = ni; - ++l->lv_len; - } -} - -/* - * Extend "l1" with "l2". - * If "bef" is NULL append at the end, otherwise insert before this item. - */ -static void list_extend(list_T *l1, list_T *l2, listitem_T *bef) -{ - listitem_T *item; - int todo = l2->lv_len; - - /* We also quit the loop when we have inserted the original item count of - * the list, avoid a hang when we extend a list with itself. */ - for (item = l2->lv_first; item != NULL && --todo >= 0; item = item->li_next) { - list_insert_tv(l1, &item->li_tv, bef); - } -} - -/* - * Concatenate lists "l1" and "l2" into a new list, stored in "tv". - * Return FAIL on failure to copy. - */ -static int list_concat(list_T *l1, list_T *l2, typval_T *tv) -{ - list_T *l; - - if (l1 == NULL || l2 == NULL) - return FAIL; - - /* make a copy of the first list. */ - l = list_copy(NULL, l1, false, 0); - if (l == NULL) - return FAIL; - tv->v_type = VAR_LIST; - tv->vval.v_list = l; - - /* append all items from the second list */ - list_extend(l, l2, NULL); - return OK; -} - -/// Make a copy of list -/// -/// @param[in] conv If non-NULL, then all internal strings will be converted. -/// @param[in] orig Original list to copy. -/// @param[in] deep If false, then shallow copy will be done. -/// @param[in] copyID See var_item_copy(). -/// -/// @return Copied list. May be NULL in case original list is NULL or some -/// failure happens. The refcount of the new list is set to 1. -static list_T *list_copy(const vimconv_T *const conv, - list_T *const orig, - const bool deep, - const int copyID) - FUNC_ATTR_WARN_UNUSED_RESULT -{ - listitem_T *item; - listitem_T *ni; - - if (orig == NULL) - return NULL; - - list_T *copy = list_alloc(); - if (copyID != 0) { - /* Do this before adding the items, because one of the items may - * refer back to this list. */ - orig->lv_copyID = copyID; - orig->lv_copylist = copy; - } - for (item = orig->lv_first; item != NULL && !got_int; - item = item->li_next) { - ni = listitem_alloc(); - if (deep) { - if (var_item_copy(conv, &item->li_tv, &ni->li_tv, deep, copyID) == FAIL) { - xfree(ni); - break; - } - } else - copy_tv(&item->li_tv, &ni->li_tv); - list_append(copy, ni); - } - ++copy->lv_refcount; - if (item != NULL) { - list_unref(copy); - copy = NULL; - } - - return copy; -} - -/// Remove items "item" to "item2" from list "l". -/// @warning Does not free the listitem or the value! -void vim_list_remove(list_T *l, listitem_T *item, listitem_T *item2) -{ - // notify watchers - for (listitem_T *ip = item; ip != NULL; ip = ip->li_next) { - --l->lv_len; - list_fix_watch(l, ip); - if (ip == item2) { - break; - } - } - - if (item2->li_next == NULL) { - l->lv_last = item->li_prev; - } else { - item2->li_next->li_prev = item->li_prev; - } - if (item->li_prev == NULL) { - l->lv_first = item2->li_next; - } else { - item->li_prev->li_next = item2->li_next; - } - l->lv_idx_item = NULL; -} - -typedef struct join_S { - char_u *s; - char_u *tofree; -} join_T; - -/// Join list into a string, helper function -/// -/// @param[out] gap Garray where result will be saved. -/// @param[in] l List to join. -/// @param[in] sep Used separator. -/// @param[in] join_gap Garray to keep each list item string. -/// -/// @return OK in case of success, FAIL otherwise. -static int list_join_inner(garray_T *const gap, list_T *const l, - const char *const sep, garray_T *const join_gap) - FUNC_ATTR_NONNULL_ALL -{ - int sumlen = 0; - bool first = true; - listitem_T *item; - - /* Stringify each item in the list. */ - for (item = l->lv_first; item != NULL && !got_int; item = item->li_next) { - char *s; - size_t len; - s = encode_tv2echo(&item->li_tv, &len); - if (s == NULL) { - return FAIL; - } - - sumlen += (int) len; - - join_T *const p = GA_APPEND_VIA_PTR(join_T, join_gap); - p->tofree = p->s = (char_u *) s; - - line_breakcheck(); - } - - /* Allocate result buffer with its total size, avoid re-allocation and - * multiple copy operations. Add 2 for a tailing ']' and NUL. */ - if (join_gap->ga_len >= 2) - sumlen += (int)STRLEN(sep) * (join_gap->ga_len - 1); - ga_grow(gap, sumlen + 2); - - for (int i = 0; i < join_gap->ga_len && !got_int; ++i) { - if (first) { - first = false; - } else { - ga_concat(gap, (const char_u *) sep); - } - const join_T *const p = ((const join_T *)join_gap->ga_data) + i; - - if (p->s != NULL) - ga_concat(gap, p->s); - line_breakcheck(); - } - - return OK; -} - -/// Join list into a string using given separator -/// -/// @param[out] gap Garray where result will be saved. -/// @param[in] l Joined list. -/// @param[in] sep Separator. -/// -/// @return OK in case of success, FAIL otherwise. -static int list_join(garray_T *const gap, list_T *const l, - const char *const sep) - FUNC_ATTR_NONNULL_ALL -{ - if (l->lv_len < 1) { - return OK; - } - - garray_T join_ga; - int retval; - - ga_init(&join_ga, (int)sizeof(join_T), l->lv_len); - retval = list_join_inner(gap, l, sep, &join_ga); - -# define FREE_JOIN_TOFREE(join) xfree((join)->tofree) - GA_DEEP_CLEAR(&join_ga, join_T, FREE_JOIN_TOFREE); - - return retval; -} - /// Get next (unique) copy ID /// /// Used for traversing nested structures e.g. when serializing them or garbage @@ -5904,7 +5076,8 @@ bool garbage_collect(bool testing) do { yankreg_T reg; char name = NUL; - reg_iter = op_register_iter(reg_iter, &name, ®); + bool is_unnamed = false; + reg_iter = op_register_iter(reg_iter, &name, ®, &is_unnamed); if (name != NUL) { ABORTING(set_ref_dict)(reg.additional_data, copyID); } @@ -5942,12 +5115,12 @@ bool garbage_collect(bool testing) // named functions (matters for closures) ABORTING(set_ref_in_functions(copyID)); - // Jobs + // Channels { - TerminalJobData *data; - map_foreach_value(jobs, data, { - set_ref_in_callback(&data->on_stdout, copyID, NULL, NULL); - set_ref_in_callback(&data->on_stderr, copyID, NULL, NULL); + Channel *data; + map_foreach_value(channels, data, { + set_ref_in_callback_reader(&data->on_stdout, copyID, NULL, NULL); + set_ref_in_callback_reader(&data->on_stderr, copyID, NULL, NULL); set_ref_in_callback(&data->on_exit, copyID, NULL, NULL); }) } @@ -6032,7 +5205,7 @@ bool garbage_collect(bool testing) /// Free lists and dictionaries that are no longer referenced. /// -/// Note: This function may only be called from garbage_collect(). +/// @note This function may only be called from garbage_collect(). /// /// @param copyID Free lists/dictionaries that don't have this ID. /// @return true, if something was freed. @@ -6045,19 +5218,19 @@ static int free_unref_items(int copyID) // Let all "free" functions know that we are here. This means no // dictionaries, lists, or jobs are to be freed, because we will // do that here. - in_free_unref_items = true; + tv_in_free_unref_items = true; // PASS 1: free the contents of the items. We don't free the items // themselves yet, so that it is possible to decrement refcount counters. // Go through the list of dicts and free items without the copyID. // Don't free dicts that are referenced internally. - for (dict_T *dd = first_dict; dd != NULL; dd = dd->dv_used_next) { + for (dict_T *dd = gc_first_dict; dd != NULL; dd = dd->dv_used_next) { if ((dd->dv_copyID & COPYID_MASK) != (copyID & COPYID_MASK)) { // Free the Dictionary and ordinary items it contains, but don't // recurse into Lists and Dictionaries, they will be in the list // of dicts or list of lists. - dict_free_contents(dd); + tv_dict_free_contents(dd); did_free = true; } } @@ -6065,36 +5238,36 @@ static int free_unref_items(int copyID) // Go through the list of lists and free items without the copyID. // But don't free a list that has a watcher (used in a for loop), these // are not referenced anywhere. - for (list_T *ll = first_list; ll != NULL; ll = ll->lv_used_next) { + for (list_T *ll = gc_first_list; ll != NULL; ll = ll->lv_used_next) { if ((ll->lv_copyID & COPYID_MASK) != (copyID & COPYID_MASK) && ll->lv_watch == NULL) { // Free the List and ordinary items it contains, but don't recurse // into Lists and Dictionaries, they will be in the list of dicts // or list of lists. - list_free_contents(ll); + tv_list_free_contents(ll); did_free = true; } } // PASS 2: free the items themselves. - for (dd = first_dict; dd != NULL; dd = dd_next) { + for (dd = gc_first_dict; dd != NULL; dd = dd_next) { dd_next = dd->dv_used_next; if ((dd->dv_copyID & COPYID_MASK) != (copyID & COPYID_MASK)) { - dict_free_dict(dd); + tv_dict_free_dict(dd); } } - for (ll = first_list; ll != NULL; ll = ll_next) { + for (ll = gc_first_list; ll != NULL; ll = ll_next) { ll_next = ll->lv_used_next; if ((ll->lv_copyID & COPYID_MASK) != (copyID & COPYID_MASK) && ll->lv_watch == NULL) { // Free the List and ordinary items it contains, but don't recurse // into Lists and Dictionaries, they will be in the list of dicts // or list of lists. - list_free_list(ll); + tv_list_free_list(ll); } } - in_free_unref_items = false; + tv_in_free_unref_items = false; return did_free; } @@ -6117,14 +5290,10 @@ bool set_ref_in_ht(hashtab_T *ht, int copyID, list_stack_T **list_stack) // Mark each item in the hashtab. If the item contains a hashtab // it is added to ht_stack, if it contains a list it is added to // list_stack. - int todo = (int)cur_ht->ht_used; - for (hashitem_T *hi = cur_ht->ht_array; todo > 0; ++hi) { - if (!HASHITEM_EMPTY(hi)) { - --todo; - abort = abort || set_ref_in_item(&HI2DI(hi)->di_tv, copyID, &ht_stack, - list_stack); - } - } + HASHTAB_ITER(cur_ht, hi, { + abort = abort || set_ref_in_item( + &TV_DICT_HI2DI(hi)->di_tv, copyID, &ht_stack, list_stack); + }); } if (ht_stack == NULL) { @@ -6216,7 +5385,7 @@ bool set_ref_in_item(typval_T *tv, int copyID, ht_stack_T **ht_stack, QUEUE *w = NULL; DictWatcher *watcher = NULL; QUEUE_FOREACH(w, &dd->watchers) { - watcher = dictwatcher_node_data(w); + watcher = tv_dict_watcher_node_data(w); set_ref_in_callback(&watcher->callback, copyID, ht_stack, list_stack); } } @@ -6361,447 +5530,6 @@ static bool set_ref_in_funccal(funccall_T *fc, int copyID) return abort; } -/// Allocate an empty header for a dictionary. -dict_T *dict_alloc(void) FUNC_ATTR_NONNULL_RET -{ - dict_T *d = xmalloc(sizeof(dict_T)); - - /* Add the dict to the list of dicts for garbage collection. */ - if (first_dict != NULL) - first_dict->dv_used_prev = d; - d->dv_used_next = first_dict; - d->dv_used_prev = NULL; - first_dict = d; - - hash_init(&d->dv_hashtab); - d->dv_lock = VAR_UNLOCKED; - d->dv_scope = 0; - d->dv_refcount = 0; - d->dv_copyID = 0; - QUEUE_INIT(&d->watchers); - - return d; -} - -/* - * Allocate an empty dict for a return value. - */ -static void rettv_dict_alloc(typval_T *rettv) -{ - dict_T *d = dict_alloc(); - - rettv->vval.v_dict = d; - rettv->v_type = VAR_DICT; - rettv->v_lock = VAR_UNLOCKED; - d->dv_refcount++; -} - -/// Clear all the keys of a Dictionary. "d" remains a valid empty Dictionary. -/// -/// @param d The Dictionary to clear -void dict_clear(dict_T *d) - FUNC_ATTR_NONNULL_ALL -{ - hash_lock(&d->dv_hashtab); - assert(d->dv_hashtab.ht_locked > 0); - - size_t todo = d->dv_hashtab.ht_used; - for (hashitem_T *hi = d->dv_hashtab.ht_array; todo > 0; hi++) { - if (!HASHITEM_EMPTY(hi)) { - dictitem_free(HI2DI(hi)); - hash_remove(&d->dv_hashtab, hi); - todo--; - } - } - - hash_unlock(&d->dv_hashtab); -} - - -/* - * Unreference a Dictionary: decrement the reference count and free it when it - * becomes zero. - */ -void dict_unref(dict_T *d) -{ - if (d != NULL && --d->dv_refcount <= 0) { - dict_free(d); - } -} - -/// Free a Dictionary, including all items it contains. -/// Ignores the reference count. -static void dict_free_contents(dict_T *d) { - int todo; - hashitem_T *hi; - dictitem_T *di; - - - /* Lock the hashtab, we don't want it to resize while freeing items. */ - hash_lock(&d->dv_hashtab); - assert(d->dv_hashtab.ht_locked > 0); - todo = (int)d->dv_hashtab.ht_used; - for (hi = d->dv_hashtab.ht_array; todo > 0; ++hi) { - if (!HASHITEM_EMPTY(hi)) { - /* Remove the item before deleting it, just in case there is - * something recursive causing trouble. */ - di = HI2DI(hi); - hash_remove(&d->dv_hashtab, hi); - dictitem_free(di); - todo--; - } - } - - while (!QUEUE_EMPTY(&d->watchers)) { - QUEUE *w = QUEUE_HEAD(&d->watchers); - DictWatcher *watcher = dictwatcher_node_data(w); - QUEUE_REMOVE(w); - dictwatcher_free(watcher); - } - - hash_clear(&d->dv_hashtab); -} - -static void dict_free_dict(dict_T *d) { - // Remove the dict from the list of dicts for garbage collection. - if (d->dv_used_prev == NULL) { - first_dict = d->dv_used_next; - } else { - d->dv_used_prev->dv_used_next = d->dv_used_next; - } - if (d->dv_used_next != NULL) { - d->dv_used_next->dv_used_prev = d->dv_used_prev; - } - - xfree(d); -} - -void dict_free(dict_T *d) { - if (!in_free_unref_items) { - dict_free_contents(d); - dict_free_dict(d); - } -} - -/* - * Allocate a Dictionary item. - * The "key" is copied to the new item. - * Note that the value of the item "di_tv" still needs to be initialized! - */ -dictitem_T *dictitem_alloc(char_u *key) FUNC_ATTR_NONNULL_RET -{ - dictitem_T *di = xmalloc(offsetof(dictitem_T, di_key) + STRLEN(key) + 1); -#ifndef __clang_analyzer__ - STRCPY(di->di_key, key); -#endif - di->di_flags = DI_FLAGS_ALLOC; - return di; -} - -/* - * Make a copy of a Dictionary item. - */ -static dictitem_T *dictitem_copy(dictitem_T *org) FUNC_ATTR_NONNULL_RET -{ - dictitem_T *di = xmalloc(sizeof(dictitem_T) + STRLEN(org->di_key)); - - STRCPY(di->di_key, org->di_key); - di->di_flags = DI_FLAGS_ALLOC; - copy_tv(&org->di_tv, &di->di_tv); - - return di; -} - -/* - * Remove item "item" from Dictionary "dict" and free it. - */ -static void dictitem_remove(dict_T *dict, dictitem_T *item) -{ - hashitem_T *hi; - - hi = hash_find(&dict->dv_hashtab, item->di_key); - if (HASHITEM_EMPTY(hi)) { - EMSG2(_(e_intern2), "dictitem_remove()"); - } else { - hash_remove(&dict->dv_hashtab, hi); - } - dictitem_free(item); -} - -/* - * Free a dict item. Also clears the value. - */ -void dictitem_free(dictitem_T *item) -{ - clear_tv(&item->di_tv); - if (item->di_flags & DI_FLAGS_ALLOC) { - xfree(item); - } -} - -/// Make a copy of dictionary -/// -/// @param[in] conv If non-NULL, then all internal strings will be converted. -/// @param[in] orig Original dictionary to copy. -/// @param[in] deep If false, then shallow copy will be done. -/// @param[in] copyID See var_item_copy(). -/// -/// @return Copied dictionary. May be NULL in case original dictionary is NULL -/// or some failure happens. The refcount of the new dictionary is set -/// to 1. -static dict_T *dict_copy(const vimconv_T *const conv, - dict_T *const orig, - const bool deep, - const int copyID) -{ - dictitem_T *di; - int todo; - hashitem_T *hi; - - if (orig == NULL) - return NULL; - - dict_T *copy = dict_alloc(); - { - if (copyID != 0) { - orig->dv_copyID = copyID; - orig->dv_copydict = copy; - } - todo = (int)orig->dv_hashtab.ht_used; - for (hi = orig->dv_hashtab.ht_array; todo > 0 && !got_int; ++hi) { - if (!HASHITEM_EMPTY(hi)) { - --todo; - - if (conv == NULL || conv->vc_type == CONV_NONE) { - di = dictitem_alloc(hi->hi_key); - } else { - char *const key = (char *) string_convert((vimconv_T *) conv, - hi->hi_key, NULL); - if (key == NULL) { - di = dictitem_alloc(hi->hi_key); - } else { - di = dictitem_alloc((char_u *) key); - xfree(key); - } - } - if (deep) { - if (var_item_copy(conv, &HI2DI(hi)->di_tv, &di->di_tv, deep, - copyID) == FAIL) { - xfree(di); - break; - } - } else - copy_tv(&HI2DI(hi)->di_tv, &di->di_tv); - if (dict_add(copy, di) == FAIL) { - dictitem_free(di); - break; - } - } - } - - ++copy->dv_refcount; - if (todo > 0) { - dict_unref(copy); - copy = NULL; - } - } - - return copy; -} - -/* - * Add item "item" to Dictionary "d". - * Returns FAIL when key already exists. - */ -int dict_add(dict_T *d, dictitem_T *item) -{ - return hash_add(&d->dv_hashtab, item->di_key); -} - -/* - * Add a number or string entry to dictionary "d". - * When "str" is NULL use number "nr", otherwise use "str". - * Returns FAIL when key already exists. - */ -int dict_add_nr_str(dict_T *d, char *key, long nr, char_u *str) -{ - dictitem_T *item; - - item = dictitem_alloc((char_u *)key); - item->di_tv.v_lock = 0; - if (str == NULL) { - item->di_tv.v_type = VAR_NUMBER; - item->di_tv.vval.v_number = nr; - } else { - item->di_tv.v_type = VAR_STRING; - item->di_tv.vval.v_string = vim_strsave(str); - } - if (dict_add(d, item) == FAIL) { - dictitem_free(item); - return FAIL; - } - return OK; -} - -/* - * Add a list entry to dictionary "d". - * Returns FAIL when key already exists. - */ -int dict_add_list(dict_T *d, char *key, list_T *list) -{ - dictitem_T *item = dictitem_alloc((char_u *)key); - - item->di_tv.v_lock = 0; - item->di_tv.v_type = VAR_LIST; - item->di_tv.vval.v_list = list; - if (dict_add(d, item) == FAIL) { - dictitem_free(item); - return FAIL; - } - ++list->lv_refcount; - return OK; -} - -/// Add a dict entry to dictionary "d". -/// Returns FAIL when out of memory and when key already exists. -int dict_add_dict(dict_T *d, char *key, dict_T *dict) -{ - dictitem_T *item = dictitem_alloc((char_u *)key); - - item->di_tv.v_lock = 0; - item->di_tv.v_type = VAR_DICT; - item->di_tv.vval.v_dict = dict; - if (dict_add(d, item) == FAIL) { - dictitem_free(item); - return FAIL; - } - dict->dv_refcount++; - return OK; -} - -/// Set all existing keys in "dict" as read-only. -/// -/// This does not protect against adding new keys to the Dictionary. -/// -/// @param dict The dict whose keys should be frozen -void dict_set_keys_readonly(dict_T *dict) - FUNC_ATTR_NONNULL_ALL -{ - size_t todo = dict->dv_hashtab.ht_used; - for (hashitem_T *hi = dict->dv_hashtab.ht_array; todo > 0 ; hi++) { - if (HASHITEM_EMPTY(hi)) { - continue; - } - todo--; - HI2DI(hi)->di_flags |= DI_FLAGS_RO | DI_FLAGS_FIX; - } -} - -/* - * Get the number of items in a Dictionary. - */ -static long dict_len(dict_T *d) -{ - if (d == NULL) - return 0L; - return (long)d->dv_hashtab.ht_used; -} - -/* - * Find item "key[len]" in Dictionary "d". - * If "len" is negative use strlen(key). - * Returns NULL when not found. - */ -dictitem_T *dict_find(dict_T *d, char_u *key, int len) -{ -#define AKEYLEN 200 - char_u buf[AKEYLEN]; - char_u *akey; - char_u *tofree = NULL; - hashitem_T *hi; - - if (d == NULL) { - return NULL; - } - if (len < 0) { - akey = key; - } else if (len >= AKEYLEN) { - tofree = akey = vim_strnsave(key, len); - } else { - /* Avoid a malloc/free by using buf[]. */ - STRLCPY(buf, key, len + 1); - akey = buf; - } - - hi = hash_find(&d->dv_hashtab, akey); - xfree(tofree); - if (HASHITEM_EMPTY(hi)) - return NULL; - return HI2DI(hi); -} - -/// Get a function from a dictionary -/// @param[out] result The address where a pointer to the wanted callback -/// will be left. -/// @return true/false on success/failure. -static bool get_dict_callback(dict_T *d, char *key, Callback *result) -{ - dictitem_T *di = dict_find(d, (uint8_t *)key, -1); - - if (di == NULL) { - result->type = kCallbackNone; - return true; - } - - if (di->di_tv.v_type != VAR_FUNC && di->di_tv.v_type != VAR_STRING - && di->di_tv.v_type != VAR_PARTIAL) { - EMSG(_("Argument is not a function or function name")); - result->type = kCallbackNone; - return false; - } - - typval_T tv; - copy_tv(&di->di_tv, &tv); - set_selfdict(&tv, d); - bool res = callback_from_typval(result, &tv); - clear_tv(&tv); - return res; -} - -/// Get a string item from a dictionary. -/// -/// @param save whether memory should be allocated for the return value -/// when false a shared buffer is used, can only be used once! -/// -/// @return the entry or NULL if the entry doesn't exist. -char_u *get_dict_string(dict_T *d, char *key, bool save) -{ - dictitem_T *di; - char_u *s; - - di = dict_find(d, (char_u *)key, -1); - if (di == NULL) { - return NULL; - } - s = get_tv_string(&di->di_tv); - if (save) { - s = vim_strsave(s); - } - return s; -} - -/// Get a number item from a dictionary. -/// -/// @return the entry or 0 if the entry doesn't exist. -long get_dict_number(dict_T *d, char *key) -{ - dictitem_T *di = dict_find(d, (char_u *)key, -1); - if (di == NULL) { - return 0; - } - return get_tv_number(&di->di_tv); -} - /* * Allocate a variable for a Dictionary and fill it from "*arg". * Return OK or FAIL. Returns NOTDONE for {expr}. @@ -6814,7 +5542,7 @@ static int get_dict_tv(char_u **arg, typval_T *rettv, int evaluate) char_u *key = NULL; dictitem_T *item; char_u *start = skipwhite(*arg + 1); - char_u buf[NUMBUFLEN]; + char buf[NUMBUFLEN]; /* * First check if it's not a curly-braces thing: {expr}. @@ -6831,7 +5559,7 @@ static int get_dict_tv(char_u **arg, typval_T *rettv, int evaluate) } if (evaluate) { - d = dict_alloc(); + d = tv_dict_alloc(); } tvkey.v_type = VAR_UNKNOWN; tv.v_type = VAR_UNKNOWN; @@ -6842,38 +5570,39 @@ static int get_dict_tv(char_u **arg, typval_T *rettv, int evaluate) goto failret; if (**arg != ':') { EMSG2(_("E720: Missing colon in Dictionary: %s"), *arg); - clear_tv(&tvkey); + tv_clear(&tvkey); goto failret; } if (evaluate) { - key = get_tv_string_buf_chk(&tvkey, buf); + key = (char_u *)tv_get_string_buf_chk(&tvkey, buf); if (key == NULL) { - // "key" is NULL when get_tv_string_buf_chk() gave an errmsg - clear_tv(&tvkey); + // "key" is NULL when tv_get_string_buf_chk() gave an errmsg + tv_clear(&tvkey); goto failret; } } *arg = skipwhite(*arg + 1); - if (eval1(arg, &tv, evaluate) == FAIL) { /* recursive! */ - if (evaluate) - clear_tv(&tvkey); + if (eval1(arg, &tv, evaluate) == FAIL) { // Recursive! + if (evaluate) { + tv_clear(&tvkey); + } goto failret; } if (evaluate) { - item = dict_find(d, key, -1); + item = tv_dict_find(d, (const char *)key, -1); if (item != NULL) { EMSG2(_("E721: Duplicate key in Dictionary: \"%s\""), key); - clear_tv(&tvkey); - clear_tv(&tv); + tv_clear(&tvkey); + tv_clear(&tv); goto failret; } - item = dictitem_alloc(key); - clear_tv(&tvkey); + item = tv_dict_item_alloc((const char *)key); + tv_clear(&tvkey); item->di_tv = tv; item->di_tv.v_lock = 0; - if (dict_add(d, item) == FAIL) { - dictitem_free(item); + if (tv_dict_add(d, item) == FAIL) { + tv_dict_item_free(item); } } @@ -6890,7 +5619,7 @@ static int get_dict_tv(char_u **arg, typval_T *rettv, int evaluate) EMSG2(_("E723: Missing end of Dictionary '}': %s"), *arg); failret: if (evaluate) { - dict_free(d); + tv_dict_free(d); } return FAIL; } @@ -6949,10 +5678,6 @@ static int get_function_args(char_u **argp, char_u endchar, garray_T *newargs, c = *p; *p = NUL; arg = vim_strsave(arg); - if (arg == NULL) { - *p = c; - goto err_ret; - } // Check for duplicate argument name. for (i = 0; i < newargs->ga_len; i++) { @@ -7076,10 +5801,6 @@ static int get_lambda_tv(char_u **arg, typval_T *rettv, bool evaluate) fp = (ufunc_T *)xcalloc(1, sizeof(ufunc_T) + STRLEN(name)); pt = (partial_T *)xcalloc(1, sizeof(partial_T)); - if (pt == NULL) { - xfree(fp); - goto errret; - } ga_init(&newlines, (int)sizeof(char_u *), 1); ga_grow(&newlines, 1); @@ -7145,6 +5866,19 @@ size_t string2float(const char *const text, float_T *const ret_value) { char *s = NULL; + // MS-Windows does not deal with "inf" and "nan" properly + if (STRNICMP(text, "inf", 3) == 0) { + *ret_value = INFINITY; + return 3; + } + if (STRNICMP(text, "-inf", 3) == 0) { + *ret_value = -INFINITY; + return 4; + } + if (STRNICMP(text, "nan", 3) == 0) { + *ret_value = NAN; + return 3; + } *ret_value = strtod(text, &s); return (size_t) (s - text); } @@ -7165,7 +5899,7 @@ static int get_env_tv(char_u **arg, typval_T *rettv, int evaluate) ++*arg; name = *arg; - len = get_env_len(arg); + len = get_env_len((const char_u **)arg); if (evaluate) { if (len == 0) { @@ -7258,7 +5992,7 @@ char_u *get_expr_name(expand_T *xp, int idx) /// @param[in] name Name of the function. /// /// Returns pointer to the function definition or NULL if not found. -static VimLFuncDef *find_internal_func(const char *const name) +static const VimLFuncDef *find_internal_func(const char *const name) FUNC_ATTR_WARN_UNUSED_RESULT FUNC_ATTR_PURE FUNC_ATTR_NONNULL_ALL { size_t len = strlen(name); @@ -7388,8 +6122,9 @@ get_func_tv ( } } - while (--argcount >= 0) - clear_tv(&argvars[argcount]); + while (--argcount >= 0) { + tv_clear(&argvars[argcount]); + } *arg = skipwhite(argp); return ret; @@ -7451,13 +6186,9 @@ static char_u *fname_trans_sid(const char_u *const name, fname = fname_buf; } else { fname = xmalloc(i + STRLEN(name + llen) + 1); - if (fname == NULL) { - *error = ERROR_OTHER; - } else { - *tofree = fname; - memmove(fname, fname_buf, (size_t)i); - STRCPY(fname + i, name + llen); - } + *tofree = fname; + memmove(fname, fname_buf, (size_t)i); + STRCPY(fname + i, name + llen); } } else { fname = (char_u *)name; @@ -7507,7 +6238,7 @@ bool set_ref_in_func(char_u *name, ufunc_T *fp_in, int copyID) /// Also returns OK when an error was encountered while executing the function. int call_func( - char_u *funcname, // name of the function + const char_u *funcname, // name of the function int len, // length of "name" typval_T *rettv, // return value goes here int argcount_in, // number of "argvars" @@ -7538,9 +6269,6 @@ call_func( // Make a copy of the name, if it comes from a funcref variable it could // be changed or deleted in the called function. name = vim_strnsave(funcname, len); - if (name == NULL) { - return ret; - } fname = fname_trans_sid(name, fname_buf, &tofree, &error); @@ -7556,7 +6284,7 @@ call_func( } if (error == ERROR_NONE && partial->pt_argc > 0) { for (argv_clear = 0; argv_clear < partial->pt_argc; argv_clear++) { - copy_tv(&partial->pt_argv[argv_clear], &argv[argv_clear]); + tv_copy(&partial->pt_argv[argv_clear], &argv[argv_clear]); } for (int i = 0; i < argcount_in; i++) { argv[i + argv_clear] = argvars_in[i]; @@ -7626,7 +6354,7 @@ call_func( } } else { // Find the function name in the table, call its implementation. - VimLFuncDef *const fdef = find_internal_func((const char *)fname); + const VimLFuncDef *const fdef = find_internal_func((const char *)fname); if (fdef != NULL) { if (argcount < fdef->min_argc) { error = ERROR_TOOFEW; @@ -7685,7 +6413,7 @@ call_func( } while (argv_clear > 0) { - clear_tv(&argv[--argv_clear]); + tv_clear(&argv[--argv_clear]); } xfree(tofree); xfree(name); @@ -7729,24 +6457,6 @@ static int non_zero_arg(typval_T *argvars) */ -/* - * Get the float value of "argvars[0]" into "f". - * Returns FAIL when the argument is not a Number or Float. - */ -static inline int get_float_arg(typval_T *argvars, float_T *f) -{ - if (argvars[0].v_type == VAR_FLOAT) { - *f = argvars[0].vval.v_float; - return OK; - } - if (argvars[0].v_type == VAR_NUMBER) { - *f = (float_T)argvars[0].vval.v_number; - return OK; - } - EMSG(_("E808: Number or Float required")); - return FAIL; -} - // Apply a floating point C function on a typval with one float_T. // // Some versions of glibc on i386 have an optimization that makes it harder to @@ -7758,7 +6468,7 @@ static void float_op_wrapper(typval_T *argvars, typval_T *rettv, FunPtr fptr) float_T (*function)(float_T) = (float_T (*)(float_T))fptr; rettv->v_type = VAR_FLOAT; - if (get_float_arg(argvars, &f) == OK) { + if (tv_get_float_chk(argvars, &f)) { rettv->vval.v_float = function(f); } else { rettv->vval.v_float = 0.0; @@ -7776,9 +6486,9 @@ static void api_wrapper(typval_T *argvars, typval_T *rettv, FunPtr fptr) } Error err = ERROR_INIT; - Object result = fn(INTERNAL_CALL, args, &err); + Object result = fn(VIML_INTERNAL_CALL, args, &err); - if (err.set) { + if (ERROR_SET(&err)) { nvim_err_writeln(cstr_as_string(err.msg)); goto end; } @@ -7790,6 +6500,7 @@ static void api_wrapper(typval_T *argvars, typval_T *rettv, FunPtr fptr) end: api_free_array(args); api_free_object(result); + api_clear_error(&err); } /* @@ -7801,15 +6512,16 @@ static void f_abs(typval_T *argvars, typval_T *rettv, FunPtr fptr) float_op_wrapper(argvars, rettv, (FunPtr)&fabs); } else { varnumber_T n; - int error = FALSE; + bool error = false; - n = get_tv_number_chk(&argvars[0], &error); - if (error) + n = tv_get_number_chk(&argvars[0], &error); + if (error) { rettv->vval.v_number = -1; - else if (n > 0) + } else if (n > 0) { rettv->vval.v_number = n; - else + } else { rettv->vval.v_number = -n; + } } } @@ -7822,15 +6534,14 @@ static void f_add(typval_T *argvars, typval_T *rettv, FunPtr fptr) rettv->vval.v_number = 1; /* Default: Failed */ if (argvars[0].v_type == VAR_LIST) { - const char *const arg_errmsg = _("add() argument"); - const size_t arg_errmsg_len = strlen(arg_errmsg); if ((l = argvars[0].vval.v_list) != NULL - && !tv_check_lock(l->lv_lock, arg_errmsg, arg_errmsg_len)) { - list_append_tv(l, &argvars[1]); - copy_tv(&argvars[0], rettv); + && !tv_check_lock(l->lv_lock, "add() argument", TV_TRANSLATE)) { + tv_list_append_tv(l, &argvars[1]); + tv_copy(&argvars[0], rettv); } - } else + } else { EMSG(_(e_listreq)); + } } /* @@ -7838,8 +6549,8 @@ static void f_add(typval_T *argvars, typval_T *rettv, FunPtr fptr) */ static void f_and(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - rettv->vval.v_number = get_tv_number_chk(&argvars[0], NULL) - & get_tv_number_chk(&argvars[1], NULL); + rettv->vval.v_number = tv_get_number_chk(&argvars[0], NULL) + & tv_get_number_chk(&argvars[1], NULL); } @@ -7857,7 +6568,6 @@ static void f_api_info(typval_T *argvars, typval_T *rettv, FunPtr fptr) static void f_append(typval_T *argvars, typval_T *rettv, FunPtr fptr) { long lnum; - char_u *line; list_T *l = NULL; listitem_T *li = NULL; typval_T *tv; @@ -7870,7 +6580,7 @@ static void f_append(typval_T *argvars, typval_T *rettv, FunPtr fptr) u_sync(TRUE); } - lnum = get_tv_lnum(argvars); + lnum = tv_get_lnum(argvars); if (lnum >= 0 && lnum <= curbuf->b_ml.ml_line_count && u_save(lnum, lnum + 1) == OK) { @@ -7881,21 +6591,23 @@ static void f_append(typval_T *argvars, typval_T *rettv, FunPtr fptr) li = l->lv_first; } for (;; ) { - if (l == NULL) - tv = &argvars[1]; /* append a string */ - else if (li == NULL) - break; /* end of list */ - else - tv = &li->li_tv; /* append item from list */ - line = get_tv_string_chk(tv); - if (line == NULL) { /* type error */ - rettv->vval.v_number = 1; /* Failed */ + if (l == NULL) { + tv = &argvars[1]; // Append a string. + } else if (li == NULL) { + break; // End of list. + } else { + tv = &li->li_tv; // Append item from list. + } + const char *const line = tv_get_string_chk(tv); + if (line == NULL) { // Type error. + rettv->vval.v_number = 1; // Failed. break; } - ml_append(lnum + added, line, (colnr_T)0, FALSE); - ++added; - if (l == NULL) + ml_append(lnum + added, (char_u *)line, (colnr_T)0, false); + added++; + if (l == NULL) { break; + } li = li->li_next; } @@ -7940,16 +6652,19 @@ static void f_argv(typval_T *argvars, typval_T *rettv, FunPtr fptr) int idx; if (argvars[0].v_type != VAR_UNKNOWN) { - idx = get_tv_number_chk(&argvars[0], NULL); - if (idx >= 0 && idx < ARGCOUNT) - rettv->vval.v_string = vim_strsave(alist_name(&ARGLIST[idx])); - else + idx = (int)tv_get_number_chk(&argvars[0], NULL); + if (idx >= 0 && idx < ARGCOUNT) { + rettv->vval.v_string = (char_u *)xstrdup( + (const char *)alist_name(&ARGLIST[idx])); + } else { rettv->vval.v_string = NULL; + } rettv->v_type = VAR_STRING; } else { - rettv_list_alloc(rettv); - for (idx = 0; idx < ARGCOUNT; ++idx) { - list_append_string(rettv->vval.v_list, alist_name(&ARGLIST[idx]), -1); + tv_list_alloc_ret(rettv); + for (idx = 0; idx < ARGCOUNT; idx++) { + tv_list_append_string(rettv->vval.v_list, + (const char *)alist_name(&ARGLIST[idx]), -1); } } } @@ -7975,6 +6690,39 @@ static void prepare_assert_error(garray_T *gap) } } +// Append "str" to "gap", escaping unprintable characters. +// Changes NL to \n, CR to \r, etc. +static void ga_concat_esc(garray_T *gap, char_u *str) +{ + char_u *p; + char_u buf[NUMBUFLEN]; + + if (str == NULL) { + ga_concat(gap, (char_u *)"NULL"); + return; + } + + for (p = str; *p != NUL; p++) { + switch (*p) { + case BS: ga_concat(gap, (char_u *)"\\b"); break; + case ESC: ga_concat(gap, (char_u *)"\\e"); break; + case FF: ga_concat(gap, (char_u *)"\\f"); break; + case NL: ga_concat(gap, (char_u *)"\\n"); break; + case TAB: ga_concat(gap, (char_u *)"\\t"); break; + case CAR: ga_concat(gap, (char_u *)"\\r"); break; + case '\\': ga_concat(gap, (char_u *)"\\\\"); break; + default: + if (*p < ' ') { + vim_snprintf((char *)buf, NUMBUFLEN, "\\x%02x", *p); + ga_concat(gap, buf); + } else { + ga_append(gap, *p); + } + break; + } + } +} + // Fill "gap" with information about an assert error. static void fill_assert_error(garray_T *gap, typval_T *opt_msg_tv, char_u *exp_str, typval_T *exp_tv, @@ -7989,28 +6737,30 @@ static void fill_assert_error(garray_T *gap, typval_T *opt_msg_tv, } else { if (atype == ASSERT_MATCH || atype == ASSERT_NOTMATCH) { ga_concat(gap, (char_u *)"Pattern "); + } else if (atype == ASSERT_NOTEQUAL) { + ga_concat(gap, (char_u *)"Expected not equal to "); } else { ga_concat(gap, (char_u *)"Expected "); } if (exp_str == NULL) { - tofree = (char_u *) encode_tv2string(exp_tv, NULL); - ga_concat(gap, tofree); + tofree = (char_u *)encode_tv2string(exp_tv, NULL); + ga_concat_esc(gap, tofree); xfree(tofree); } else { - ga_concat(gap, exp_str); + ga_concat_esc(gap, exp_str); } - tofree = (char_u *)encode_tv2string(got_tv, NULL); - if (atype == ASSERT_MATCH) { - ga_concat(gap, (char_u *)" does not match "); - } else if (atype == ASSERT_NOTMATCH) { - ga_concat(gap, (char_u *)" does match "); - } else if (atype == ASSERT_NOTEQUAL) { - ga_concat(gap, (char_u *)" differs from "); - } else { - ga_concat(gap, (char_u *)" but got "); + if (atype != ASSERT_NOTEQUAL) { + if (atype == ASSERT_MATCH) { + ga_concat(gap, (char_u *)" does not match "); + } else if (atype == ASSERT_NOTMATCH) { + ga_concat(gap, (char_u *)" does match "); + } else { + ga_concat(gap, (char_u *)" but got "); + } + tofree = (char_u *)encode_tv2string(got_tv, NULL); + ga_concat_esc(gap, tofree); + xfree(tofree); } - ga_concat(gap, tofree); - xfree(tofree); } } @@ -8021,10 +6771,10 @@ static void assert_error(garray_T *gap) if (vp->vv_type != VAR_LIST || vimvars[VV_ERRORS].vv_list == NULL) { // Make sure v:errors is a list. - set_vim_var_list(VV_ERRORS, list_alloc()); + set_vim_var_list(VV_ERRORS, tv_list_alloc()); } - list_append_string(vimvars[VV_ERRORS].vv_list, - gap->ga_data, gap->ga_len); + tv_list_append_string(vimvars[VV_ERRORS].vv_list, + (const char *)gap->ga_data, (ptrdiff_t)gap->ga_len); } static void assert_equal_common(typval_T *argvars, assert_type_T atype) @@ -8053,12 +6803,23 @@ static void f_assert_notequal(typval_T *argvars, typval_T *rettv, FunPtr fptr) assert_equal_common(argvars, ASSERT_NOTEQUAL); } +/// "assert_report(msg) +static void f_assert_report(typval_T *argvars, typval_T *rettv, FunPtr fptr) +{ + garray_T ga; + + prepare_assert_error(&ga); + ga_concat(&ga, (const char_u *)tv_get_string(&argvars[0])); + assert_error(&ga); + ga_clear(&ga); +} + /// "assert_exception(string[, msg])" function static void f_assert_exception(typval_T *argvars, typval_T *rettv, FunPtr fptr) { garray_T ga; - char *error = (char *)get_tv_string_chk(&argvars[0]); + const char *const error = tv_get_string_chk(&argvars[0]); if (vimvars[VV_EXCEPTION].vv_str == NULL) { prepare_assert_error(&ga); ga_concat(&ga, (char_u *)"v:exception is not set"); @@ -8077,22 +6838,22 @@ static void f_assert_exception(typval_T *argvars, typval_T *rettv, FunPtr fptr) /// "assert_fails(cmd [, error])" function static void f_assert_fails(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - char_u *cmd = get_tv_string_chk(&argvars[0]); + const char *const cmd = tv_get_string_chk(&argvars[0]); garray_T ga; called_emsg = false; suppress_errthrow = true; emsg_silent = true; - do_cmdline_cmd((char *)cmd); + do_cmdline_cmd(cmd); if (!called_emsg) { prepare_assert_error(&ga); - ga_concat(&ga, (char_u *)"command did not fail: "); - ga_concat(&ga, cmd); + ga_concat(&ga, (const char_u *)"command did not fail: "); + ga_concat(&ga, (const char_u *)cmd); assert_error(&ga); ga_clear(&ga); } else if (argvars[1].v_type != VAR_UNKNOWN) { - char_u buf[NUMBUFLEN]; - char *error = (char *)get_tv_string_buf_chk(&argvars[1], buf); + char buf[NUMBUFLEN]; + const char *const error = tv_get_string_buf_chk(&argvars[1], buf); if (error == NULL || strstr((char *)vimvars[VV_ERRMSG].vv_str, error) == NULL) { @@ -8113,10 +6874,10 @@ static void f_assert_fails(typval_T *argvars, typval_T *rettv, FunPtr fptr) void assert_inrange(typval_T *argvars) { - int error = (int)false; - varnumber_T lower = get_tv_number_chk(&argvars[0], &error); - varnumber_T upper = get_tv_number_chk(&argvars[1], &error); - varnumber_T actual = get_tv_number_chk(&argvars[2], &error); + bool error = false; + const varnumber_T lower = tv_get_number_chk(&argvars[0], &error); + const varnumber_T upper = tv_get_number_chk(&argvars[1], &error); + const varnumber_T actual = tv_get_number_chk(&argvars[2], &error); if (error) { return; @@ -8126,8 +6887,9 @@ void assert_inrange(typval_T *argvars) prepare_assert_error(&ga); char msg[55]; - vim_snprintf(msg, sizeof(msg), "range %" PRId64 " - %" PRId64 ",", - (int64_t)lower, (int64_t)upper); + vim_snprintf(msg, sizeof(msg), + "range %" PRIdVARNUMBER " - %" PRIdVARNUMBER ",", + lower, upper); fill_assert_error(&ga, &argvars[3], (char_u *)msg, NULL, &argvars[2], ASSERT_INRANGE); assert_error(&ga); @@ -8138,11 +6900,11 @@ void assert_inrange(typval_T *argvars) // Common for assert_true() and assert_false(). static void assert_bool(typval_T *argvars, bool is_true) { - int error = (int)false; + bool error = false; garray_T ga; if ((argvars[0].v_type != VAR_NUMBER - || (get_tv_number_chk(&argvars[0], &error) == 0) == is_true + || (tv_get_number_chk(&argvars[0], &error) == 0) == is_true || error) && (argvars[0].v_type != VAR_SPECIAL || (argvars[0].vval.v_special @@ -8166,14 +6928,15 @@ static void f_assert_false(typval_T *argvars, typval_T *rettv, FunPtr fptr) static void assert_match_common(typval_T *argvars, assert_type_T atype) { - char_u buf1[NUMBUFLEN]; - char_u buf2[NUMBUFLEN]; - char_u *pat = get_tv_string_buf_chk(&argvars[0], buf1); - char_u *text = get_tv_string_buf_chk(&argvars[1], buf2); + char buf1[NUMBUFLEN]; + char buf2[NUMBUFLEN]; + const char *const pat = tv_get_string_buf_chk(&argvars[0], buf1); + const char *const text = tv_get_string_buf_chk(&argvars[1], buf2); if (pat == NULL || text == NULL) { EMSG(_(e_invarg)); - } else if (pattern_match(pat, text, false) != (atype == ASSERT_MATCH)) { + } else if (pattern_match((char_u *)pat, (char_u *)text, false) + != (atype == ASSERT_MATCH)) { garray_T ga; prepare_assert_error(&ga); fill_assert_error(&ga, &argvars[2], NULL, &argvars[0], &argvars[1], atype); @@ -8211,14 +6974,15 @@ static void f_assert_true(typval_T *argvars, typval_T *rettv, FunPtr fptr) */ static void f_atan2(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - float_T fx, fy; + float_T fx; + float_T fy; rettv->v_type = VAR_FLOAT; - if (get_float_arg(argvars, &fx) == OK - && get_float_arg(&argvars[1], &fy) == OK) + if (tv_get_float_chk(argvars, &fx) && tv_get_float_chk(&argvars[1], &fy)) { rettv->vval.v_float = atan2(fx, fy); - else + } else { rettv->vval.v_float = 0.0; + } } /* @@ -8360,8 +7124,7 @@ static void f_bufname(typval_T *argvars, typval_T *rettv, FunPtr fptr) */ static void f_bufnr(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - int error = false; - char_u *name; + bool error = false; rettv->vval.v_number = -1; if (!tv_check_str_or_nr(&argvars[0])) { @@ -8373,13 +7136,13 @@ static void f_bufnr(typval_T *argvars, typval_T *rettv, FunPtr fptr) // If the buffer isn't found and the second argument is not zero create a // new buffer. + const char *name; if (buf == NULL && argvars[1].v_type != VAR_UNKNOWN - && get_tv_number_chk(&argvars[1], &error) != 0 + && tv_get_number_chk(&argvars[1], &error) != 0 && !error - && (name = get_tv_string_chk(&argvars[0])) != NULL - && !error) { - buf = buflist_new(name, NULL, (linenr_T)1, 0); + && (name = tv_get_string_chk(&argvars[0])) != NULL) { + buf = buflist_new((char_u *)name, NULL, 1, 0); } if (buf != NULL) { @@ -8433,7 +7196,7 @@ static void f_bufwinnr(typval_T *argvars, typval_T *rettv, FunPtr fptr) */ static void f_byte2line(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - long boff = get_tv_number(&argvars[0]) - 1; + long boff = tv_get_number(&argvars[0]) - 1; if (boff < 0) { rettv->vval.v_number = -1; } else { @@ -8444,24 +7207,23 @@ static void f_byte2line(typval_T *argvars, typval_T *rettv, FunPtr fptr) static void byteidx(typval_T *argvars, typval_T *rettv, int comp) { - char_u *t; - char_u *str; - long idx; - - str = get_tv_string_chk(&argvars[0]); - idx = get_tv_number_chk(&argvars[1], NULL); + const char *const str = tv_get_string_chk(&argvars[0]); + varnumber_T idx = tv_get_number_chk(&argvars[1], NULL); rettv->vval.v_number = -1; - if (str == NULL || idx < 0) + if (str == NULL || idx < 0) { return; + } - t = str; + const char *t = str; for (; idx > 0; idx--) { - if (*t == NUL) /* EOL reached */ + if (*t == NUL) { // EOL reached. return; - if (enc_utf8 && comp) - t += utf_ptr2len(t); - else - t += (*mb_ptr2len)(t); + } + if (enc_utf8 && comp) { + t += utf_ptr2len((const char_u *)t); + } else { + t += (*mb_ptr2len)((const char_u *)t); + } } rettv->vval.v_number = (varnumber_T)(t - str); } @@ -8500,7 +7262,7 @@ int func_call(char_u *name, typval_T *args, partial_T *partial, /* Make a copy of each argument. This is needed to be able to set * v_lock to VAR_FIXED in the copy without changing the original list. */ - copy_tv(&item->li_tv, &argv[argc++]); + tv_copy(&item->li_tv, &argv[argc++]); } if (item == NULL) { @@ -8509,9 +7271,10 @@ int func_call(char_u *name, typval_T *args, partial_T *partial, &dummy, true, partial, selfdict); } - /* Free the arguments. */ - while (argc > 0) - clear_tv(&argv[--argc]); + // Free the arguments. + while (argc > 0) { + tv_clear(&argv[--argc]); + } return r; } @@ -8519,24 +7282,24 @@ int func_call(char_u *name, typval_T *args, partial_T *partial, /// "call(func, arglist [, dict])" function static void f_call(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - char_u *func; - partial_T *partial = NULL; - dict_T *selfdict = NULL; - if (argvars[1].v_type != VAR_LIST) { EMSG(_(e_listreq)); return; } - if (argvars[1].vval.v_list == NULL) + if (argvars[1].vval.v_list == NULL) { return; + } + char_u *func; + partial_T *partial = NULL; + dict_T *selfdict = NULL; if (argvars[0].v_type == VAR_FUNC) { func = argvars[0].vval.v_string; } else if (argvars[0].v_type == VAR_PARTIAL) { partial = argvars[0].vval.v_partial; func = partial_name(partial); } else { - func = get_tv_string(&argvars[0]); + func = (char_u *)tv_get_string(&argvars[0]); } if (*func == NUL) { return; // type error or empty name @@ -8561,23 +7324,89 @@ static void f_changenr(typval_T *argvars, typval_T *rettv, FunPtr fptr) rettv->vval.v_number = curbuf->b_u_seq_cur; } +// "chanclose(id[, stream])" function +static void f_chanclose(typval_T *argvars, typval_T *rettv, FunPtr fptr) +{ + rettv->v_type = VAR_NUMBER; + rettv->vval.v_number = 0; + + if (check_restricted() || check_secure()) { + return; + } + + if (argvars[0].v_type != VAR_NUMBER || (argvars[1].v_type != VAR_STRING + && argvars[1].v_type != VAR_UNKNOWN)) { + EMSG(_(e_invarg)); + return; + } + + ChannelPart part = kChannelPartAll; + if (argvars[1].v_type == VAR_STRING) { + char *stream = (char *)argvars[1].vval.v_string; + if (!strcmp(stream, "stdin")) { + part = kChannelPartStdin; + } else if (!strcmp(stream, "stdout")) { + part = kChannelPartStdout; + } else if (!strcmp(stream, "stderr")) { + part = kChannelPartStderr; + } else if (!strcmp(stream, "rpc")) { + part = kChannelPartRpc; + } else { + EMSG2(_("Invalid channel stream \"%s\""), stream); + return; + } + } + const char *error; + rettv->vval.v_number = channel_close(argvars[0].vval.v_number, part, &error); + if (!rettv->vval.v_number) { + EMSG(error); + } +} + +// "chansend(id, data)" function +static void f_chansend(typval_T *argvars, typval_T *rettv, FunPtr fptr) +{ + rettv->v_type = VAR_NUMBER; + rettv->vval.v_number = 0; + + if (check_restricted() || check_secure()) { + return; + } + + if (argvars[0].v_type != VAR_NUMBER || argvars[1].v_type == VAR_UNKNOWN) { + // First argument is the channel id and second is the data to write + EMSG(_(e_invarg)); + return; + } + + ptrdiff_t input_len = 0; + char *input = save_tv_as_string(&argvars[1], &input_len, false); + if (!input) { + // Either the error has been handled by save_tv_as_string(), + // or there is no input to send. + return; + } + uint64_t id = argvars[0].vval.v_number; + const char *error = NULL; + rettv->vval.v_number = channel_send(id, input, input_len, &error); + if (error) { + EMSG(error); + } +} + /* * "char2nr(string)" function */ static void f_char2nr(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - if (has_mbyte) { - int utf8 = 0; + if (argvars[1].v_type != VAR_UNKNOWN) { + if (!tv_check_num(&argvars[1])) { + return; + } + } - if (argvars[1].v_type != VAR_UNKNOWN) - utf8 = get_tv_number_chk(&argvars[1], NULL); - - if (utf8) - rettv->vval.v_number = (*utf_ptr2char)(get_tv_string(&argvars[0])); - else - rettv->vval.v_number = (*mb_ptr2char)(get_tv_string(&argvars[0])); - } else - rettv->vval.v_number = get_tv_string(&argvars[0])[0]; + rettv->vval.v_number = utf_ptr2char( + (const char_u *)tv_get_string(&argvars[0])); } /* @@ -8589,7 +7418,7 @@ static void f_cindent(typval_T *argvars, typval_T *rettv, FunPtr fptr) linenr_T lnum; pos = curwin->w_cursor; - lnum = get_tv_lnum(argvars); + lnum = tv_get_lnum(argvars); if (lnum >= 1 && lnum <= curbuf->b_ml.ml_line_count) { curwin->w_cursor.lnum = lnum; rettv->vval.v_number = get_c_indent(); @@ -8648,8 +7477,6 @@ static void f_col(typval_T *argvars, typval_T *rettv, FunPtr fptr) */ static void f_complete(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - int startcol; - if ((State & INSERT) == 0) { EMSG(_("E785: complete() can only be used in Insert mode")); return; @@ -8665,9 +7492,10 @@ static void f_complete(typval_T *argvars, typval_T *rettv, FunPtr fptr) return; } - startcol = get_tv_number_chk(&argvars[0], NULL); - if (startcol <= 0) + const colnr_T startcol = tv_get_number_chk(&argvars[0], NULL); + if (startcol <= 0) { return; + } set_completion(startcol - 1, argvars[1].vval.v_list); } @@ -8698,47 +7526,51 @@ static void f_complete_check(typval_T *argvars, typval_T *rettv, FunPtr fptr) */ static void f_confirm(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - char_u *message; - char_u *buttons = NULL; - char_u buf[NUMBUFLEN]; - char_u buf2[NUMBUFLEN]; + char buf[NUMBUFLEN]; + char buf2[NUMBUFLEN]; + const char *message; + const char *buttons = NULL; int def = 1; int type = VIM_GENERIC; - char_u *typestr; - int error = FALSE; + const char *typestr; + bool error = false; - message = get_tv_string_chk(&argvars[0]); - if (message == NULL) - error = TRUE; + message = tv_get_string_chk(&argvars[0]); + if (message == NULL) { + error = true; + } if (argvars[1].v_type != VAR_UNKNOWN) { - buttons = get_tv_string_buf_chk(&argvars[1], buf); - if (buttons == NULL) - error = TRUE; + buttons = tv_get_string_buf_chk(&argvars[1], buf); + if (buttons == NULL) { + error = true; + } if (argvars[2].v_type != VAR_UNKNOWN) { - def = get_tv_number_chk(&argvars[2], &error); + def = tv_get_number_chk(&argvars[2], &error); if (argvars[3].v_type != VAR_UNKNOWN) { - typestr = get_tv_string_buf_chk(&argvars[3], buf2); - if (typestr == NULL) - error = TRUE; - else { + typestr = tv_get_string_buf_chk(&argvars[3], buf2); + if (typestr == NULL) { + error = true; + } else { switch (TOUPPER_ASC(*typestr)) { - case 'E': type = VIM_ERROR; break; - case 'Q': type = VIM_QUESTION; break; - case 'I': type = VIM_INFO; break; - case 'W': type = VIM_WARNING; break; - case 'G': type = VIM_GENERIC; break; + case 'E': type = VIM_ERROR; break; + case 'Q': type = VIM_QUESTION; break; + case 'I': type = VIM_INFO; break; + case 'W': type = VIM_WARNING; break; + case 'G': type = VIM_GENERIC; break; } } } } } - if (buttons == NULL || *buttons == NUL) - buttons = (char_u *)_("&Ok"); + if (buttons == NULL || *buttons == NUL) { + buttons = _("&Ok"); + } - if (!error) - rettv->vval.v_number = do_dialog(type, NULL, message, buttons, - def, NULL, FALSE); + if (!error) { + rettv->vval.v_number = do_dialog( + type, NULL, (char_u *)message, (char_u *)buttons, def, NULL, false); + } } /* @@ -8765,15 +7597,16 @@ static void f_count(typval_T *argvars, typval_T *rettv, FunPtr fptr) if ((l = argvars[0].vval.v_list) != NULL) { li = l->lv_first; if (argvars[2].v_type != VAR_UNKNOWN) { - int error = FALSE; + bool error = false; - ic = get_tv_number_chk(&argvars[2], &error); + ic = tv_get_number_chk(&argvars[2], &error); if (argvars[3].v_type != VAR_UNKNOWN) { - idx = get_tv_number_chk(&argvars[3], &error); + idx = tv_get_number_chk(&argvars[3], &error); if (!error) { - li = list_find(l, idx); - if (li == NULL) + li = tv_list_find(l, idx); + if (li == NULL) { EMSGN(_(e_listidx), idx); + } } } if (error) @@ -8790,20 +7623,22 @@ static void f_count(typval_T *argvars, typval_T *rettv, FunPtr fptr) hashitem_T *hi; if ((d = argvars[0].vval.v_dict) != NULL) { - int error = FALSE; + bool error = false; if (argvars[2].v_type != VAR_UNKNOWN) { - ic = get_tv_number_chk(&argvars[2], &error); - if (argvars[3].v_type != VAR_UNKNOWN) + ic = tv_get_number_chk(&argvars[2], &error); + if (argvars[3].v_type != VAR_UNKNOWN) { EMSG(_(e_invarg)); + } } todo = error ? 0 : (int)d->dv_hashtab.ht_used; for (hi = d->dv_hashtab.ht_array; todo > 0; ++hi) { if (!HASHITEM_EMPTY(hi)) { - --todo; - if (tv_equal(&HI2DI(hi)->di_tv, &argvars[1], ic, FALSE)) - ++n; + todo--; + if (tv_equal(&TV_DICT_HI2DI(hi)->di_tv, &argvars[1], ic, false)) { + n++; + } } } } @@ -8820,19 +7655,21 @@ static void f_count(typval_T *argvars, typval_T *rettv, FunPtr fptr) static void f_cscope_connection(typval_T *argvars, typval_T *rettv, FunPtr fptr) { int num = 0; - char_u *dbpath = NULL; - char_u *prepend = NULL; - char_u buf[NUMBUFLEN]; + const char *dbpath = NULL; + const char *prepend = NULL; + char buf[NUMBUFLEN]; if (argvars[0].v_type != VAR_UNKNOWN && argvars[1].v_type != VAR_UNKNOWN) { - num = (int)get_tv_number(&argvars[0]); - dbpath = get_tv_string(&argvars[1]); - if (argvars[2].v_type != VAR_UNKNOWN) - prepend = get_tv_string_buf(&argvars[2], buf); + num = (int)tv_get_number(&argvars[0]); + dbpath = tv_get_string(&argvars[1]); + if (argvars[2].v_type != VAR_UNKNOWN) { + prepend = tv_get_string_buf(&argvars[2], buf); + } } - rettv->vval.v_number = cs_connection(num, dbpath, prepend); + rettv->vval.v_number = cs_connection(num, (char_u *)dbpath, + (char_u *)prepend); } /// "cursor(lnum, col)" function, or @@ -8865,10 +7702,10 @@ static void f_cursor(typval_T *argvars, typval_T *rettv, FunPtr fptr) set_curswant = false; } } else { - line = get_tv_lnum(argvars); - col = get_tv_number_chk(&argvars[1], NULL); + line = tv_get_lnum(argvars); + col = (long)tv_get_number_chk(&argvars[1], NULL); if (argvars[2].v_type != VAR_UNKNOWN) { - coladd = get_tv_number_chk(&argvars[2], NULL); + coladd = (long)tv_get_number_chk(&argvars[2], NULL); } } if (line < 0 || col < 0 @@ -8901,10 +7738,11 @@ static void f_deepcopy(typval_T *argvars, typval_T *rettv, FunPtr fptr) { int noref = 0; - if (argvars[1].v_type != VAR_UNKNOWN) - noref = get_tv_number_chk(&argvars[1], NULL); + if (argvars[1].v_type != VAR_UNKNOWN) { + noref = tv_get_number_chk(&argvars[1], NULL); + } if (noref < 0 || noref > 1) { - EMSG(_(e_invarg)); + emsgf(_(e_invarg)); } else { var_item_copy(NULL, &argvars[0], rettv, true, (noref == 0 ? get_copyID() @@ -8915,34 +7753,32 @@ static void f_deepcopy(typval_T *argvars, typval_T *rettv, FunPtr fptr) // "delete()" function static void f_delete(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - char_u nbuf[NUMBUFLEN]; - char_u *name; - char_u *flags; - rettv->vval.v_number = -1; if (check_restricted() || check_secure()) { return; } - name = get_tv_string(&argvars[0]); - if (name == NULL || *name == NUL) { + const char *const name = tv_get_string(&argvars[0]); + if (*name == NUL) { EMSG(_(e_invarg)); return; } + char nbuf[NUMBUFLEN]; + const char *flags; if (argvars[1].v_type != VAR_UNKNOWN) { - flags = get_tv_string_buf(&argvars[1], nbuf); + flags = tv_get_string_buf(&argvars[1], nbuf); } else { - flags = (char_u *)""; + flags = ""; } if (*flags == NUL) { // delete a file - rettv->vval.v_number = os_remove((char *)name) == 0 ? 0 : -1; - } else if (STRCMP(flags, "d") == 0) { + rettv->vval.v_number = os_remove(name) == 0 ? 0 : -1; + } else if (strcmp(flags, "d") == 0) { // delete an empty directory - rettv->vval.v_number = os_rmdir((char *)name) == 0 ? 0 : -1; - } else if (STRCMP(flags, "rf") == 0) { + rettv->vval.v_number = os_rmdir(name) == 0 ? 0 : -1; + } else if (strcmp(flags, "rf") == 0) { // delete a directory recursively rettv->vval.v_number = delete_recursive(name); } else { @@ -8958,35 +7794,34 @@ static void f_dictwatcheradd(typval_T *argvars, typval_T *rettv, FunPtr fptr) } if (argvars[0].v_type != VAR_DICT) { - EMSG2(e_invarg2, "dict"); + emsgf(_(e_invarg2), "dict"); + return; + } else if (argvars[0].vval.v_dict == NULL) { + const char *const arg_errmsg = _("dictwatcheradd() argument"); + const size_t arg_errmsg_len = strlen(arg_errmsg); + emsgf(_(e_readonlyvar), (int)arg_errmsg_len, arg_errmsg); return; } if (argvars[1].v_type != VAR_STRING && argvars[1].v_type != VAR_NUMBER) { - EMSG2(e_invarg2, "key"); + emsgf(_(e_invarg2), "key"); return; } - char *key_pattern = (char *)get_tv_string_chk(argvars + 1); - assert(key_pattern); - const size_t key_len = STRLEN(argvars[1].vval.v_string); - - if (key_len == 0) { - EMSG(_(e_emptykey)); + const char *const key_pattern = tv_get_string_chk(argvars + 1); + if (key_pattern == NULL) { return; } + const size_t key_pattern_len = strlen(key_pattern); Callback callback; if (!callback_from_typval(&callback, &argvars[2])) { - EMSG2(e_invarg2, "funcref"); + emsgf(_(e_invarg2), "funcref"); return; } - DictWatcher *watcher = xmalloc(sizeof(DictWatcher)); - watcher->key_pattern = xmemdupz(key_pattern, key_len); - watcher->callback = callback; - watcher->busy = false; - QUEUE_INSERT_TAIL(&argvars[0].vval.v_dict->watchers, &watcher->node); + tv_dict_watcher_add(argvars[0].vval.v_dict, key_pattern, key_pattern_len, + callback); } // dictwatcherdel(dict, key, funcref) function @@ -8997,26 +7832,17 @@ static void f_dictwatcherdel(typval_T *argvars, typval_T *rettv, FunPtr fptr) } if (argvars[0].v_type != VAR_DICT) { - EMSG2(e_invarg2, "dict"); - return; - } - - if (argvars[1].v_type != VAR_STRING && argvars[1].v_type != VAR_NUMBER) { - EMSG2(e_invarg2, "key"); + emsgf(_(e_invarg2), "dict"); return; } if (argvars[2].v_type != VAR_FUNC && argvars[2].v_type != VAR_STRING) { - EMSG2(e_invarg2, "funcref"); + emsgf(_(e_invarg2), "funcref"); return; } - char *key_pattern = (char *)get_tv_string_chk(argvars + 1); - assert(key_pattern); - const size_t key_len = STRLEN(argvars[1].vval.v_string); - - if (key_len == 0) { - EMSG(_(e_emptykey)); + const char *const key_pattern = tv_get_string_chk(argvars + 1); + if (key_pattern == NULL) { return; } @@ -9025,28 +7851,12 @@ static void f_dictwatcherdel(typval_T *argvars, typval_T *rettv, FunPtr fptr) return; } - dict_T *dict = argvars[0].vval.v_dict; - QUEUE *w = NULL; - DictWatcher *watcher = NULL; - bool matched = false; - QUEUE_FOREACH(w, &dict->watchers) { - watcher = dictwatcher_node_data(w); - if (callback_equal(&watcher->callback, &callback) - && !strcmp(watcher->key_pattern, key_pattern)) { - matched = true; - break; - } + if (!tv_dict_watcher_remove(argvars[0].vval.v_dict, key_pattern, + strlen(key_pattern), callback)) { + EMSG("Couldn't find a watcher matching key and callback"); } callback_free(&callback); - - if (!matched) { - EMSG("Couldn't find a watcher matching key and callback"); - return; - } - - QUEUE_REMOVE(w); - dictwatcher_free(watcher); } /* @@ -9062,7 +7872,7 @@ static void f_did_filetype(typval_T *argvars, typval_T *rettv, FunPtr fptr) */ static void f_diff_filler(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - rettv->vval.v_number = diff_check_fill(curwin, get_tv_lnum(argvars)); + rettv->vval.v_number = diff_check_fill(curwin, tv_get_lnum(argvars)); } /* @@ -9070,7 +7880,7 @@ static void f_diff_filler(typval_T *argvars, typval_T *rettv, FunPtr fptr) */ static void f_diff_hlID(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - linenr_T lnum = get_tv_lnum(argvars); + linenr_T lnum = tv_get_lnum(argvars); static linenr_T prev_lnum = 0; static int changedtick = 0; static int fnum = 0; @@ -9105,11 +7915,12 @@ static void f_diff_hlID(typval_T *argvars, typval_T *rettv, FunPtr fptr) } if (hlID == HLF_CHD || hlID == HLF_TXD) { - col = get_tv_number(&argvars[1]) - 1; /* ignore type error in {col} */ - if (col >= change_start && col <= change_end) - hlID = HLF_TXD; /* changed text */ - else - hlID = HLF_CHD; /* changed line */ + col = tv_get_number(&argvars[1]) - 1; // Ignore type error in {col}. + if (col >= change_start && col <= change_end) { + hlID = HLF_TXD; // Changed text. + } else { + hlID = HLF_CHD; // Changed line. + } } rettv->vval.v_number = hlID == (hlf_T)0 ? 0 : (int)hlID; } @@ -9160,10 +7971,11 @@ static void f_empty(typval_T *argvars, typval_T *rettv, FunPtr fptr) */ static void f_escape(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - char_u buf[NUMBUFLEN]; + char buf[NUMBUFLEN]; - rettv->vval.v_string = vim_strsave_escaped(get_tv_string(&argvars[0]), - get_tv_string_buf(&argvars[1], buf)); + rettv->vval.v_string = vim_strsave_escaped( + (const char_u *)tv_get_string(&argvars[0]), + (const char_u *)tv_get_string_buf(&argvars[1], buf)); rettv->v_type = VAR_STRING; } @@ -9172,16 +7984,15 @@ static void f_escape(typval_T *argvars, typval_T *rettv, FunPtr fptr) */ static void f_eval(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - char_u *s; + const char *s = tv_get_string_chk(&argvars[0]); + if (s != NULL) { + s = (const char *)skipwhite((const char_u *)s); + } - s = get_tv_string_chk(&argvars[0]); - if (s != NULL) - s = skipwhite(s); - - char_u *p = s; - if (s == NULL || eval1(&s, rettv, TRUE) == FAIL) { - if (p != NULL && !aborting()) { - EMSG2(_(e_invexpr2), p); + const char *const expr_start = s; + if (s == NULL || eval1((char_u **)&s, rettv, true) == FAIL) { + if (expr_start != NULL && !aborting()) { + EMSG2(_(e_invexpr2), expr_start); } need_clr_eos = FALSE; rettv->v_type = VAR_NUMBER; @@ -9204,91 +8015,92 @@ static void f_eventhandler(typval_T *argvars, typval_T *rettv, FunPtr fptr) */ static void f_executable(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - char_u *name = get_tv_string(&argvars[0]); + const char *name = tv_get_string(&argvars[0]); // Check in $PATH and also check directly if there is a directory name - rettv->vval.v_number = os_can_exe(name, NULL, true) - || (gettail_dir(name) != name && os_can_exe(name, NULL, false)); + rettv->vval.v_number = ( + os_can_exe((const char_u *)name, NULL, true) + || (gettail_dir(name) != name + && os_can_exe((const char_u *)name, NULL, false))); } -static char_u * get_list_line(int c, void *cookie, int indent) +static char_u *get_list_line(int c, void *cookie, int indent) { - listitem_T **p = (listitem_T **)cookie; - listitem_T *item = *p; - char_u buf[NUMBUFLEN]; - char_u *s; + const listitem_T **const p = (const listitem_T **)cookie; + const listitem_T *item = *p; if (item == NULL) { return NULL; } - s = get_tv_string_buf_chk(&item->li_tv, buf); + char buf[NUMBUFLEN]; + const char *const s = tv_get_string_buf_chk(&item->li_tv, buf); *p = item->li_next; - return s == NULL ? NULL : vim_strsave(s); + return (char_u *)(s == NULL ? NULL : xstrdup(s)); } // "execute(command)" function static void f_execute(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - int save_msg_silent = msg_silent; - int save_emsg_silent = emsg_silent; - bool save_emsg_noredir = emsg_noredir; - garray_T *save_capture_ga = capture_ga; + const int save_msg_silent = msg_silent; + const int save_emsg_silent = emsg_silent; + const bool save_emsg_noredir = emsg_noredir; + garray_T *const save_capture_ga = capture_ga; - if (check_secure()) { + if (check_secure()) { + return; + } + + if (argvars[1].v_type != VAR_UNKNOWN) { + char buf[NUMBUFLEN]; + const char *const s = tv_get_string_buf_chk(&argvars[1], buf); + + if (s == NULL) { return; } - - if (argvars[1].v_type != VAR_UNKNOWN) { - char_u buf[NUMBUFLEN]; - char_u *s = get_tv_string_buf_chk(&argvars[1], buf); - - if (s == NULL) { - return; - } - if (STRNCMP(s, "silent", 6) == 0) { - msg_silent++; - } - if (STRCMP(s, "silent!") == 0) { - emsg_silent = true; - emsg_noredir = true; - } - } else { + if (strncmp(s, "silent", 6) == 0) { msg_silent++; } - - garray_T capture_local; - ga_init(&capture_local, (int)sizeof(char), 80); - capture_ga = &capture_local; - - if (argvars[0].v_type != VAR_LIST) { - do_cmdline_cmd((char *)get_tv_string(&argvars[0])); - } else if (argvars[0].vval.v_list != NULL) { - list_T *list = argvars[0].vval.v_list; - list->lv_refcount++; - listitem_T *item = list->lv_first; - do_cmdline(NULL, get_list_line, (void *)&item, - DOCMD_NOWAIT|DOCMD_VERBOSE|DOCMD_REPEAT|DOCMD_KEYTYPED); - list->lv_refcount--; + if (strcmp(s, "silent!") == 0) { + emsg_silent = true; + emsg_noredir = true; } - msg_silent = save_msg_silent; - emsg_silent = save_emsg_silent; - emsg_noredir = save_emsg_noredir; + } else { + msg_silent++; + } - ga_append(capture_ga, NUL); - rettv->v_type = VAR_STRING; - rettv->vval.v_string = vim_strsave(capture_ga->ga_data); - ga_clear(capture_ga); + garray_T capture_local; + ga_init(&capture_local, (int)sizeof(char), 80); + capture_ga = &capture_local; - capture_ga = save_capture_ga; + if (argvars[0].v_type != VAR_LIST) { + do_cmdline_cmd(tv_get_string(&argvars[0])); + } else if (argvars[0].vval.v_list != NULL) { + list_T *const list = argvars[0].vval.v_list; + list->lv_refcount++; + listitem_T *const item = list->lv_first; + do_cmdline(NULL, get_list_line, (void *)&item, + DOCMD_NOWAIT|DOCMD_VERBOSE|DOCMD_REPEAT|DOCMD_KEYTYPED); + list->lv_refcount--; + } + msg_silent = save_msg_silent; + emsg_silent = save_emsg_silent; + emsg_noredir = save_emsg_noredir; + + ga_append(capture_ga, NUL); + rettv->v_type = VAR_STRING; + rettv->vval.v_string = vim_strsave(capture_ga->ga_data); + ga_clear(capture_ga); + + capture_ga = save_capture_ga; } /// "exepath()" function static void f_exepath(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - char_u *arg = get_tv_string(&argvars[0]); + const char *arg = tv_get_string(&argvars[0]); char_u *path = NULL; - (void)os_can_exe(arg, &path, true); + (void)os_can_exe((const char_u *)arg, &path, true); rettv->v_type = VAR_STRING; rettv->vval.v_string = path; @@ -9302,21 +8114,21 @@ static void f_exists(typval_T *argvars, typval_T *rettv, FunPtr fptr) int n = false; int len = 0; - char *p = (char *)get_tv_string(&argvars[0]); + const char *p = tv_get_string(&argvars[0]); if (*p == '$') { // Environment variable. // First try "normal" environment variables (fast). if (os_getenv(p + 1) != NULL) { n = true; } else { // Try expanding things like $VIM and ${HOME}. - p = (char *)expand_env_save((char_u *)p); - if (p != NULL && *p != '$') { + char_u *const exp = expand_env_save((char_u *)p); + if (exp != NULL && *exp != '$') { n = true; } - xfree(p); + xfree(exp); } } else if (*p == '&' || *p == '+') { // Option. - n = (get_option_tv((const char **)&p, NULL, true) == OK); + n = (get_option_tv(&p, NULL, true) == OK); if (*skipwhite((const char_u *)p) != NUL) { n = false; // Trailing garbage. } @@ -9344,9 +8156,9 @@ static void f_exists(typval_T *argvars, typval_T *rettv, FunPtr fptr) n = (get_var_tv(name, len, &tv, NULL, false, true) == OK); if (n) { // Handle d.key, l[idx], f(expr). - n = (handle_subscript((const char **)&p, &tv, true, false) == OK); + n = (handle_subscript(&p, &tv, true, false) == OK); if (n) { - clear_tv(&tv); + tv_clear(&tv); } } } @@ -9364,32 +8176,31 @@ static void f_exists(typval_T *argvars, typval_T *rettv, FunPtr fptr) */ static void f_expand(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - char_u *s; size_t len; char_u *errormsg; int options = WILD_SILENT|WILD_USE_NL|WILD_LIST_NOTFOUND; expand_T xpc; - int error = FALSE; - char_u *result; + bool error = false; + char_u *result; rettv->v_type = VAR_STRING; if (argvars[1].v_type != VAR_UNKNOWN && argvars[2].v_type != VAR_UNKNOWN - && get_tv_number_chk(&argvars[2], &error) + && tv_get_number_chk(&argvars[2], &error) && !error) { rettv->v_type = VAR_LIST; rettv->vval.v_list = NULL; } - s = get_tv_string(&argvars[0]); + const char *s = tv_get_string(&argvars[0]); if (*s == '%' || *s == '#' || *s == '<') { - ++emsg_off; - result = eval_vars(s, s, &len, NULL, &errormsg, NULL); - --emsg_off; + emsg_off++; + result = eval_vars((char_u *)s, (char_u *)s, &len, NULL, &errormsg, NULL); + emsg_off--; if (rettv->v_type == VAR_LIST) { - rettv_list_alloc(rettv); + tv_list_alloc_ret(rettv); if (result != NULL) { - list_append_string(rettv->vval.v_list, result, -1); + tv_list_append_string(rettv->vval.v_list, (const char *)result, -1); } } else rettv->vval.v_string = result; @@ -9397,95 +8208,44 @@ static void f_expand(typval_T *argvars, typval_T *rettv, FunPtr fptr) /* When the optional second argument is non-zero, don't remove matches * for 'wildignore' and don't put matches for 'suffixes' at the end. */ if (argvars[1].v_type != VAR_UNKNOWN - && get_tv_number_chk(&argvars[1], &error)) + && tv_get_number_chk(&argvars[1], &error)) { options |= WILD_KEEP_ALL; + } if (!error) { ExpandInit(&xpc); xpc.xp_context = EXPAND_FILES; - if (p_wic) + if (p_wic) { options += WILD_ICASE; - if (rettv->v_type == VAR_STRING) - rettv->vval.v_string = ExpandOne(&xpc, s, NULL, - options, WILD_ALL); - else { - rettv_list_alloc(rettv); - ExpandOne(&xpc, s, NULL, options, WILD_ALL_KEEP); + } + if (rettv->v_type == VAR_STRING) { + rettv->vval.v_string = ExpandOne(&xpc, (char_u *)s, NULL, options, + WILD_ALL); + } else { + tv_list_alloc_ret(rettv); + ExpandOne(&xpc, (char_u *)s, NULL, options, WILD_ALL_KEEP); for (int i = 0; i < xpc.xp_numfiles; i++) { - list_append_string(rettv->vval.v_list, xpc.xp_files[i], -1); + tv_list_append_string(rettv->vval.v_list, + (const char *)xpc.xp_files[i], -1); } ExpandCleanup(&xpc); } - } else + } else { rettv->vval.v_string = NULL; + } } } -/* - * Go over all entries in "d2" and add them to "d1". - * When "action" is "error" then a duplicate key is an error. - * When "action" is "force" then a duplicate key is overwritten. - * Otherwise duplicate keys are ignored ("action" is "keep"). - */ -void dict_extend(dict_T *d1, dict_T *d2, char_u *action) + +/// "menu_get(path [, modes])" function +static void f_menu_get(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - dictitem_T *di1; - hashitem_T *hi2; - int todo; - bool watched = is_watched(d1); - const char *const arg_errmsg = _("extend() argument"); - const size_t arg_errmsg_len = strlen(arg_errmsg); - - todo = (int)d2->dv_hashtab.ht_used; - for (hi2 = d2->dv_hashtab.ht_array; todo > 0; ++hi2) { - if (!HASHITEM_EMPTY(hi2)) { - --todo; - di1 = dict_find(d1, hi2->hi_key, -1); - if (d1->dv_scope != 0) { - /* Disallow replacing a builtin function in l: and g:. - * Check the key to be valid when adding to any - * scope. */ - if (d1->dv_scope == VAR_DEF_SCOPE - && HI2DI(hi2)->di_tv.v_type == VAR_FUNC - && var_check_func_name(hi2->hi_key, - di1 == NULL)) - break; - if (!valid_varname(hi2->hi_key)) - break; - } - if (di1 == NULL) { - di1 = dictitem_copy(HI2DI(hi2)); - if (dict_add(d1, di1) == FAIL) { - dictitem_free(di1); - } - - if (watched) { - dictwatcher_notify(d1, (char *)di1->di_key, &di1->di_tv, NULL); - } - } else if (*action == 'e') { - EMSG2(_("E737: Key already exists: %s"), hi2->hi_key); - break; - } else if (*action == 'f' && HI2DI(hi2) != di1) { - typval_T oldtv; - - if (tv_check_lock(di1->di_tv.v_lock, arg_errmsg, arg_errmsg_len) - || var_check_ro(di1->di_flags, arg_errmsg, arg_errmsg_len)) { - break; - } - - if (watched) { - copy_tv(&di1->di_tv, &oldtv); - } - - clear_tv(&di1->di_tv); - copy_tv(&HI2DI(hi2)->di_tv, &di1->di_tv); - - if (watched) { - dictwatcher_notify(d1, (char *)di1->di_key, &di1->di_tv, &oldtv); - clear_tv(&oldtv); - } - } - } + tv_list_alloc_ret(rettv); + int modes = MENU_ALL_MODES; + if (argvars[1].v_type == VAR_STRING) { + const char_u *const strmodes = (char_u *)tv_get_string(&argvars[1]); + modes = get_menu_cmd_modes(strmodes, false, NULL, NULL); } + menu_get((char_u *)tv_get_string(&argvars[0]), modes, rettv->vval.v_list); } /* @@ -9495,27 +8255,32 @@ void dict_extend(dict_T *d1, dict_T *d2, char_u *action) static void f_extend(typval_T *argvars, typval_T *rettv, FunPtr fptr) { const char *const arg_errmsg = N_("extend() argument"); - const size_t arg_errmsg_len = strlen(arg_errmsg); if (argvars[0].v_type == VAR_LIST && argvars[1].v_type == VAR_LIST) { - list_T *l1, *l2; - listitem_T *item; long before; - int error = FALSE; + bool error = false; - l1 = argvars[0].vval.v_list; - l2 = argvars[1].vval.v_list; - if (l1 != NULL && !tv_check_lock(l1->lv_lock, arg_errmsg, arg_errmsg_len) - && l2 != NULL) { + list_T *const l1 = argvars[0].vval.v_list; + list_T *const l2 = argvars[1].vval.v_list; + if (l1 == NULL) { + const bool locked = tv_check_lock(VAR_FIXED, arg_errmsg, TV_TRANSLATE); + (void)locked; + assert(locked == true); + } else if (l2 == NULL) { + // Do nothing + tv_copy(&argvars[0], rettv); + } else if (!tv_check_lock(l1->lv_lock, arg_errmsg, TV_TRANSLATE)) { + listitem_T *item; if (argvars[2].v_type != VAR_UNKNOWN) { - before = get_tv_number_chk(&argvars[2], &error); - if (error) - return; /* type error; errmsg already given */ + before = (long)tv_get_number_chk(&argvars[2], &error); + if (error) { + return; // Type error; errmsg already given. + } - if (before == l1->lv_len) + if (before == l1->lv_len) { item = NULL; - else { - item = list_find(l1, before); + } else { + item = tv_list_find(l1, before); if (item == NULL) { EMSGN(_(e_listidx), before); return; @@ -9523,43 +8288,50 @@ static void f_extend(typval_T *argvars, typval_T *rettv, FunPtr fptr) } } else item = NULL; - list_extend(l1, l2, item); + tv_list_extend(l1, l2, item); - copy_tv(&argvars[0], rettv); + tv_copy(&argvars[0], rettv); } } else if (argvars[0].v_type == VAR_DICT && argvars[1].v_type == VAR_DICT) { - dict_T *d1, *d2; - char_u *action; - int i; - - d1 = argvars[0].vval.v_dict; - d2 = argvars[1].vval.v_dict; - if (d1 != NULL && !tv_check_lock(d1->dv_lock, arg_errmsg, arg_errmsg_len) - && d2 != NULL) { - /* Check the third argument. */ + dict_T *const d1 = argvars[0].vval.v_dict; + dict_T *const d2 = argvars[1].vval.v_dict; + if (d1 == NULL) { + const bool locked = tv_check_lock(VAR_FIXED, arg_errmsg, TV_TRANSLATE); + (void)locked; + assert(locked == true); + } else if (d2 == NULL) { + // Do nothing + tv_copy(&argvars[0], rettv); + } else if (!tv_check_lock(d1->dv_lock, arg_errmsg, TV_TRANSLATE)) { + const char *action = "force"; + // Check the third argument. if (argvars[2].v_type != VAR_UNKNOWN) { - static char *(av[]) = {"keep", "force", "error"}; + const char *const av[] = { "keep", "force", "error" }; - action = get_tv_string_chk(&argvars[2]); - if (action == NULL) - return; /* type error; errmsg already given */ - for (i = 0; i < 3; ++i) - if (STRCMP(action, av[i]) == 0) + action = tv_get_string_chk(&argvars[2]); + if (action == NULL) { + return; // Type error; error message already given. + } + size_t i; + for (i = 0; i < ARRAY_SIZE(av); i++) { + if (strcmp(action, av[i]) == 0) { break; + } + } if (i == 3) { EMSG2(_(e_invarg2), action); return; } - } else - action = (char_u *)"force"; + } - dict_extend(d1, d2, action); + tv_dict_extend(d1, d2, action); - copy_tv(&argvars[0], rettv); + tv_copy(&argvars[0], rettv); } - } else + } else { EMSG2(_(e_listdictarg), "extend()"); + } } /* @@ -9567,19 +8339,18 @@ static void f_extend(typval_T *argvars, typval_T *rettv, FunPtr fptr) */ static void f_feedkeys(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - char_u *keys, *flags = NULL; - char_u nbuf[NUMBUFLEN]; - - /* This is not allowed in the sandbox. If the commands would still be - * executed in the sandbox it would be OK, but it probably happens later, - * when "sandbox" is no longer set. */ - if (check_secure()) + // This is not allowed in the sandbox. If the commands would still be + // executed in the sandbox it would be OK, but it probably happens later, + // when "sandbox" is no longer set. + if (check_secure()) { return; + } - keys = get_tv_string(&argvars[0]); - + const char *const keys = tv_get_string(&argvars[0]); + char nbuf[NUMBUFLEN]; + const char *flags = NULL; if (argvars[1].v_type != VAR_UNKNOWN) { - flags = get_tv_string_buf(&argvars[1], nbuf); + flags = tv_get_string_buf(&argvars[1], nbuf); } nvim_feedkeys(cstr_as_string((char *)keys), @@ -9589,9 +8360,9 @@ static void f_feedkeys(typval_T *argvars, typval_T *rettv, FunPtr fptr) /// "filereadable()" function static void f_filereadable(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - char_u *p = get_tv_string(&argvars[0]); + const char *const p = tv_get_string(&argvars[0]); rettv->vval.v_number = - (*p && !os_isdir(p) && os_file_is_readable((char*)p)); + (*p && !os_isdir((const char_u *)p) && os_file_is_readable(p)); } /* @@ -9600,60 +8371,60 @@ static void f_filereadable(typval_T *argvars, typval_T *rettv, FunPtr fptr) */ static void f_filewritable(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - char *filename = (char *)get_tv_string(&argvars[0]); + const char *filename = tv_get_string(&argvars[0]); rettv->vval.v_number = os_file_is_writable(filename); } static void findfilendir(typval_T *argvars, typval_T *rettv, int find_what) { - char_u *fname; - char_u *fresult = NULL; - char_u *path = *curbuf->b_p_path == NUL ? p_path : curbuf->b_p_path; - char_u *p; - char_u pathbuf[NUMBUFLEN]; + char_u *fresult = NULL; + char_u *path = *curbuf->b_p_path == NUL ? p_path : curbuf->b_p_path; int count = 1; - int first = TRUE; - int error = FALSE; + bool first = true; + bool error = false; rettv->vval.v_string = NULL; rettv->v_type = VAR_STRING; - fname = get_tv_string(&argvars[0]); + const char *fname = tv_get_string(&argvars[0]); + char pathbuf[NUMBUFLEN]; if (argvars[1].v_type != VAR_UNKNOWN) { - p = get_tv_string_buf_chk(&argvars[1], pathbuf); - if (p == NULL) - error = TRUE; - else { - if (*p != NUL) - path = p; + const char *p = tv_get_string_buf_chk(&argvars[1], pathbuf); + if (p == NULL) { + error = true; + } else { + if (*p != NUL) { + path = (char_u *)p; + } - if (argvars[2].v_type != VAR_UNKNOWN) - count = get_tv_number_chk(&argvars[2], &error); + if (argvars[2].v_type != VAR_UNKNOWN) { + count = tv_get_number_chk(&argvars[2], &error); + } } } if (count < 0) { - rettv_list_alloc(rettv); + tv_list_alloc_ret(rettv); } if (*fname != NUL && !error) { do { if (rettv->v_type == VAR_STRING || rettv->v_type == VAR_LIST) xfree(fresult); - fresult = find_file_in_path_option(first ? fname : NULL, - first ? STRLEN(fname) : 0, + fresult = find_file_in_path_option(first ? (char_u *)fname : NULL, + first ? strlen(fname) : 0, 0, first, path, find_what, curbuf->b_ffname, (find_what == FINDFILE_DIR ? (char_u *)"" : curbuf->b_p_sua)); - first = FALSE; - - if (fresult != NULL && rettv->v_type == VAR_LIST) - list_append_string(rettv->vval.v_list, fresult, -1); + first = false; + if (fresult != NULL && rettv->v_type == VAR_LIST) { + tv_list_append_string(rettv->vval.v_list, (const char *)fresult, -1); + } } while ((rettv->v_type == VAR_LIST || --count > 0) && fresult != NULL); } @@ -9680,20 +8451,19 @@ static void filter_map(typval_T *argvars, typval_T *rettv, int map) int todo; char_u *ermsg = (char_u *)(map ? "map()" : "filter()"); const char *const arg_errmsg = (map - ? _("map() argument") - : _("filter() argument")); - const size_t arg_errmsg_len = strlen(arg_errmsg); + ? N_("map() argument") + : N_("filter() argument")); int save_did_emsg; int idx = 0; if (argvars[0].v_type == VAR_LIST) { if ((l = argvars[0].vval.v_list) == NULL - || (!map && tv_check_lock(l->lv_lock, arg_errmsg, arg_errmsg_len))) { + || (!map && tv_check_lock(l->lv_lock, arg_errmsg, TV_TRANSLATE))) { return; } } else if (argvars[0].v_type == VAR_DICT) { if ((d = argvars[0].vval.v_dict) == NULL - || (!map && tv_check_lock(d->dv_lock, arg_errmsg, arg_errmsg_len))) { + || (!map && tv_check_lock(d->dv_lock, arg_errmsg, TV_TRANSLATE))) { return; } } else { @@ -9724,24 +8494,25 @@ static void filter_map(typval_T *argvars, typval_T *rettv, int map) if (!HASHITEM_EMPTY(hi)) { --todo; - di = HI2DI(hi); + di = TV_DICT_HI2DI(hi); if (map - && (tv_check_lock(di->di_tv.v_lock, arg_errmsg, arg_errmsg_len) - || var_check_ro(di->di_flags, arg_errmsg, arg_errmsg_len))) { + && (tv_check_lock(di->di_tv.v_lock, arg_errmsg, TV_TRANSLATE) + || var_check_ro(di->di_flags, arg_errmsg, TV_TRANSLATE))) { break; } vimvars[VV_KEY].vv_str = vim_strsave(di->di_key); int r = filter_map_one(&di->di_tv, expr, map, &rem); - clear_tv(&vimvars[VV_KEY].vv_tv); - if (r == FAIL || did_emsg) + tv_clear(&vimvars[VV_KEY].vv_tv); + if (r == FAIL || did_emsg) { break; + } if (!map && rem) { - if (var_check_fixed(di->di_flags, arg_errmsg, arg_errmsg_len) - || var_check_ro(di->di_flags, arg_errmsg, arg_errmsg_len)) { + if (var_check_fixed(di->di_flags, arg_errmsg, TV_TRANSLATE) + || var_check_ro(di->di_flags, arg_errmsg, TV_TRANSLATE)) { break; } - dictitem_remove(d, di); + tv_dict_item_remove(d, di); } } } @@ -9751,7 +8522,7 @@ static void filter_map(typval_T *argvars, typval_T *rettv, int map) for (li = l->lv_first; li != NULL; li = nli) { if (map - && tv_check_lock(li->li_tv.v_lock, arg_errmsg, arg_errmsg_len)) { + && tv_check_lock(li->li_tv.v_lock, arg_errmsg, TV_TRANSLATE)) { break; } nli = li->li_next; @@ -9759,9 +8530,10 @@ static void filter_map(typval_T *argvars, typval_T *rettv, int map) if (filter_map_one(&li->li_tv, expr, map, &rem) == FAIL || did_emsg) break; - if (!map && rem) - listitem_remove(l, li); - ++idx; + if (!map && rem) { + tv_list_item_remove(l, li); + } + idx++; } } @@ -9771,23 +8543,21 @@ static void filter_map(typval_T *argvars, typval_T *rettv, int map) did_emsg |= save_did_emsg; } - copy_tv(&argvars[0], rettv); + tv_copy(&argvars[0], rettv); } static int filter_map_one(typval_T *tv, typval_T *expr, int map, int *remp) { typval_T rettv; typval_T argv[3]; - char_u buf[NUMBUFLEN]; - char_u *s; int retval = FAIL; int dummy; - copy_tv(tv, &vimvars[VV_VAL].vv_tv); + tv_copy(tv, &vimvars[VV_VAL].vv_tv); argv[0] = vimvars[VV_KEY].vv_tv; argv[1] = vimvars[VV_VAL].vv_tv; if (expr->v_type == VAR_FUNC) { - s = expr->vval.v_string; + const char_u *const s = expr->vval.v_string; if (call_func(s, (int)STRLEN(s), &rettv, 2, argv, NULL, 0L, 0L, &dummy, true, NULL, NULL) == FAIL) { goto theend; @@ -9795,45 +8565,47 @@ static int filter_map_one(typval_T *tv, typval_T *expr, int map, int *remp) } else if (expr->v_type == VAR_PARTIAL) { partial_T *partial = expr->vval.v_partial; - s = partial_name(partial); + const char_u *const s = partial_name(partial); if (call_func(s, (int)STRLEN(s), &rettv, 2, argv, NULL, 0L, 0L, &dummy, true, partial, NULL) == FAIL) { goto theend; } } else { - s = get_tv_string_buf_chk(expr, buf); + char buf[NUMBUFLEN]; + const char *s = tv_get_string_buf_chk(expr, buf); if (s == NULL) { goto theend; } - s = skipwhite(s); - if (eval1(&s, &rettv, true) == FAIL) { + s = (const char *)skipwhite((const char_u *)s); + if (eval1((char_u **)&s, &rettv, true) == FAIL) { goto theend; } if (*s != NUL) { // check for trailing chars after expr - EMSG2(_(e_invexpr2), s); + emsgf(_(e_invexpr2), s); goto theend; } } if (map) { - /* map(): replace the list item value */ - clear_tv(tv); + // map(): replace the list item value. + tv_clear(tv); rettv.v_lock = 0; *tv = rettv; } else { - int error = FALSE; + bool error = false; - /* filter(): when expr is zero remove the item */ - *remp = (get_tv_number_chk(&rettv, &error) == 0); - clear_tv(&rettv); - /* On type error, nothing has been removed; return FAIL to stop the - * loop. The error message was given by get_tv_number_chk(). */ - if (error) + // filter(): when expr is zero remove the item + *remp = (tv_get_number_chk(&rettv, &error) == 0); + tv_clear(&rettv); + // On type error, nothing has been removed; return FAIL to stop the + // loop. The error message was given by tv_get_number_chk(). + if (error) { goto theend; + } } retval = OK; theend: - clear_tv(&vimvars[VV_VAL].vv_tv); + tv_clear(&vimvars[VV_VAL].vv_tv); return retval; } @@ -9868,13 +8640,14 @@ static void f_float2nr(typval_T *argvars, typval_T *rettv, FunPtr fptr) { float_T f; - if (get_float_arg(argvars, &f) == OK) { - if (f < -0x7fffffff) - rettv->vval.v_number = -0x7fffffff; - else if (f > 0x7fffffff) - rettv->vval.v_number = 0x7fffffff; - else + if (tv_get_float_chk(argvars, &f)) { + if (f <= -VARNUMBER_MAX + DBL_EPSILON) { + rettv->vval.v_number = -VARNUMBER_MAX; + } else if (f >= VARNUMBER_MAX - DBL_EPSILON) { + rettv->vval.v_number = VARNUMBER_MAX; + } else { rettv->vval.v_number = (varnumber_T)f; + } } } @@ -9883,14 +8656,15 @@ static void f_float2nr(typval_T *argvars, typval_T *rettv, FunPtr fptr) */ static void f_fmod(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - float_T fx, fy; + float_T fx; + float_T fy; rettv->v_type = VAR_FLOAT; - if (get_float_arg(argvars, &fx) == OK - && get_float_arg(&argvars[1], &fy) == OK) + if (tv_get_float_chk(argvars, &fx) && tv_get_float_chk(&argvars[1], &fy)) { rettv->vval.v_float = fmod(fx, fy); - else + } else { rettv->vval.v_float = 0.0; + } } /* @@ -9898,8 +8672,8 @@ static void f_fmod(typval_T *argvars, typval_T *rettv, FunPtr fptr) */ static void f_fnameescape(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - rettv->vval.v_string = vim_strsave_fnameescape( - get_tv_string(&argvars[0]), FALSE); + rettv->vval.v_string = (char_u *)vim_strsave_fnameescape( + tv_get_string(&argvars[0]), false); rettv->v_type = VAR_STRING; } @@ -9908,27 +8682,26 @@ static void f_fnameescape(typval_T *argvars, typval_T *rettv, FunPtr fptr) */ static void f_fnamemodify(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - char_u *fname; - char_u *mods; - size_t usedlen = 0; + char_u *fbuf = NULL; size_t len; - char_u *fbuf = NULL; - char_u buf[NUMBUFLEN]; - - fname = get_tv_string_chk(&argvars[0]); - mods = get_tv_string_buf_chk(&argvars[1], buf); - if (fname == NULL || mods == NULL) + char buf[NUMBUFLEN]; + const char *fname = tv_get_string_chk(&argvars[0]); + const char *const mods = tv_get_string_buf_chk(&argvars[1], buf); + if (fname == NULL || mods == NULL) { fname = NULL; - else { - len = STRLEN(fname); - (void)modify_fname(mods, &usedlen, &fname, &fbuf, &len); + } else { + len = strlen(fname); + size_t usedlen = 0; + (void)modify_fname((char_u *)mods, &usedlen, (char_u **)&fname, &fbuf, + &len); } rettv->v_type = VAR_STRING; - if (fname == NULL) + if (fname == NULL) { rettv->vval.v_string = NULL; - else - rettv->vval.v_string = vim_strnsave(fname, len); + } else { + rettv->vval.v_string = (char_u *)xmemdupz(fname, len); + } xfree(fbuf); } @@ -9938,16 +8711,16 @@ static void f_fnamemodify(typval_T *argvars, typval_T *rettv, FunPtr fptr) */ static void foldclosed_both(typval_T *argvars, typval_T *rettv, int end) { - linenr_T lnum; - linenr_T first, last; - - lnum = get_tv_lnum(argvars); + const linenr_T lnum = tv_get_lnum(argvars); if (lnum >= 1 && lnum <= curbuf->b_ml.ml_line_count) { - if (hasFoldingWin(curwin, lnum, &first, &last, FALSE, NULL)) { - if (end) + linenr_T first; + linenr_T last; + if (hasFoldingWin(curwin, lnum, &first, &last, false, NULL)) { + if (end) { rettv->vval.v_number = (varnumber_T)last; - else + } else { rettv->vval.v_number = (varnumber_T)first; + } return; } } @@ -9975,11 +8748,10 @@ static void f_foldclosedend(typval_T *argvars, typval_T *rettv, FunPtr fptr) */ static void f_foldlevel(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - linenr_T lnum; - - lnum = get_tv_lnum(argvars); - if (lnum >= 1 && lnum <= curbuf->b_ml.ml_line_count) + const linenr_T lnum = tv_get_lnum(argvars); + if (lnum >= 1 && lnum <= curbuf->b_ml.ml_line_count) { rettv->vval.v_number = foldLevel(lnum); + } } /* @@ -9995,7 +8767,6 @@ static void f_foldtext(typval_T *argvars, typval_T *rettv, FunPtr fptr) char_u *r; int len; char *txt; - long count; rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; @@ -10003,10 +8774,9 @@ static void f_foldtext(typval_T *argvars, typval_T *rettv, FunPtr fptr) foldstart = (linenr_T)get_vim_var_nr(VV_FOLDSTART); foldend = (linenr_T)get_vim_var_nr(VV_FOLDEND); dashes = get_vim_var_str(VV_FOLDDASHES); - if (foldstart > 0 && foldend <= curbuf->b_ml.ml_line_count - && dashes != NULL) { - /* Find first non-empty line in the fold. */ - for (lnum = foldstart; lnum < foldend; ++lnum) { + if (foldstart > 0 && foldend <= curbuf->b_ml.ml_line_count) { + // Find first non-empty line in the fold. + for (lnum = foldstart; lnum < foldend; lnum++) { if (!linewhite(lnum)) { break; } @@ -10023,8 +8793,8 @@ static void f_foldtext(typval_T *argvars, typval_T *rettv, FunPtr fptr) s = skipwhite(s + 1); } } - count = (long)(foldend - foldstart + 1); - txt = _("+-%s%3ld lines: "); + unsigned long count = (unsigned long)(foldend - foldstart + 1); + txt = ngettext("+-%s%3ld line: ", "+-%s%3ld lines: ", count); r = xmalloc(STRLEN(txt) + STRLEN(dashes) // for %s + 20 // for %3ld @@ -10043,24 +8813,24 @@ static void f_foldtext(typval_T *argvars, typval_T *rettv, FunPtr fptr) */ static void f_foldtextresult(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - linenr_T lnum; char_u *text; - char_u buf[51]; + char_u buf[FOLD_TEXT_LEN]; foldinfo_T foldinfo; int fold_count; rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; - lnum = get_tv_lnum(argvars); - /* treat illegal types and illegal string values for {lnum} the same */ - if (lnum < 0) + linenr_T lnum = tv_get_lnum(argvars); + // Treat illegal types and illegal string values for {lnum} the same. + if (lnum < 0) { lnum = 0; + } fold_count = foldedCount(curwin, lnum, &foldinfo); if (fold_count > 0) { - text = get_foldtext(curwin, lnum, lnum + fold_count - 1, - &foldinfo, buf); - if (text == buf) + text = get_foldtext(curwin, lnum, lnum + fold_count - 1, &foldinfo, buf); + if (text == buf) { text = vim_strsave(text); + } rettv->vval.v_string = text; } } @@ -10091,7 +8861,7 @@ static void common_function(typval_T *argvars, typval_T *rettv, s = partial_name(arg_pt); } else { // function('MyFunc', [arg], dict) - s = get_tv_string(&argvars[0]); + s = (char_u *)tv_get_string(&argvars[0]); use_string = true; } @@ -10106,7 +8876,9 @@ static void common_function(typval_T *argvars, typval_T *rettv, } if (s == NULL || *s == NUL || (use_string && ascii_isdigit(*s)) || (is_funcref && trans_name == NULL)) { - EMSG2(_(e_invarg2), use_string ? get_tv_string(&argvars[0]) : s); + emsgf(_(e_invarg2), (use_string + ? tv_get_string(&argvars[0]) + : (const char *)s)); // Don't check an autoload name for existence here. } else if (trans_name != NULL && (is_funcref ? find_func(trans_name) == NULL @@ -10127,10 +8899,8 @@ static void common_function(typval_T *argvars, typval_T *rettv, snprintf(sid_buf, sizeof(sid_buf), "%" PRId64 "_", (int64_t)current_SID); name = xmalloc(STRLEN(sid_buf) + STRLEN(s + off) + 1); - if (name != NULL) { - STRCPY(name, sid_buf); - STRCAT(name, s + off); - } + STRCPY(name, sid_buf); + STRCAT(name, s + off); } else { name = vim_strsave(s); } @@ -10180,20 +8950,15 @@ static void common_function(typval_T *argvars, typval_T *rettv, pt->pt_argc = arg_len + lv_len; pt->pt_argv = xmalloc(sizeof(pt->pt_argv[0]) * pt->pt_argc); - if (pt->pt_argv == NULL) { - xfree(pt); - xfree(name); - goto theend; - } int i = 0; for (; i < arg_len; i++) { - copy_tv(&arg_pt->pt_argv[i], &pt->pt_argv[i]); + tv_copy(&arg_pt->pt_argv[i], &pt->pt_argv[i]); } if (lv_len > 0) { for (listitem_T *li = list->lv_first; li != NULL; li = li->li_next) { - copy_tv(&li->li_tv, &pt->pt_argv[i++]); + tv_copy(&li->li_tv, &pt->pt_argv[i++]); } } } @@ -10254,12 +9019,13 @@ static void f_function(typval_T *argvars, typval_T *rettv, FunPtr fptr) /// "garbagecollect()" function static void f_garbagecollect(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - /* This is postponed until we are back at the toplevel, because we may be - * using Lists and Dicts internally. E.g.: ":echo [garbagecollect()]". */ - want_garbage_collect = TRUE; + // This is postponed until we are back at the toplevel, because we may be + // using Lists and Dicts internally. E.g.: ":echo [garbagecollect()]". + want_garbage_collect = true; - if (argvars[0].v_type != VAR_UNKNOWN && get_tv_number(&argvars[0]) == 1) - garbage_collect_at_exit = TRUE; + if (argvars[0].v_type != VAR_UNKNOWN && tv_get_number(&argvars[0]) == 1) { + garbage_collect_at_exit = true; + } } /* @@ -10275,20 +9041,21 @@ static void f_get(typval_T *argvars, typval_T *rettv, FunPtr fptr) if (argvars[0].v_type == VAR_LIST) { if ((l = argvars[0].vval.v_list) != NULL) { - int error = FALSE; + bool error = false; - li = list_find(l, get_tv_number_chk(&argvars[1], &error)); - if (!error && li != NULL) + li = tv_list_find(l, tv_get_number_chk(&argvars[1], &error)); + if (!error && li != NULL) { tv = &li->li_tv; + } } } else if (argvars[0].v_type == VAR_DICT) { if ((d = argvars[0].vval.v_dict) != NULL) { - di = dict_find(d, get_tv_string(&argvars[1]), -1); - if (di != NULL) + di = tv_dict_find(d, tv_get_string(&argvars[1]), -1); + if (di != NULL) { tv = &di->di_tv; + } } - } else if (argvars[0].v_type == VAR_PARTIAL - || argvars[0].v_type == VAR_FUNC) { + } else if (tv_is_func(argvars[0])) { partial_T *pt; partial_T fref_pt; @@ -10301,33 +9068,27 @@ static void f_get(typval_T *argvars, typval_T *rettv, FunPtr fptr) } if (pt != NULL) { - char_u *what = get_tv_string(&argvars[1]); - char_u *n; + const char *const what = tv_get_string(&argvars[1]); - if (STRCMP(what, "func") == 0 || STRCMP(what, "name") == 0) { + if (strcmp(what, "func") == 0 || strcmp(what, "name") == 0) { rettv->v_type = (*what == 'f' ? VAR_FUNC : VAR_STRING); - n = partial_name(pt); - if (n == NULL) { - rettv->vval.v_string = NULL; - } else { - rettv->vval.v_string = vim_strsave(n); - if (rettv->v_type == VAR_FUNC) { - func_ref(rettv->vval.v_string); - } + const char *const n = (const char *)partial_name(pt); + assert(n != NULL); + rettv->vval.v_string = (char_u *)xstrdup(n); + if (rettv->v_type == VAR_FUNC) { + func_ref(rettv->vval.v_string); } - } else if (STRCMP(what, "dict") == 0) { + } else if (strcmp(what, "dict") == 0) { rettv->v_type = VAR_DICT; rettv->vval.v_dict = pt->pt_dict; if (pt->pt_dict != NULL) { (pt->pt_dict->dv_refcount)++; } - } else if (STRCMP(what, "args") == 0) { + } else if (strcmp(what, "args") == 0) { rettv->v_type = VAR_LIST; - if (rettv_list_alloc(rettv) != NULL) { - int i; - - for (i = 0; i < pt->pt_argc; i++) { - list_append_tv(rettv->vval.v_list, &pt->pt_argv[i]); + if (tv_list_alloc_ret(rettv) != NULL) { + for (int i = 0; i < pt->pt_argc; i++) { + tv_list_append_tv(rettv->vval.v_list, &pt->pt_argv[i]); } } } else { @@ -10340,60 +9101,63 @@ static void f_get(typval_T *argvars, typval_T *rettv, FunPtr fptr) } if (tv == NULL) { - if (argvars[2].v_type != VAR_UNKNOWN) - copy_tv(&argvars[2], rettv); - } else - copy_tv(tv, rettv); + if (argvars[2].v_type != VAR_UNKNOWN) { + tv_copy(&argvars[2], rettv); + } + } else { + tv_copy(tv, rettv); + } } /// Returns information about signs placed in a buffer as list of dicts. static void get_buffer_signs(buf_T *buf, list_T *l) { for (signlist_T *sign = buf->b_signlist; sign; sign = sign->next) { - dict_T *d = dict_alloc(); + dict_T *const d = tv_dict_alloc(); - dict_add_nr_str(d, "id", sign->id, NULL); - dict_add_nr_str(d, "lnum", sign->lnum, NULL); - dict_add_nr_str(d, "name", 0L, sign_typenr2name(sign->typenr)); + tv_dict_add_nr(d, S_LEN("id"), sign->id); + tv_dict_add_nr(d, S_LEN("lnum"), sign->lnum); + tv_dict_add_str(d, S_LEN("name"), + (const char *)sign_typenr2name(sign->typenr)); - list_append_dict(l, d); + tv_list_append_dict(l, d); } } /// Returns buffer options, variables and other attributes in a dictionary. static dict_T *get_buffer_info(buf_T *buf) { - dict_T *dict = dict_alloc(); + dict_T *const dict = tv_dict_alloc(); - dict_add_nr_str(dict, "bufnr", buf->b_fnum, NULL); - dict_add_nr_str(dict, "name", 0L, - buf->b_ffname != NULL ? buf->b_ffname : (char_u *)""); - dict_add_nr_str(dict, "lnum", buflist_findlnum(buf), NULL); - dict_add_nr_str(dict, "loaded", buf->b_ml.ml_mfp != NULL, NULL); - dict_add_nr_str(dict, "listed", buf->b_p_bl, NULL); - dict_add_nr_str(dict, "changed", bufIsChanged(buf), NULL); - dict_add_nr_str(dict, "changedtick", buf->b_changedtick, NULL); - dict_add_nr_str(dict, "hidden", - buf->b_ml.ml_mfp != NULL && buf->b_nwindows == 0, - NULL); + tv_dict_add_nr(dict, S_LEN("bufnr"), buf->b_fnum); + tv_dict_add_str(dict, S_LEN("name"), + buf->b_ffname != NULL ? (const char *)buf->b_ffname : ""); + tv_dict_add_nr(dict, S_LEN("lnum"), + buf == curbuf ? curwin->w_cursor.lnum : buflist_findlnum(buf)); + tv_dict_add_nr(dict, S_LEN("loaded"), buf->b_ml.ml_mfp != NULL); + tv_dict_add_nr(dict, S_LEN("listed"), buf->b_p_bl); + tv_dict_add_nr(dict, S_LEN("changed"), bufIsChanged(buf)); + tv_dict_add_nr(dict, S_LEN("changedtick"), buf->b_changedtick); + tv_dict_add_nr(dict, S_LEN("hidden"), + buf->b_ml.ml_mfp != NULL && buf->b_nwindows == 0); // Get a reference to buffer variables - dict_add_dict(dict, "variables", buf->b_vars); + tv_dict_add_dict(dict, S_LEN("variables"), buf->b_vars); // List of windows displaying this buffer - list_T *windows = list_alloc(); + list_T *const windows = tv_list_alloc(); FOR_ALL_TAB_WINDOWS(tp, wp) { if (wp->w_buffer == buf) { - list_append_number(windows, (varnumber_T)wp->handle); + tv_list_append_number(windows, (varnumber_T)wp->handle); } } - dict_add_list(dict, "windows", windows); + tv_dict_add_list(dict, S_LEN("windows"), windows); if (buf->b_signlist != NULL) { // List of signs placed in this buffer - list_T *signs = list_alloc(); + list_T *const signs = tv_list_alloc(); get_buffer_signs(buf, signs); - dict_add_list(dict, "signs", signs); + tv_dict_add_list(dict, S_LEN("signs"), signs); } return dict; @@ -10407,7 +9171,7 @@ static void f_getbufinfo(typval_T *argvars, typval_T *rettv, FunPtr fptr) bool sel_buflisted = false; bool sel_bufloaded = false; - rettv_list_alloc(rettv); + tv_list_alloc_ret(rettv); // List of all the buffers or selected buffers if (argvars[0].v_type == VAR_DICT) { @@ -10418,24 +9182,25 @@ static void f_getbufinfo(typval_T *argvars, typval_T *rettv, FunPtr fptr) filtered = true; - di = dict_find(sel_d, (char_u *)"buflisted", -1); - if (di != NULL && get_tv_number(&di->di_tv)) { + di = tv_dict_find(sel_d, S_LEN("buflisted")); + if (di != NULL && tv_get_number(&di->di_tv)) { sel_buflisted = true; } - di = dict_find(sel_d, (char_u *)"bufloaded", -1); - if (di != NULL && get_tv_number(&di->di_tv)) { + di = tv_dict_find(sel_d, S_LEN("bufloaded")); + if (di != NULL && tv_get_number(&di->di_tv)) { sel_bufloaded = true; } } } else if (argvars[0].v_type != VAR_UNKNOWN) { // Information about one buffer. Argument specifies the buffer - (void)get_tv_number(&argvars[0]); // issue errmsg if type error - emsg_off++; - argbuf = get_buf_tv(&argvars[0], false); - emsg_off--; - if (argbuf == NULL) { - return; + if (tv_check_num(&argvars[0])) { // issue errmsg if type error + emsg_off++; + argbuf = get_buf_tv(&argvars[0], false); + emsg_off--; + if (argbuf == NULL) { + return; + } } } @@ -10449,10 +9214,8 @@ static void f_getbufinfo(typval_T *argvars, typval_T *rettv, FunPtr fptr) continue; } - dict_T *d = get_buffer_info(buf); - if (d != NULL) { - list_append_dict(rettv->vval.v_list, d); - } + dict_T *const d = get_buffer_info(buf); + tv_list_append_dict(rettv->vval.v_list, d); if (argbuf != NULL) { return; } @@ -10472,7 +9235,7 @@ static void get_buffer_lines(buf_T *buf, linenr_T start, linenr_T end, int retli rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; if (retlist) { - rettv_list_alloc(rettv); + tv_list_alloc_ret(rettv); } if (buf == NULL || buf->b_ml.ml_mfp == NULL || start < 0) @@ -10493,19 +9256,40 @@ static void get_buffer_lines(buf_T *buf, linenr_T start, linenr_T end, int retli if (end > buf->b_ml.ml_line_count) end = buf->b_ml.ml_line_count; while (start <= end) { - list_append_string( - rettv->vval.v_list, ml_get_buf(buf, start++, FALSE), -1); + tv_list_append_string(rettv->vval.v_list, + (const char *)ml_get_buf(buf, start++, false), -1); } } } +/// Get the line number from VimL object +/// +/// @note Unlike tv_get_lnum(), this one supports only "$" special string. +/// +/// @param[in] tv Object to get value from. Is expected to be a number or +/// a special string "$". +/// @param[in] buf Buffer to take last line number from in case tv is "$". May +/// be NULL, in this case "$" results in zero return. +/// +/// @return Line number or 0 in case of error. +static linenr_T tv_get_lnum_buf(const typval_T *const tv, + const buf_T *const buf) + FUNC_ATTR_NONNULL_ARG(1) FUNC_ATTR_WARN_UNUSED_RESULT +{ + if (tv->v_type == VAR_STRING + && tv->vval.v_string != NULL + && tv->vval.v_string[0] == '$' + && buf != NULL) { + return buf->b_ml.ml_line_count; + } + return tv_get_number_chk(tv, NULL); +} + /* * "getbufline()" function */ static void f_getbufline(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - linenr_T lnum; - linenr_T end; buf_T *buf = NULL; if (tv_check_str_or_nr(&argvars[0])) { @@ -10514,12 +9298,10 @@ static void f_getbufline(typval_T *argvars, typval_T *rettv, FunPtr fptr) emsg_off--; } - lnum = get_tv_lnum_buf(&argvars[1], buf); - if (argvars[2].v_type == VAR_UNKNOWN) { - end = lnum; - } else { - end = get_tv_lnum_buf(&argvars[2], buf); - } + const linenr_T lnum = tv_get_lnum_buf(&argvars[1], buf); + const linenr_T end = (argvars[2].v_type == VAR_UNKNOWN + ? lnum + : tv_get_lnum_buf(&argvars[2], buf)); get_buffer_lines(buf, lnum, end, true, rettv); } @@ -10538,7 +9320,7 @@ static void f_getbufvar(typval_T *argvars, typval_T *rettv, FunPtr fptr) goto f_getbufvar_end; } - const char *varname = (const char *)get_tv_string_chk(&argvars[1]); + const char *varname = tv_get_string_chk(&argvars[1]); emsg_off++; buf_T *const buf = get_buf_tv(&argvars[0], false); @@ -10568,7 +9350,7 @@ static void f_getbufvar(typval_T *argvars, typval_T *rettv, FunPtr fptr) dictitem_T *const v = find_var_in_ht(&curbuf->b_vars->dv_hashtab, 'b', varname, strlen(varname), false); if (v != NULL) { - copy_tv(&v->di_tv, rettv); + tv_copy(&v->di_tv, rettv); done = true; } } @@ -10581,7 +9363,7 @@ static void f_getbufvar(typval_T *argvars, typval_T *rettv, FunPtr fptr) f_getbufvar_end: if (!done && argvars[2].v_type != VAR_UNKNOWN) { // use the default value - copy_tv(&argvars[2], rettv); + tv_copy(&argvars[2], rettv); } } @@ -10591,10 +9373,9 @@ f_getbufvar_end: static void f_getchar(typval_T *argvars, typval_T *rettv, FunPtr fptr) { varnumber_T n; - int error = FALSE; + bool error = false; - ++no_mapping; - ++allow_keys; + no_mapping++; for (;; ) { // Position the cursor. Needed after a message that ends in a space, // or if event processing caused a redraw. @@ -10612,7 +9393,7 @@ static void f_getchar(typval_T *argvars, typval_T *rettv, FunPtr fptr) } } n = safe_vgetc(); - } else if (get_tv_number_chk(&argvars[0], &error) == 1) { + } else if (tv_get_number_chk(&argvars[0], &error) == 1) { // getchar(1): only check if char avail n = vpeekc_any(); } else if (error || vpeekc_any() == NUL) { @@ -10623,12 +9404,12 @@ static void f_getchar(typval_T *argvars, typval_T *rettv, FunPtr fptr) n = safe_vgetc(); } - if (n == K_IGNORE) + if (n == K_IGNORE) { continue; + } break; } - --no_mapping; - --allow_keys; + no_mapping--; vimvars[VV_MOUSE_WIN].vv_nr = 0; vimvars[VV_MOUSE_WINID].vv_nr = 0; @@ -10695,13 +9476,13 @@ static void f_getcharmod(typval_T *argvars, typval_T *rettv, FunPtr fptr) */ static void f_getcharsearch(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - rettv_dict_alloc(rettv); + tv_dict_alloc_ret(rettv); dict_T *dict = rettv->vval.v_dict; - dict_add_nr_str(dict, "char", 0L, last_csearch()); - dict_add_nr_str(dict, "forward", last_csearch_forward(), NULL); - dict_add_nr_str(dict, "until", last_csearch_until(), NULL); + tv_dict_add_str(dict, S_LEN("char"), last_csearch()); + tv_dict_add_nr(dict, S_LEN("forward"), last_csearch_forward()); + tv_dict_add_nr(dict, S_LEN("until"), last_csearch_until()); } /* @@ -10752,7 +9533,7 @@ static void f_getcompletion(typval_T *argvars, typval_T *rettv, FunPtr fptr) | WILD_NO_BEEP; if (argvars[2].v_type != VAR_UNKNOWN) { - filtered = get_tv_number_chk(&argvars[2], NULL); + filtered = (bool)tv_get_number_chk(&argvars[2], NULL); } if (p_wic) { @@ -10764,16 +9545,24 @@ static void f_getcompletion(typval_T *argvars, typval_T *rettv, FunPtr fptr) options |= WILD_KEEP_ALL; } + if (argvars[0].v_type != VAR_STRING || argvars[1].v_type != VAR_STRING) { + EMSG(_(e_invarg)); + return; + } + + if (strcmp(tv_get_string(&argvars[1]), "cmdline") == 0) { + set_one_cmd_context(&xpc, tv_get_string(&argvars[0])); + xpc.xp_pattern_len = (int)STRLEN(xpc.xp_pattern); + goto theend; + } + ExpandInit(&xpc); - xpc.xp_pattern = get_tv_string(&argvars[0]); + xpc.xp_pattern = (char_u *)tv_get_string(&argvars[0]); xpc.xp_pattern_len = (int)STRLEN(xpc.xp_pattern); - xpc.xp_context = cmdcomplete_str_to_type(get_tv_string(&argvars[1])); + xpc.xp_context = cmdcomplete_str_to_type( + (char_u *)tv_get_string(&argvars[1])); if (xpc.xp_context == EXPAND_NOTHING) { - if (argvars[1].v_type == VAR_STRING) { - EMSG2(_(e_invarg2), argvars[1].vval.v_string); - } else { - EMSG(_(e_invarg)); - } + EMSG2(_(e_invarg2), argvars[1].vval.v_string); return; } @@ -10783,7 +9572,7 @@ static void f_getcompletion(typval_T *argvars, typval_T *rettv, FunPtr fptr) } if (xpc.xp_context == EXPAND_CSCOPE) { - set_context_in_cscope_cmd(&xpc, xpc.xp_pattern, CMD_cscope); + set_context_in_cscope_cmd(&xpc, (const char *)xpc.xp_pattern, CMD_cscope); xpc.xp_pattern_len = (int)STRLEN(xpc.xp_pattern); } @@ -10792,14 +9581,14 @@ static void f_getcompletion(typval_T *argvars, typval_T *rettv, FunPtr fptr) xpc.xp_pattern_len = (int)STRLEN(xpc.xp_pattern); } +theend: pat = addstar(xpc.xp_pattern, xpc.xp_pattern_len, xpc.xp_context); - rettv_list_alloc(rettv); - if (pat != NULL) { - ExpandOne(&xpc, pat, NULL, options, WILD_ALL_KEEP); + tv_list_alloc_ret(rettv); + ExpandOne(&xpc, pat, NULL, options, WILD_ALL_KEEP); - for (int i = 0; i < xpc.xp_numfiles; i++) { - list_append_string(rettv->vval.v_list, xpc.xp_files[i], -1); - } + for (int i = 0; i < xpc.xp_numfiles; i++) { + tv_list_append_string(rettv->vval.v_list, (const char *)xpc.xp_files[i], + -1); } xfree(pat); ExpandCleanup(&xpc); @@ -10899,13 +9688,15 @@ static void f_getcwd(typval_T *argvars, typval_T *rettv, FunPtr fptr) if (from) { break; } - case kCdScopeTab: // FALLTHROUGH + // fallthrough + case kCdScopeTab: assert(tp); from = tp->tp_localdir; if (from) { break; } - case kCdScopeGlobal: // FALLTHROUGH + // fallthrough + case kCdScopeGlobal: if (globaldir) { // `globaldir` is not always set. from = globaldir; } else if (os_dirname(cwd, MAXPATHL) == FAIL) { // Get the OS CWD. @@ -10942,20 +9733,21 @@ static void f_getfontname(typval_T *argvars, typval_T *rettv, FunPtr fptr) */ static void f_getfperm(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - char_u *perm = NULL; + char *perm = NULL; char_u flags[] = "rwx"; - char_u *filename = get_tv_string(&argvars[0]); + const char *filename = tv_get_string(&argvars[0]); int32_t file_perm = os_getperm(filename); if (file_perm >= 0) { - perm = vim_strsave((char_u *)"---------"); + perm = xstrdup("---------"); for (int i = 0; i < 9; i++) { - if (file_perm & (1 << (8 - i))) + if (file_perm & (1 << (8 - i))) { perm[i] = flags[i % 3]; + } } } rettv->v_type = VAR_STRING; - rettv->vval.v_string = perm; + rettv->vval.v_string = (char_u *)perm; } /* @@ -10963,16 +9755,16 @@ static void f_getfperm(typval_T *argvars, typval_T *rettv, FunPtr fptr) */ static void f_getfsize(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - char *fname = (char *)get_tv_string(&argvars[0]); + const char *fname = tv_get_string(&argvars[0]); rettv->v_type = VAR_NUMBER; FileInfo file_info; if (os_fileinfo(fname, &file_info)) { uint64_t filesize = os_fileinfo_size(&file_info); - if (os_isdir((char_u *)fname)) + if (os_isdir((const char_u *)fname)) { rettv->vval.v_number = 0; - else { + } else { rettv->vval.v_number = (varnumber_T)filesize; /* non-perfect check for overflow */ @@ -10990,7 +9782,7 @@ static void f_getfsize(typval_T *argvars, typval_T *rettv, FunPtr fptr) */ static void f_getftime(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - char *fname = (char *)get_tv_string(&argvars[0]); + const char *fname = tv_get_string(&argvars[0]); FileInfo file_info; if (os_fileinfo(fname, &file_info)) { @@ -11005,15 +9797,14 @@ static void f_getftime(typval_T *argvars, typval_T *rettv, FunPtr fptr) */ static void f_getftype(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - char_u *fname; char_u *type = NULL; char *t; - fname = get_tv_string(&argvars[0]); + const char *fname = tv_get_string(&argvars[0]); rettv->v_type = VAR_STRING; FileInfo file_info; - if (os_fileinfo_link((char *)fname, &file_info)) { + if (os_fileinfo_link(fname, &file_info)) { uint64_t mode = file_info.stat.st_mode; #ifdef S_ISREG if (S_ISREG(mode)) @@ -11065,10 +9856,11 @@ static void f_getftype(typval_T *argvars, typval_T *rettv, FunPtr fptr) default: t = "other"; } # else - if (os_isdir(fname)) + if (os_isdir((const char_u *)fname)) { t = "dir"; - else + } else { t = "file"; + } # endif #endif type = vim_strsave((char_u *)t); @@ -11081,17 +9873,16 @@ static void f_getftype(typval_T *argvars, typval_T *rettv, FunPtr fptr) */ static void f_getline(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - linenr_T lnum; linenr_T end; - int retlist; + bool retlist; - lnum = get_tv_lnum(argvars); + const linenr_T lnum = tv_get_lnum(argvars); if (argvars[1].v_type == VAR_UNKNOWN) { end = 0; - retlist = FALSE; + retlist = false; } else { - end = get_tv_lnum(&argvars[1]); - retlist = TRUE; + end = tv_get_lnum(&argvars[1]); + retlist = true; } get_buffer_lines(curbuf, lnum, end, retlist, rettv); @@ -11101,12 +9892,12 @@ static void get_qf_loc_list(int is_qf, win_T *wp, typval_T *what_arg, typval_T *rettv) { if (what_arg->v_type == VAR_UNKNOWN) { - rettv_list_alloc(rettv); + tv_list_alloc_ret(rettv); if (is_qf || wp != NULL) { (void)get_errorlist(wp, -1, rettv->vval.v_list); } } else { - rettv_dict_alloc(rettv); + tv_dict_alloc_ret(rettv); if (is_qf || wp != NULL) { if (what_arg->v_type == VAR_DICT) { dict_T *d = what_arg->vval.v_dict; @@ -11136,43 +9927,45 @@ static void f_getmatches(typval_T *argvars, typval_T *rettv, FunPtr fptr) matchitem_T *cur = curwin->w_match_head; int i; - rettv_list_alloc(rettv); + tv_list_alloc_ret(rettv); while (cur != NULL) { - dict_T *dict = dict_alloc(); + dict_T *dict = tv_dict_alloc(); if (cur->match.regprog == NULL) { // match added with matchaddpos() for (i = 0; i < MAXPOSMATCH; ++i) { llpos_T *llpos; - char buf[6]; + char buf[6]; llpos = &cur->pos.pos[i]; if (llpos->lnum == 0) { break; } - list_T *l = list_alloc(); - list_append_number(l, (varnumber_T)llpos->lnum); + list_T *l = tv_list_alloc(); + tv_list_append_number(l, (varnumber_T)llpos->lnum); if (llpos->col > 0) { - list_append_number(l, (varnumber_T)llpos->col); - list_append_number(l, (varnumber_T)llpos->len); + tv_list_append_number(l, (varnumber_T)llpos->col); + tv_list_append_number(l, (varnumber_T)llpos->len); } - sprintf(buf, "pos%d", i + 1); - dict_add_list(dict, buf, l); + int len = snprintf(buf, sizeof(buf), "pos%d", i + 1); + assert((size_t)len < sizeof(buf)); + tv_dict_add_list(dict, buf, (size_t)len, l); } } else { - dict_add_nr_str(dict, "pattern", 0L, cur->pattern); + tv_dict_add_str(dict, S_LEN("pattern"), (const char *)cur->pattern); } - dict_add_nr_str(dict, "group", 0L, syn_id2name(cur->hlg_id)); - dict_add_nr_str(dict, "priority", (long)cur->priority, NULL); - dict_add_nr_str(dict, "id", (long)cur->id, NULL); + tv_dict_add_str(dict, S_LEN("group"), + (const char *)syn_id2name(cur->hlg_id)); + tv_dict_add_nr(dict, S_LEN("priority"), (varnumber_T)cur->priority); + tv_dict_add_nr(dict, S_LEN("id"), (varnumber_T)cur->id); if (cur->conceal_char) { - char_u buf[MB_MAXBYTES + 1]; + char buf[MB_MAXBYTES + 1]; - buf[(*mb_char2bytes)((int)cur->conceal_char, buf)] = NUL; - dict_add_nr_str(dict, "conceal", 0L, (char_u *)&buf); + buf[(*mb_char2bytes)((int)cur->conceal_char, (char_u *)buf)] = NUL; + tv_dict_add_str(dict, S_LEN("conceal"), buf); } - list_append_dict(rettv->vval.v_list, dict); + tv_list_append_dict(rettv->vval.v_list, dict); cur = cur->next; } } @@ -11196,20 +9989,22 @@ static void getpos_both(typval_T *argvars, typval_T *rettv, bool getcurpos) fp = var2fpos(&argvars[0], true, &fnum); } - list_T *l = rettv_list_alloc(rettv); - list_append_number(l, (fnum != -1) ? (varnumber_T)fnum : (varnumber_T)0); - list_append_number(l, (fp != NULL) ? (varnumber_T)fp->lnum : (varnumber_T)0); - list_append_number(l, - (fp != NULL) - ? (varnumber_T)(fp->col == MAXCOL ? MAXCOL : fp->col + 1) - : (varnumber_T)0); - list_append_number(l, - (fp != NULL) ? (varnumber_T)fp->coladd : (varnumber_T)0); + list_T *l = tv_list_alloc_ret(rettv); + tv_list_append_number(l, (fnum != -1) ? (varnumber_T)fnum : (varnumber_T)0); + tv_list_append_number(l, ((fp != NULL) + ? (varnumber_T)fp->lnum + : (varnumber_T)0)); + tv_list_append_number( + l, ((fp != NULL) + ? (varnumber_T)(fp->col == MAXCOL ? MAXCOL : fp->col + 1) + : (varnumber_T)0)); + tv_list_append_number( + l, (fp != NULL) ? (varnumber_T)fp->coladd : (varnumber_T)0); if (getcurpos) { update_curswant(); - list_append_number(l, curwin->w_curswant == MAXCOL + tv_list_append_number(l, (curwin->w_curswant == MAXCOL ? (varnumber_T)MAXCOL - : (varnumber_T)curwin->w_curswant + 1); + : (varnumber_T)curwin->w_curswant + 1)); } } @@ -11238,39 +10033,39 @@ static void f_getqflist(typval_T *argvars, typval_T *rettv, FunPtr fptr) /// "getreg()" function static void f_getreg(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - char_u *strregname; - int regname; + const char *strregname; int arg2 = false; bool return_list = false; - int error = false; + bool error = false; if (argvars[0].v_type != VAR_UNKNOWN) { - strregname = get_tv_string_chk(&argvars[0]); + strregname = tv_get_string_chk(&argvars[0]); error = strregname == NULL; if (argvars[1].v_type != VAR_UNKNOWN) { - arg2 = get_tv_number_chk(&argvars[1], &error); + arg2 = tv_get_number_chk(&argvars[1], &error); if (!error && argvars[2].v_type != VAR_UNKNOWN) { - return_list = get_tv_number_chk(&argvars[2], &error); + return_list = tv_get_number_chk(&argvars[2], &error); } } } else { - strregname = vimvars[VV_REG].vv_str; + strregname = (const char *)vimvars[VV_REG].vv_str; } if (error) { return; } - regname = (strregname == NULL ? '"' : *strregname); - if (regname == 0) + int regname = (uint8_t)(strregname == NULL ? '"' : *strregname); + if (regname == 0) { regname = '"'; + } if (return_list) { rettv->v_type = VAR_LIST; rettv->vval.v_list = get_reg_contents(regname, (arg2 ? kGRegExprSrc : 0) | kGRegList); if (rettv->vval.v_list == NULL) { - rettv->vval.v_list = list_alloc(); + rettv->vval.v_list = tv_list_alloc(); } rettv->vval.v_list->lv_refcount++; } else { @@ -11284,23 +10079,24 @@ static void f_getreg(typval_T *argvars, typval_T *rettv, FunPtr fptr) */ static void f_getregtype(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - char_u *strregname; - int regname; + const char *strregname; if (argvars[0].v_type != VAR_UNKNOWN) { - strregname = get_tv_string_chk(&argvars[0]); - if (strregname == NULL) { /* type error; errmsg already given */ + strregname = tv_get_string_chk(&argvars[0]); + if (strregname == NULL) { // Type error; errmsg already given. rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; return; } - } else - /* Default to v:register */ - strregname = vimvars[VV_REG].vv_str; + } else { + // Default to v:register. + strregname = (const char *)vimvars[VV_REG].vv_str; + } - regname = (strregname == NULL ? '"' : *strregname); - if (regname == 0) + int regname = (uint8_t)(strregname == NULL ? '"' : *strregname); + if (regname == 0) { regname = '"'; + } colnr_T reglen = 0; char buf[NUMBUFLEN + 2]; @@ -11315,18 +10111,18 @@ static void f_getregtype(typval_T *argvars, typval_T *rettv, FunPtr fptr) /// as a dictionary. static dict_T *get_tabpage_info(tabpage_T *tp, int tp_idx) { - dict_T *dict = dict_alloc(); + dict_T *const dict = tv_dict_alloc(); - dict_add_nr_str(dict, "tabnr", tp_idx, NULL); + tv_dict_add_nr(dict, S_LEN("tabnr"), tp_idx); - list_T *l = list_alloc(); + list_T *const l = tv_list_alloc(); FOR_ALL_WINDOWS_IN_TAB(wp, tp) { - list_append_number(l, (varnumber_T)wp->handle); + tv_list_append_number(l, (varnumber_T)wp->handle); } - dict_add_list(dict, "windows", l); + tv_dict_add_list(dict, S_LEN("windows"), l); // Make a reference to tabpage variables - dict_add_dict(dict, "variables", tp->tp_vars); + tv_dict_add_dict(dict, S_LEN("variables"), tp->tp_vars); return dict; } @@ -11336,11 +10132,11 @@ static void f_gettabinfo(typval_T *argvars, typval_T *rettv, FunPtr fptr) { tabpage_T *tparg = NULL; - rettv_list_alloc(rettv); + tv_list_alloc_ret(rettv); if (argvars[0].v_type != VAR_UNKNOWN) { // Information about one tab page - tparg = find_tabpage((int)get_tv_number_chk(&argvars[0], NULL)); + tparg = find_tabpage((int)tv_get_number_chk(&argvars[0], NULL)); if (tparg == NULL) { return; } @@ -11353,10 +10149,8 @@ static void f_gettabinfo(typval_T *argvars, typval_T *rettv, FunPtr fptr) if (tparg != NULL && tp != tparg) { continue; } - dict_T *d = get_tabpage_info(tp, tpnr); - if (d != NULL) { - list_append_dict(rettv->vval.v_list, d); - } + dict_T *const d = get_tabpage_info(tp, tpnr); + tv_list_append_dict(rettv->vval.v_list, d); if (tparg != NULL) { return; } @@ -11376,8 +10170,8 @@ static void f_gettabvar(typval_T *argvars, typval_T *rettv, FunPtr fptr) rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; - const char *const varname = (const char *)get_tv_string_chk(&argvars[1]); - tp = find_tabpage((int)get_tv_number_chk(&argvars[0], NULL)); + const char *const varname = tv_get_string_chk(&argvars[1]); + tp = find_tabpage((int)tv_get_number_chk(&argvars[0], NULL)); if (tp != NULL && varname != NULL) { // Set tp to be our tabpage, temporarily. Also set the window to the // first window in the tabpage, otherwise the window is not valid. @@ -11388,7 +10182,7 @@ static void f_gettabvar(typval_T *argvars, typval_T *rettv, FunPtr fptr) v = find_var_in_ht(&tp->tp_vars->dv_hashtab, 't', varname, strlen(varname), false); if (v != NULL) { - copy_tv(&v->di_tv, rettv); + tv_copy(&v->di_tv, rettv); done = true; } } @@ -11398,7 +10192,7 @@ static void f_gettabvar(typval_T *argvars, typval_T *rettv, FunPtr fptr) } if (!done && argvars[2].v_type != VAR_UNKNOWN) { - copy_tv(&argvars[2], rettv); + tv_copy(&argvars[2], rettv); } } @@ -11413,22 +10207,21 @@ static void f_gettabwinvar(typval_T *argvars, typval_T *rettv, FunPtr fptr) /// Returns information about a window as a dictionary. static dict_T *get_win_info(win_T *wp, int16_t tpnr, int16_t winnr) { - dict_T *dict = dict_alloc(); + dict_T *const dict = tv_dict_alloc(); - dict_add_nr_str(dict, "tabnr", tpnr, NULL); - dict_add_nr_str(dict, "winnr", winnr, NULL); - dict_add_nr_str(dict, "winid", wp->handle, NULL); - dict_add_nr_str(dict, "height", wp->w_height, NULL); - dict_add_nr_str(dict, "width", wp->w_width, NULL); - dict_add_nr_str(dict, "bufnr", wp->w_buffer->b_fnum, NULL); + tv_dict_add_nr(dict, S_LEN("tabnr"), tpnr); + tv_dict_add_nr(dict, S_LEN("winnr"), winnr); + tv_dict_add_nr(dict, S_LEN("winid"), wp->handle); + tv_dict_add_nr(dict, S_LEN("height"), wp->w_height); + tv_dict_add_nr(dict, S_LEN("width"), wp->w_width); + tv_dict_add_nr(dict, S_LEN("bufnr"), wp->w_buffer->b_fnum); - dict_add_nr_str(dict, "quickfix", bt_quickfix(wp->w_buffer), NULL); - dict_add_nr_str(dict, "loclist", - (bt_quickfix(wp->w_buffer) && wp->w_llist_ref != NULL), - NULL); + tv_dict_add_nr(dict, S_LEN("quickfix"), bt_quickfix(wp->w_buffer)); + tv_dict_add_nr(dict, S_LEN("loclist"), + (bt_quickfix(wp->w_buffer) && wp->w_llist_ref != NULL)); // Add a reference to window variables - dict_add_dict(dict, "variables", wp->w_vars); + tv_dict_add_dict(dict, S_LEN("variables"), wp->w_vars); return dict; } @@ -11438,7 +10231,7 @@ static void f_getwininfo(typval_T *argvars, typval_T *rettv, FunPtr fptr) { win_T *wparg = NULL; - rettv_list_alloc(rettv); + tv_list_alloc_ret(rettv); if (argvars[0].v_type != VAR_UNKNOWN) { wparg = win_id2wp(argvars); @@ -11458,10 +10251,8 @@ static void f_getwininfo(typval_T *argvars, typval_T *rettv, FunPtr fptr) continue; } winnr++; - dict_T *d = get_win_info(wp, tabnr, winnr); - if (d != NULL) { - list_append_dict(rettv->vval.v_list, d); - } + dict_T *const d = get_win_info(wp, tabnr, winnr); + tv_list_append_dict(rettv->vval.v_list, d); if (wparg != NULL) { // found information about a specific window return; @@ -11495,7 +10286,7 @@ find_win_by_nr ( tabpage_T *tp /* NULL for current tab page */ ) { - int nr = get_tv_number_chk(vp, NULL); + int nr = (int)tv_get_number_chk(vp, NULL); if (nr < 0) { return NULL; @@ -11530,7 +10321,7 @@ static win_T *find_tabwin(typval_T *wvp, typval_T *tvp) if (wvp->v_type != VAR_UNKNOWN) { if (tvp->v_type != VAR_UNKNOWN) { - long n = get_tv_number(tvp); + long n = tv_get_number(tvp); if (n >= 0) { tp = find_tabpage(n); } @@ -11570,13 +10361,13 @@ getwinvar ( tabpage_T *oldtabpage = NULL; bool done = false; - if (off == 1) - tp = find_tabpage((int)get_tv_number_chk(&argvars[0], NULL)); - else + if (off == 1) { + tp = find_tabpage((int)tv_get_number_chk(&argvars[0], NULL)); + } else { tp = curtab; + } win = find_win_by_nr(&argvars[off], tp); - const char *varname = (const char *)get_tv_string_chk( - &argvars[off + 1]); + const char *varname = tv_get_string_chk(&argvars[off + 1]); rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; @@ -11610,7 +10401,7 @@ getwinvar ( v = find_var_in_ht(&win->w_vars->dv_hashtab, 'w', varname, strlen(varname), false); if (v != NULL) { - copy_tv(&v->di_tv, rettv); + tv_copy(&v->di_tv, rettv); done = true; } } @@ -11625,7 +10416,7 @@ getwinvar ( if (!done && argvars[off + 2].v_type != VAR_UNKNOWN) { // use the default return value - copy_tv(&argvars[off + 2], rettv); + tv_copy(&argvars[off + 2], rettv); } } @@ -11636,21 +10427,22 @@ static void f_glob(typval_T *argvars, typval_T *rettv, FunPtr fptr) { int options = WILD_SILENT|WILD_USE_NL; expand_T xpc; - int error = FALSE; + bool error = false; /* When the optional second argument is non-zero, don't remove matches * for 'wildignore' and don't put matches for 'suffixes' at the end. */ rettv->v_type = VAR_STRING; if (argvars[1].v_type != VAR_UNKNOWN) { - if (get_tv_number_chk(&argvars[1], &error)) + if (tv_get_number_chk(&argvars[1], &error)) { options |= WILD_KEEP_ALL; + } if (argvars[2].v_type != VAR_UNKNOWN) { - if (get_tv_number_chk(&argvars[2], &error)) { + if (tv_get_number_chk(&argvars[2], &error)) { rettv->v_type = VAR_LIST; rettv->vval.v_list = NULL; } if (argvars[3].v_type != VAR_UNKNOWN - && get_tv_number_chk(&argvars[3], &error)) { + && tv_get_number_chk(&argvars[3], &error)) { options |= WILD_ALLLINKS; } } @@ -11660,14 +10452,16 @@ static void f_glob(typval_T *argvars, typval_T *rettv, FunPtr fptr) xpc.xp_context = EXPAND_FILES; if (p_wic) options += WILD_ICASE; - if (rettv->v_type == VAR_STRING) - rettv->vval.v_string = ExpandOne(&xpc, get_tv_string(&argvars[0]), - NULL, options, WILD_ALL); - else { - rettv_list_alloc(rettv); - ExpandOne(&xpc, get_tv_string(&argvars[0]), NULL, options, WILD_ALL_KEEP); + if (rettv->v_type == VAR_STRING) { + rettv->vval.v_string = ExpandOne( + &xpc, (char_u *)tv_get_string(&argvars[0]), NULL, options, WILD_ALL); + } else { + tv_list_alloc_ret(rettv); + ExpandOne(&xpc, (char_u *)tv_get_string(&argvars[0]), NULL, options, + WILD_ALL_KEEP); for (int i = 0; i < xpc.xp_numfiles; i++) { - list_append_string(rettv->vval.v_list, xpc.xp_files[i], -1); + tv_list_append_string(rettv->vval.v_list, (const char *)xpc.xp_files[i], + -1); } ExpandCleanup(&xpc); } @@ -11679,7 +10473,7 @@ static void f_glob(typval_T *argvars, typval_T *rettv, FunPtr fptr) static void f_globpath(typval_T *argvars, typval_T *rettv, FunPtr fptr) { int flags = 0; // Flags for globpath. - int error = false; + bool error = false; // Return a string, or a list if the optional third argument is non-zero. rettv->v_type = VAR_STRING; @@ -11687,36 +10481,36 @@ static void f_globpath(typval_T *argvars, typval_T *rettv, FunPtr fptr) if (argvars[2].v_type != VAR_UNKNOWN) { // When the optional second argument is non-zero, don't remove matches // for 'wildignore' and don't put matches for 'suffixes' at the end. - if (get_tv_number_chk(&argvars[2], &error)) { + if (tv_get_number_chk(&argvars[2], &error)) { flags |= WILD_KEEP_ALL; } if (argvars[3].v_type != VAR_UNKNOWN) { - if (get_tv_number_chk(&argvars[3], &error)) { + if (tv_get_number_chk(&argvars[3], &error)) { rettv->v_type = VAR_LIST; rettv->vval.v_list = NULL; } if (argvars[4].v_type != VAR_UNKNOWN - && get_tv_number_chk(&argvars[4], &error)) { + && tv_get_number_chk(&argvars[4], &error)) { flags |= WILD_ALLLINKS; } } } - char_u buf1[NUMBUFLEN]; - char_u *file = get_tv_string_buf_chk(&argvars[1], buf1); + char buf1[NUMBUFLEN]; + const char *const file = tv_get_string_buf_chk(&argvars[1], buf1); if (file != NULL && !error) { garray_T ga; ga_init(&ga, (int)sizeof(char_u *), 10); - globpath(get_tv_string(&argvars[0]), file, &ga, flags); + globpath((char_u *)tv_get_string(&argvars[0]), (char_u *)file, &ga, flags); if (rettv->v_type == VAR_STRING) { rettv->vval.v_string = ga_concat_strings_sep(&ga, "\n"); } else { - rettv_list_alloc(rettv); + tv_list_alloc_ret(rettv); for (int i = 0; i < ga.ga_len; i++) { - list_append_string(rettv->vval.v_list, - ((char_u **)(ga.ga_data))[i], -1); + tv_list_append_string(rettv->vval.v_list, + ((const char **)(ga.ga_data))[i], -1); } } @@ -11729,18 +10523,19 @@ static void f_globpath(typval_T *argvars, typval_T *rettv, FunPtr fptr) // "glob2regpat()" function static void f_glob2regpat(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - char_u *pat = get_tv_string_chk(&argvars[0]); // NULL on type error + const char *const pat = tv_get_string_chk(&argvars[0]); // NULL on type error rettv->v_type = VAR_STRING; - rettv->vval.v_string = (pat == NULL) - ? NULL - : file_pat_to_reg_pat(pat, NULL, NULL, false); + rettv->vval.v_string = ((pat == NULL) + ? NULL + : file_pat_to_reg_pat((char_u *)pat, NULL, NULL, + false)); } /// "has()" function static void f_has(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - static char *(has_list[]) = { + static const char *const has_list[] = { #ifdef UNIX "unix", #endif @@ -11808,6 +10603,7 @@ static void f_has(typval_T *argvars, typval_T *rettv, FunPtr fptr) "mouse", "multi_byte", "multi_lang", + "num64", "packages", "path_extra", "persistent_undo", @@ -11851,13 +10647,11 @@ static void f_has(typval_T *argvars, typval_T *rettv, FunPtr fptr) "winaltkeys", "writebackup", "nvim", - NULL }; bool n = false; - char *name = (char *)get_tv_string(&argvars[0]); - - for (int i = 0; has_list[i] != NULL; i++) { + const char *const name = tv_get_string(&argvars[0]); + for (size_t i = 0; i < ARRAY_SIZE(has_list); i++) { if (STRICMP(name, has_list[i]) == 0) { n = true; break; @@ -11888,6 +10682,10 @@ static void f_has(typval_T *argvars, typval_T *rettv, FunPtr fptr) n = has_nvim_version(name + 5); } else if (STRICMP(name, "vim_starting") == 0) { n = (starting != 0); + } else if (STRICMP(name, "ttyin") == 0) { + n = stdin_isatty; + } else if (STRICMP(name, "ttyout") == 0) { + n = stdout_isatty; } else if (STRICMP(name, "multi_byte_encoding") == 0) { n = has_mbyte != 0; #if defined(USE_ICONV) && defined(DYNAMIC_ICONV) @@ -11922,8 +10720,9 @@ static void f_has_key(typval_T *argvars, typval_T *rettv, FunPtr fptr) if (argvars[0].vval.v_dict == NULL) return; - rettv->vval.v_number = dict_find(argvars[0].vval.v_dict, - get_tv_string(&argvars[1]), -1) != NULL; + rettv->vval.v_number = tv_dict_find(argvars[0].vval.v_dict, + tv_get_string(&argvars[1]), + -1) != NULL; } /// `haslocaldir([{win}[, {tab}]])` function @@ -12032,24 +10831,24 @@ static void f_haslocaldir(typval_T *argvars, typval_T *rettv, FunPtr fptr) */ static void f_hasmapto(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - char_u *name; - char_u *mode; - char_u buf[NUMBUFLEN]; - int abbr = FALSE; - - name = get_tv_string(&argvars[0]); - if (argvars[1].v_type == VAR_UNKNOWN) - mode = (char_u *)"nvo"; - else { - mode = get_tv_string_buf(&argvars[1], buf); - if (argvars[2].v_type != VAR_UNKNOWN) - abbr = get_tv_number(&argvars[2]); + const char *mode; + const char *const name = tv_get_string(&argvars[0]); + bool abbr = false; + char buf[NUMBUFLEN]; + if (argvars[1].v_type == VAR_UNKNOWN) { + mode = "nvo"; + } else { + mode = tv_get_string_buf(&argvars[1], buf); + if (argvars[2].v_type != VAR_UNKNOWN) { + abbr = tv_get_number(&argvars[2]); + } } - if (map_to_exists(name, mode, abbr)) - rettv->vval.v_number = TRUE; - else - rettv->vval.v_number = FALSE; + if (map_to_exists(name, mode, abbr)) { + rettv->vval.v_number = true; + } else { + rettv->vval.v_number = false; + } } /* @@ -12058,20 +10857,19 @@ static void f_hasmapto(typval_T *argvars, typval_T *rettv, FunPtr fptr) static void f_histadd(typval_T *argvars, typval_T *rettv, FunPtr fptr) { HistoryType histype; - char_u *str; - char_u buf[NUMBUFLEN]; rettv->vval.v_number = false; if (check_restricted() || check_secure()) { return; } - str = get_tv_string_chk(&argvars[0]); // NULL on type error - histype = str != NULL ? get_histtype(str, STRLEN(str), false) : HIST_INVALID; + const char *str = tv_get_string_chk(&argvars[0]); // NULL on type error + histype = str != NULL ? get_histtype(str, strlen(str), false) : HIST_INVALID; if (histype != HIST_INVALID) { - str = get_tv_string_buf(&argvars[1], buf); + char buf[NUMBUFLEN]; + str = tv_get_string_buf(&argvars[1], buf); if (*str != NUL) { init_history(); - add_to_history(histype, str, false, NUL); + add_to_history(histype, (char_u *)str, false, NUL); rettv->vval.v_number = true; return; } @@ -12084,23 +10882,21 @@ static void f_histadd(typval_T *argvars, typval_T *rettv, FunPtr fptr) static void f_histdel(typval_T *argvars, typval_T *rettv, FunPtr fptr) { int n; - char_u buf[NUMBUFLEN]; - char_u *str; - - str = get_tv_string_chk(&argvars[0]); // NULL on type error + const char *const str = tv_get_string_chk(&argvars[0]); // NULL on type error if (str == NULL) { n = 0; } else if (argvars[1].v_type == VAR_UNKNOWN) { // only one argument: clear entire history - n = clr_history(get_histtype(str, STRLEN(str), false)); + n = clr_history(get_histtype(str, strlen(str), false)); } else if (argvars[1].v_type == VAR_NUMBER) { // index given: remove that entry - n = del_history_idx(get_histtype(str, STRLEN(str), false), - (int) get_tv_number(&argvars[1])); + n = del_history_idx(get_histtype(str, strlen(str), false), + (int)tv_get_number(&argvars[1])); } else { // string given: remove all matching entries - n = del_history_entry(get_histtype(str, STRLEN(str), false), - get_tv_string_buf(&argvars[1], buf)); + char buf[NUMBUFLEN]; + n = del_history_entry(get_histtype(str, strlen(str), false), + (char_u *)tv_get_string_buf(&argvars[1], buf)); } rettv->vval.v_number = n; } @@ -12112,17 +10908,16 @@ static void f_histget(typval_T *argvars, typval_T *rettv, FunPtr fptr) { HistoryType type; int idx; - char_u *str; - str = get_tv_string_chk(&argvars[0]); // NULL on type error + const char *const str = tv_get_string_chk(&argvars[0]); // NULL on type error if (str == NULL) { rettv->vval.v_string = NULL; } else { - type = get_histtype(str, STRLEN(str), false); + type = get_histtype(str, strlen(str), false); if (argvars[1].v_type == VAR_UNKNOWN) { idx = get_history_idx(type); } else { - idx = (int)get_tv_number_chk(&argvars[1], NULL); + idx = (int)tv_get_number_chk(&argvars[1], NULL); } // -1 on type error rettv->vval.v_string = vim_strsave(get_history_entry(type, idx)); @@ -12137,9 +10932,9 @@ static void f_histnr(typval_T *argvars, typval_T *rettv, FunPtr fptr) { int i; - char_u *history = get_tv_string_chk(&argvars[0]); + const char *const history = tv_get_string_chk(&argvars[0]); - i = history == NULL ? HIST_CMD - 1 : get_histtype(history, STRLEN(history), + i = history == NULL ? HIST_CMD - 1 : get_histtype(history, strlen(history), false); if (i != HIST_INVALID) { i = get_history_idx(i); @@ -12154,7 +10949,8 @@ static void f_histnr(typval_T *argvars, typval_T *rettv, FunPtr fptr) */ static void f_hlID(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - rettv->vval.v_number = syn_name2id(get_tv_string(&argvars[0])); + rettv->vval.v_number = syn_name2id( + (const char_u *)tv_get_string(&argvars[0])); } /* @@ -12162,7 +10958,8 @@ static void f_hlID(typval_T *argvars, typval_T *rettv, FunPtr fptr) */ static void f_hlexists(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - rettv->vval.v_number = highlight_exists(get_tv_string(&argvars[0])); + rettv->vval.v_number = highlight_exists( + (const char_u *)tv_get_string(&argvars[0])); } /* @@ -12182,25 +10979,27 @@ static void f_hostname(typval_T *argvars, typval_T *rettv, FunPtr fptr) */ static void f_iconv(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - char_u buf1[NUMBUFLEN]; - char_u buf2[NUMBUFLEN]; - char_u *from, *to, *str; vimconv_T vimconv; rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; - str = get_tv_string(&argvars[0]); - from = enc_canonize(enc_skip(get_tv_string_buf(&argvars[1], buf1))); - to = enc_canonize(enc_skip(get_tv_string_buf(&argvars[2], buf2))); + const char *const str = tv_get_string(&argvars[0]); + char buf1[NUMBUFLEN]; + char_u *const from = enc_canonize(enc_skip( + (char_u *)tv_get_string_buf(&argvars[1], buf1))); + char buf2[NUMBUFLEN]; + char_u *const to = enc_canonize(enc_skip( + (char_u *)tv_get_string_buf(&argvars[2], buf2))); vimconv.vc_type = CONV_NONE; convert_setup(&vimconv, from, to); - /* If the encodings are equal, no conversion needed. */ - if (vimconv.vc_type == CONV_NONE) - rettv->vval.v_string = vim_strsave(str); - else - rettv->vval.v_string = string_convert(&vimconv, str, NULL); + // If the encodings are equal, no conversion needed. + if (vimconv.vc_type == CONV_NONE) { + rettv->vval.v_string = (char_u *)xstrdup(str); + } else { + rettv->vval.v_string = string_convert(&vimconv, (char_u *)str, NULL); + } convert_setup(&vimconv, NULL, NULL); xfree(from); @@ -12212,13 +11011,12 @@ static void f_iconv(typval_T *argvars, typval_T *rettv, FunPtr fptr) */ static void f_indent(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - linenr_T lnum; - - lnum = get_tv_lnum(argvars); - if (lnum >= 1 && lnum <= curbuf->b_ml.ml_line_count) + const linenr_T lnum = tv_get_lnum(argvars); + if (lnum >= 1 && lnum <= curbuf->b_ml.ml_line_count) { rettv->vval.v_number = get_indent_lnum(lnum); - else + } else { rettv->vval.v_number = -1; + } } /* @@ -12240,16 +11038,18 @@ static void f_index(typval_T *argvars, typval_T *rettv, FunPtr fptr) if (l != NULL) { item = l->lv_first; if (argvars[2].v_type != VAR_UNKNOWN) { - int error = FALSE; + bool error = false; - /* Start at specified item. Use the cached index that list_find() - * sets, so that a negative number also works. */ - item = list_find(l, get_tv_number_chk(&argvars[2], &error)); + // Start at specified item. Use the cached index that tv_list_find() + // sets, so that a negative number also works. + item = tv_list_find(l, tv_get_number_chk(&argvars[2], &error)); idx = l->lv_idx; - if (argvars[3].v_type != VAR_UNKNOWN) - ic = get_tv_number_chk(&argvars[3], &error); - if (error) + if (argvars[3].v_type != VAR_UNKNOWN) { + ic = tv_get_number_chk(&argvars[3], &error); + } + if (error) { item = NULL; + } } for (; item != NULL; item = item->li_next, ++idx) @@ -12269,85 +11069,132 @@ static int inputsecret_flag = 0; * prompt. The third argument to f_inputdialog() specifies the value to return * when the user cancels the prompt. */ -static void get_user_input(typval_T *argvars, typval_T *rettv, int inputdialog) +void get_user_input(const typval_T *const argvars, + typval_T *const rettv, const bool inputdialog) + FUNC_ATTR_NONNULL_ALL { - char_u *prompt = get_tv_string_chk(&argvars[0]); - char_u *p = NULL; - int c; - char_u buf[NUMBUFLEN]; - int cmd_silent_save = cmd_silent; - char_u *defstr = (char_u *)""; - int xp_type = EXPAND_NOTHING; - char_u *xp_arg = NULL; - rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; - cmd_silent = FALSE; /* Want to see the prompt. */ - if (prompt != NULL) { - /* Only the part of the message after the last NL is considered as - * prompt for the command line */ - p = vim_strrchr(prompt, '\n'); - if (p == NULL) - p = prompt; - else { - ++p; - c = *p; - *p = NUL; - msg_start(); - msg_clr_eos(); - msg_puts_attr((const char *)prompt, echo_attr); - msg_didout = false; - msg_starthere(); - *p = c; - } - cmdline_row = msg_row; - + const char *prompt = ""; + const char *defstr = ""; + const char *cancelreturn = NULL; + const char *xp_name = NULL; + Callback input_callback = { .type = kCallbackNone }; + char prompt_buf[NUMBUFLEN]; + char defstr_buf[NUMBUFLEN]; + char cancelreturn_buf[NUMBUFLEN]; + char xp_name_buf[NUMBUFLEN]; + if (argvars[0].v_type == VAR_DICT) { if (argvars[1].v_type != VAR_UNKNOWN) { - defstr = get_tv_string_buf_chk(&argvars[1], buf); - if (defstr != NULL) - stuffReadbuffSpec(defstr); - - if (!inputdialog && argvars[2].v_type != VAR_UNKNOWN) { - char_u *xp_name; - int xp_namelen; - uint32_t argt; - - /* input() with a third argument: completion */ - rettv->vval.v_string = NULL; - - xp_name = get_tv_string_buf_chk(&argvars[2], buf); - if (xp_name == NULL) - return; - - xp_namelen = (int)STRLEN(xp_name); - - if (parse_compl_arg(xp_name, xp_namelen, &xp_type, &argt, - &xp_arg) == FAIL) + emsgf(_("E5050: {opts} must be the only argument")); + return; + } + dict_T *const dict = argvars[0].vval.v_dict; + prompt = tv_dict_get_string_buf_chk(dict, S_LEN("prompt"), prompt_buf, ""); + if (prompt == NULL) { + return; + } + defstr = tv_dict_get_string_buf_chk(dict, S_LEN("default"), defstr_buf, ""); + if (defstr == NULL) { + return; + } + char def[1] = { 0 }; + cancelreturn = tv_dict_get_string_buf_chk(dict, S_LEN("cancelreturn"), + cancelreturn_buf, def); + if (cancelreturn == NULL) { // error + return; + } + if (*cancelreturn == NUL) { + cancelreturn = NULL; + } + xp_name = tv_dict_get_string_buf_chk(dict, S_LEN("completion"), + xp_name_buf, def); + if (xp_name == NULL) { // error + return; + } + if (xp_name == def) { // default to NULL + xp_name = NULL; + } + if (!tv_dict_get_callback(dict, S_LEN("highlight"), &input_callback)) { + return; + } + } else { + prompt = tv_get_string_buf_chk(&argvars[0], prompt_buf); + if (prompt == NULL) { + return; + } + if (argvars[1].v_type != VAR_UNKNOWN) { + defstr = tv_get_string_buf_chk(&argvars[1], defstr_buf); + if (defstr == NULL) { + return; + } + if (argvars[2].v_type != VAR_UNKNOWN) { + const char *const arg2 = tv_get_string_buf_chk(&argvars[2], + cancelreturn_buf); + if (arg2 == NULL) { return; + } + if (inputdialog) { + cancelreturn = arg2; + } else { + xp_name = arg2; + } } } - - if (defstr != NULL) { - int save_ex_normal_busy = ex_normal_busy; - ex_normal_busy = 0; - rettv->vval.v_string = - getcmdline_prompt(inputsecret_flag ? NUL : '@', p, echo_attr, - xp_type, xp_arg); - ex_normal_busy = save_ex_normal_busy; - } - if (inputdialog && rettv->vval.v_string == NULL - && argvars[1].v_type != VAR_UNKNOWN - && argvars[2].v_type != VAR_UNKNOWN) - rettv->vval.v_string = vim_strsave(get_tv_string_buf( - &argvars[2], buf)); - - xfree(xp_arg); - - /* since the user typed this, no need to wait for return */ - need_wait_return = FALSE; - msg_didout = FALSE; } + + int xp_type = EXPAND_NOTHING; + char *xp_arg = NULL; + if (xp_name != NULL) { + // input() with a third argument: completion + const int xp_namelen = (int)strlen(xp_name); + + uint32_t argt; + if (parse_compl_arg((char_u *)xp_name, xp_namelen, &xp_type, + &argt, (char_u **)&xp_arg) == FAIL) { + return; + } + } + + int cmd_silent_save = cmd_silent; + + cmd_silent = false; // Want to see the prompt. + // Only the part of the message after the last NL is considered as + // prompt for the command line, unlsess cmdline is externalized + const char *p = prompt; + if (!ui_is_external(kUICmdline)) { + const char *lastnl = strrchr(prompt, '\n'); + if (lastnl != NULL) { + p = lastnl+1; + msg_start(); + msg_clr_eos(); + msg_puts_attr_len(prompt, p - prompt, echo_attr); + msg_didout = false; + msg_starthere(); + } + } + cmdline_row = msg_row; + + stuffReadbuffSpec(defstr); + + const int save_ex_normal_busy = ex_normal_busy; + ex_normal_busy = 0; + rettv->vval.v_string = + (char_u *)getcmdline_prompt(inputsecret_flag ? NUL : '@', p, echo_attr, + xp_type, xp_arg, input_callback); + ex_normal_busy = save_ex_normal_busy; + callback_free(&input_callback); + + if (rettv->vval.v_string == NULL && cancelreturn != NULL) { + rettv->vval.v_string = (char_u *)xstrdup(cancelreturn); + } + + xfree(xp_arg); + + // Since the user typed this, no need to wait for return. + need_wait_return = false; + msg_didout = false; cmd_silent = cmd_silent_save; } @@ -12389,7 +11236,7 @@ static void f_inputlist(typval_T *argvars, typval_T *rettv, FunPtr fptr) msg_clr_eos(); for (li = argvars[0].vval.v_list->lv_first; li != NULL; li = li->li_next) { - msg_puts((const char *)get_tv_string(&li->li_tv)); + msg_puts(tv_get_string(&li->li_tv)); msg_putchar('\n'); } @@ -12447,37 +11294,34 @@ static void f_inputsecret(typval_T *argvars, typval_T *rettv, FunPtr fptr) */ static void f_insert(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - long before = 0; - listitem_T *item; - list_T *l; - int error = false; - const char *const arg_errmsg = _("insert() argument"); - const size_t arg_errmsg_len = strlen(arg_errmsg); + list_T *l; + bool error = false; if (argvars[0].v_type != VAR_LIST) { EMSG2(_(e_listarg), "insert()"); } else if ((l = argvars[0].vval.v_list) != NULL - && !tv_check_lock(l->lv_lock, arg_errmsg, arg_errmsg_len)) { + && !tv_check_lock(l->lv_lock, N_("insert() argument"), + TV_TRANSLATE)) { + long before = 0; if (argvars[2].v_type != VAR_UNKNOWN) { - before = get_tv_number_chk(&argvars[2], &error); + before = tv_get_number_chk(&argvars[2], &error); } if (error) { // type error; errmsg already given return; } - if (before == l->lv_len) - item = NULL; - else { - item = list_find(l, before); + listitem_T *item = NULL; + if (before != l->lv_len) { + item = tv_list_find(l, before); if (item == NULL) { EMSGN(_(e_listidx), before); l = NULL; } } if (l != NULL) { - list_insert_tv(l, &argvars[1], item); - copy_tv(&argvars[0], rettv); + tv_list_insert_tv(l, &argvars[1], item); + tv_copy(&argvars[0], rettv); } } } @@ -12487,7 +11331,7 @@ static void f_insert(typval_T *argvars, typval_T *rettv, FunPtr fptr) */ static void f_invert(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - rettv->vval.v_number = ~get_tv_number_chk(&argvars[0], NULL); + rettv->vval.v_number = ~tv_get_number_chk(&argvars[0], NULL); } /* @@ -12495,7 +11339,7 @@ static void f_invert(typval_T *argvars, typval_T *rettv, FunPtr fptr) */ static void f_isdirectory(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - rettv->vval.v_number = os_isdir(get_tv_string(&argvars[0])); + rettv->vval.v_number = os_isdir((const char_u *)tv_get_string(&argvars[0])); } /* @@ -12504,18 +11348,20 @@ static void f_isdirectory(typval_T *argvars, typval_T *rettv, FunPtr fptr) static void f_islocked(typval_T *argvars, typval_T *rettv, FunPtr fptr) { lval_T lv; - char_u *end; dictitem_T *di; rettv->vval.v_number = -1; - end = get_lval(get_tv_string(&argvars[0]), NULL, &lv, false, false, - GLV_NO_AUTOLOAD|GLV_READ_ONLY, FNE_CHECK_START); + const char_u *const end = get_lval((char_u *)tv_get_string(&argvars[0]), + NULL, + &lv, false, false, + GLV_NO_AUTOLOAD|GLV_READ_ONLY, + FNE_CHECK_START); if (end != NULL && lv.ll_name != NULL) { - if (*end != NUL) + if (*end != NUL) { EMSG(_(e_trailing)); - else { + } else { if (lv.ll_tv == NULL) { - di = find_var((const char *)lv.ll_name, STRLEN(lv.ll_name), NULL, true); + di = find_var((const char *)lv.ll_name, lv.ll_name_len, NULL, true); if (di != NULL) { // Consider a variable locked when: // 1. the variable itself is locked @@ -12542,68 +11388,61 @@ static void f_islocked(typval_T *argvars, typval_T *rettv, FunPtr fptr) } -/* - * Turn a dict into a list: - * "what" == 0: list of keys - * "what" == 1: list of values - * "what" == 2: list of items - */ -static void dict_list(typval_T *argvars, typval_T *rettv, int what) +/// Turn a dictionary into a list +/// +/// @param[in] tv Dictionary to convert. Is checked for actually being +/// a dictionary, will give an error if not. +/// @param[out] rettv Location where result will be saved. +/// @param[in] what What to save in rettv. +static void dict_list(typval_T *const tv, typval_T *const rettv, + const DictListType what) { - list_T *l2; - dictitem_T *di; - hashitem_T *hi; - listitem_T *li; - listitem_T *li2; - dict_T *d; - int todo; - - if (argvars[0].v_type != VAR_DICT) { - EMSG(_(e_dictreq)); + if (tv->v_type != VAR_DICT) { + emsgf(_(e_dictreq)); return; } - if ((d = argvars[0].vval.v_dict) == NULL) + if (tv->vval.v_dict == NULL) { return; + } - rettv_list_alloc(rettv); + tv_list_alloc_ret(rettv); - todo = (int)d->dv_hashtab.ht_used; - for (hi = d->dv_hashtab.ht_array; todo > 0; ++hi) { - if (!HASHITEM_EMPTY(hi)) { - --todo; - di = HI2DI(hi); + TV_DICT_ITER(tv->vval.v_dict, di, { + listitem_T *const li = tv_list_item_alloc(); + tv_list_append(rettv->vval.v_list, li); - li = listitem_alloc(); - list_append(rettv->vval.v_list, li); - - if (what == 0) { - /* keys() */ + switch (what) { + case kDictListKeys: { li->li_tv.v_type = VAR_STRING; - li->li_tv.v_lock = 0; + li->li_tv.v_lock = VAR_UNLOCKED; li->li_tv.vval.v_string = vim_strsave(di->di_key); - } else if (what == 1) { - /* values() */ - copy_tv(&di->di_tv, &li->li_tv); - } else { - /* items() */ - l2 = list_alloc(); + break; + } + case kDictListValues: { + tv_copy(&di->di_tv, &li->li_tv); + break; + } + case kDictListItems: { + // items() + list_T *const sub_l = tv_list_alloc(); li->li_tv.v_type = VAR_LIST; - li->li_tv.v_lock = 0; - li->li_tv.vval.v_list = l2; - ++l2->lv_refcount; + li->li_tv.v_lock = VAR_UNLOCKED; + li->li_tv.vval.v_list = sub_l; + sub_l->lv_refcount++; - li2 = listitem_alloc(); - list_append(l2, li2); - li2->li_tv.v_type = VAR_STRING; - li2->li_tv.v_lock = 0; - li2->li_tv.vval.v_string = vim_strsave(di->di_key); + listitem_T *sub_li = tv_list_item_alloc(); + tv_list_append(sub_l, sub_li); + sub_li->li_tv.v_type = VAR_STRING; + sub_li->li_tv.v_lock = VAR_UNLOCKED; + sub_li->li_tv.vval.v_string = vim_strsave(di->di_key); - li2 = listitem_alloc(); - list_append(l2, li2); - copy_tv(&di->di_tv, &li2->li_tv); + sub_li = tv_list_item_alloc(); + tv_list_append(sub_l, sub_li); + tv_copy(&di->di_tv, &sub_li->li_tv); + break; } } - } + }); } /// "id()" function @@ -12624,68 +11463,6 @@ static void f_items(typval_T *argvars, typval_T *rettv, FunPtr fptr) dict_list(argvars, rettv, 2); } -// "jobclose(id[, stream])" function -static void f_jobclose(typval_T *argvars, typval_T *rettv, FunPtr fptr) -{ - rettv->v_type = VAR_NUMBER; - rettv->vval.v_number = 0; - - if (check_restricted() || check_secure()) { - return; - } - - if (argvars[0].v_type != VAR_NUMBER || (argvars[1].v_type != VAR_STRING - && argvars[1].v_type != VAR_UNKNOWN)) { - EMSG(_(e_invarg)); - return; - } - - TerminalJobData *data = find_job(argvars[0].vval.v_number); - if (!data) { - EMSG(_(e_invjob)); - return; - } - - Process *proc = (Process *)&data->proc; - - if (argvars[1].v_type == VAR_STRING) { - char *stream = (char *)argvars[1].vval.v_string; - if (!strcmp(stream, "stdin")) { - if (data->rpc) { - EMSG(_("Invalid stream on rpc job, use jobclose(id, 'rpc')")); - } else { - process_close_in(proc); - } - } else if (!strcmp(stream, "stdout")) { - if (data->rpc) { - EMSG(_("Invalid stream on rpc job, use jobclose(id, 'rpc')")); - } else { - process_close_out(proc); - } - } else if (!strcmp(stream, "stderr")) { - process_close_err(proc); - } else if (!strcmp(stream, "rpc")) { - if (data->rpc) { - channel_close(data->id); - } else { - EMSG(_("Invalid job stream: Not an rpc job")); - } - } else { - EMSG2(_("Invalid job stream \"%s\""), stream); - } - } else { - if (data->rpc) { - channel_close(data->id); - process_close_err(proc); - } else { - process_close_streams(proc); - if (proc->type == kProcessTypePty) { - pty_process_close_master(&data->proc.pty); - } - } - } -} - // "jobpid(id)" function static void f_jobpid(typval_T *argvars, typval_T *rettv, FunPtr fptr) { @@ -12701,61 +11478,15 @@ static void f_jobpid(typval_T *argvars, typval_T *rettv, FunPtr fptr) return; } - TerminalJobData *data = find_job(argvars[0].vval.v_number); + Channel *data = find_job(argvars[0].vval.v_number, true); if (!data) { - EMSG(_(e_invjob)); return; } - Process *proc = (Process *)&data->proc; + Process *proc = (Process *)&data->stream.proc; rettv->vval.v_number = proc->pid; } -// "jobsend()" function -static void f_jobsend(typval_T *argvars, typval_T *rettv, FunPtr fptr) -{ - rettv->v_type = VAR_NUMBER; - rettv->vval.v_number = 0; - - if (check_restricted() || check_secure()) { - return; - } - - if (argvars[0].v_type != VAR_NUMBER || argvars[1].v_type == VAR_UNKNOWN) { - // First argument is the job id and second is the string or list to write - // to the job's stdin - EMSG(_(e_invarg)); - return; - } - - TerminalJobData *data = find_job(argvars[0].vval.v_number); - if (!data) { - EMSG(_(e_invjob)); - return; - } - - if (((Process *)&data->proc)->in->closed) { - EMSG(_("Can't send data to the job: stdin is closed")); - return; - } - - if (data->rpc) { - EMSG(_("Can't send raw data to rpc channel")); - return; - } - - ssize_t input_len; - char *input = (char *) save_tv_as_string(&argvars[1], &input_len, false); - if (!input) { - // Either the error has been handled by save_tv_as_string(), or there is no - // input to send. - return; - } - - WBuffer *buf = wstream_new_buffer(input, input_len, 1, xfree); - rettv->vval.v_number = wstream_write(data->proc.uv.process.in, buf); -} - // "jobresize(job, width, height)" function static void f_jobresize(typval_T *argvars, typval_T *rettv, FunPtr fptr) { @@ -12774,26 +11505,25 @@ static void f_jobresize(typval_T *argvars, typval_T *rettv, FunPtr fptr) } - TerminalJobData *data = find_job(argvars[0].vval.v_number); + Channel *data = find_job(argvars[0].vval.v_number, true); if (!data) { - EMSG(_(e_invjob)); return; } - if (data->proc.uv.process.type != kProcessTypePty) { - EMSG(_(e_jobnotpty)); + if (data->stream.proc.type != kProcessTypePty) { + EMSG(_(e_channotpty)); return; } - pty_process_resize(&data->proc.pty, argvars[1].vval.v_number, - argvars[2].vval.v_number); + pty_process_resize(&data->stream.pty, argvars[1].vval.v_number, + argvars[2].vval.v_number); rettv->vval.v_number = 1; } -static char **tv_to_argv(typval_T *cmd_tv, char **cmd, bool *executable) +static char **tv_to_argv(typval_T *cmd_tv, const char **cmd, bool *executable) { if (cmd_tv->v_type == VAR_STRING) { - char *cmd_str = (char *)get_tv_string(cmd_tv); + const char *cmd_str = tv_get_string(cmd_tv); if (cmd) { *cmd = cmd_str; } @@ -12814,8 +11544,8 @@ static char **tv_to_argv(typval_T *cmd_tv, char **cmd, bool *executable) assert(argl->lv_first); - const char_u *exe = get_tv_string_chk(&argl->lv_first->li_tv); - if (!exe || !os_can_exe(exe, NULL, true)) { + const char *exe = tv_get_string_chk(&argl->lv_first->li_tv); + if (!exe || !os_can_exe((const char_u *)exe, NULL, true)) { if (exe && executable) { *executable = false; } @@ -12823,16 +11553,16 @@ static char **tv_to_argv(typval_T *cmd_tv, char **cmd, bool *executable) } if (cmd) { - *cmd = (char *)exe; + *cmd = exe; } // Build the argument vector int i = 0; char **argv = xcalloc(argc + 1, sizeof(char *)); for (listitem_T *arg = argl->lv_first; arg != NULL; arg = arg->li_next) { - char *a = (char *)get_tv_string_chk(&arg->li_tv); + const char *a = tv_get_string_chk(&arg->li_tv); if (!a) { - // Did emsg in get_tv_string; just deallocate argv. + // Did emsg in tv_get_string_chk; just deallocate argv. shell_free_argv(argv); return NULL; } @@ -12868,23 +11598,26 @@ static void f_jobstart(typval_T *argvars, typval_T *rettv, FunPtr fptr) dict_T *job_opts = NULL; - bool detach = false, rpc = false, pty = false; - Callback on_stdout = CALLBACK_NONE, on_stderr = CALLBACK_NONE, - on_exit = CALLBACK_NONE; + bool detach = false; + bool rpc = false; + bool pty = false; + CallbackReader on_stdout = CALLBACK_READER_INIT, + on_stderr = CALLBACK_READER_INIT; + Callback on_exit = CALLBACK_NONE; char *cwd = NULL; if (argvars[1].v_type == VAR_DICT) { job_opts = argvars[1].vval.v_dict; - detach = get_dict_number(job_opts, "detach") != 0; - rpc = get_dict_number(job_opts, "rpc") != 0; - pty = get_dict_number(job_opts, "pty") != 0; + detach = tv_dict_get_number(job_opts, "detach") != 0; + rpc = tv_dict_get_number(job_opts, "rpc") != 0; + pty = tv_dict_get_number(job_opts, "pty") != 0; if (pty && rpc) { EMSG2(_(e_invarg2), "job cannot have both 'pty' and 'rpc' options set"); shell_free_argv(argv); return; } - char *new_cwd = (char *)get_dict_string(job_opts, "cwd", false); + char *new_cwd = tv_dict_get_string(job_opts, "cwd", false); if (new_cwd && strlen(new_cwd) > 0) { cwd = new_cwd; // The new cwd must be a directory. @@ -12901,32 +11634,21 @@ static void f_jobstart(typval_T *argvars, typval_T *rettv, FunPtr fptr) } } - TerminalJobData *data = common_job_init(argv, on_stdout, on_stderr, on_exit, - pty, rpc, detach, cwd); - Process *proc = (Process *)&data->proc; + uint16_t width = 0, height = 0; + char *term_name = NULL; if (pty) { - uint16_t width = get_dict_number(job_opts, "width"); - if (width > 0) { - data->proc.pty.width = width; - } - uint16_t height = get_dict_number(job_opts, "height"); - if (height > 0) { - data->proc.pty.height = height; - } - char *term = (char *)get_dict_string(job_opts, "TERM", true); - if (term) { - data->proc.pty.term_name = term; - } + width = (uint16_t)tv_dict_get_number(job_opts, "width"); + height = (uint16_t)tv_dict_get_number(job_opts, "height"); + term_name = tv_dict_get_string(job_opts, "TERM", true); } - if (!rpc && on_stdout.type == kCallbackNone) { - proc->out = NULL; + Channel *chan = channel_job_start(argv, on_stdout, on_stderr, on_exit, pty, + rpc, detach, cwd, width, height, term_name, + &rettv->vval.v_number); + if (chan) { + channel_create_event(chan, NULL); } - if (on_stderr.type == kCallbackNone) { - proc->err = NULL; - } - common_job_start(data, rettv); } // "jobstop()" function @@ -12946,14 +11668,12 @@ static void f_jobstop(typval_T *argvars, typval_T *rettv, FunPtr fptr) } - TerminalJobData *data = find_job(argvars[0].vval.v_number); + Channel *data = find_job(argvars[0].vval.v_number, true); if (!data) { - EMSG(_(e_invjob)); return; } - process_stop((Process *)&data->proc); - data->stopped = true; + process_stop((Process *)&data->stream.proc); rettv->vval.v_number = 1; } @@ -12973,28 +11693,31 @@ static void f_jobwait(typval_T *argvars, typval_T *rettv, FunPtr fptr) return; } + list_T *args = argvars[0].vval.v_list; - list_T *rv = list_alloc(); + Channel **jobs = xcalloc(args->lv_len, sizeof(*jobs)); ui_busy_start(); MultiQueue *waiting_jobs = multiqueue_new_parent(loop_on_put, &main_loop); // For each item in the input list append an integer to the output list. -3 // is used to represent an invalid job id, -2 is for a interrupted job and // -1 for jobs that were skipped or timed out. - for (listitem_T *arg = args->lv_first; arg != NULL; arg = arg->li_next) { - TerminalJobData *data = NULL; + + int i = 0; + for (listitem_T *arg = args->lv_first; arg != NULL; arg = arg->li_next, i++) { + Channel *chan = NULL; if (arg->li_tv.v_type != VAR_NUMBER - || !(data = find_job(arg->li_tv.vval.v_number))) { - list_append_number(rv, -3); + || !(chan = find_job(arg->li_tv.vval.v_number, false))) { + jobs[i] = NULL; } else { - // append the list item and set the status pointer so we'll collect the - // status code when the job exits - list_append_number(rv, -1); - data->status_ptr = &rv->lv_last->li_tv.vval.v_number; - // Process any pending events for the job because we'll temporarily - // replace the parent queue - multiqueue_process_events(data->events); - multiqueue_replace_parent(data->events, waiting_jobs); + jobs[i] = chan; + channel_incref(chan); + if (chan->stream.proc.status < 0) { + // Process any pending events for the job because we'll temporarily + // replace the parent queue + multiqueue_process_events(chan->events); + multiqueue_replace_parent(chan->events, waiting_jobs); + } } } @@ -13005,24 +11728,21 @@ static void f_jobwait(typval_T *argvars, typval_T *rettv, FunPtr fptr) before = os_hrtime(); } - for (listitem_T *arg = args->lv_first; arg != NULL; arg = arg->li_next) { - TerminalJobData *data = NULL; + for (i = 0; i < args->lv_len; i++) { if (remaining == 0) { // timed out break; } - if (arg->li_tv.v_type != VAR_NUMBER - || !(data = find_job(arg->li_tv.vval.v_number))) { + + // if the job already exited, but wasn't freed yet + if (jobs[i] == NULL || jobs[i]->stream.proc.status >= 0) { continue; } - int status = process_wait((Process *)&data->proc, remaining, waiting_jobs); + + int status = process_wait(&jobs[i]->stream.proc, remaining, + waiting_jobs); if (status < 0) { // interrupted or timed out, skip remaining jobs. - if (status == -2) { - // set the status so the user can distinguish between interrupted and - // skipped/timeout jobs. - *data->status_ptr = -2; - } break; } if (remaining > 0) { @@ -13035,30 +11755,24 @@ static void f_jobwait(typval_T *argvars, typval_T *rettv, FunPtr fptr) } } - for (listitem_T *arg = args->lv_first; arg != NULL; arg = arg->li_next) { - TerminalJobData *data = NULL; - if (arg->li_tv.v_type != VAR_NUMBER - || !(data = find_job(arg->li_tv.vval.v_number))) { - continue; - } - // remove the status pointer because the list may be freed before the - // job exits - data->status_ptr = NULL; - } + list_T *rv = tv_list_alloc(); // restore the parent queue for any jobs still alive - for (listitem_T *arg = args->lv_first; arg != NULL; arg = arg->li_next) { - TerminalJobData *data = NULL; - if (arg->li_tv.v_type != VAR_NUMBER - || !(data = pmap_get(uint64_t)(jobs, arg->li_tv.vval.v_number))) { + for (i = 0; i < args->lv_len; i++) { + if (jobs[i] == NULL) { + tv_list_append_number(rv, -3); continue; } // restore the parent queue for the job - multiqueue_process_events(data->events); - multiqueue_replace_parent(data->events, main_loop.events); + multiqueue_process_events(jobs[i]->events); + multiqueue_replace_parent(jobs[i]->events, main_loop.events); + + tv_list_append_number(rv, jobs[i]->stream.proc.status); + channel_decref(jobs[i]); } multiqueue_free(waiting_jobs); + xfree(jobs); ui_busy_stop(); rv->lv_refcount++; rettv->v_type = VAR_LIST; @@ -13070,50 +11784,49 @@ static void f_jobwait(typval_T *argvars, typval_T *rettv, FunPtr fptr) */ static void f_join(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - garray_T ga; - char_u *sep; - if (argvars[0].v_type != VAR_LIST) { EMSG(_(e_listreq)); return; } - if (argvars[0].vval.v_list == NULL) + if (argvars[0].vval.v_list == NULL) { return; - if (argvars[1].v_type == VAR_UNKNOWN) - sep = (char_u *)" "; - else - sep = get_tv_string_chk(&argvars[1]); + } + const char *const sep = (argvars[1].v_type == VAR_UNKNOWN + ? " " + : tv_get_string_chk(&argvars[1])); rettv->v_type = VAR_STRING; if (sep != NULL) { + garray_T ga; ga_init(&ga, (int)sizeof(char), 80); - list_join(&ga, argvars[0].vval.v_list, (char *) sep); + tv_list_join(&ga, argvars[0].vval.v_list, sep); ga_append(&ga, NUL); rettv->vval.v_string = (char_u *)ga.ga_data; - } else + } else { rettv->vval.v_string = NULL; + } } /// json_decode() function static void f_json_decode(typval_T *argvars, typval_T *rettv, FunPtr fptr) { char numbuf[NUMBUFLEN]; - char *s = NULL; + const char *s = NULL; char *tofree = NULL; size_t len; if (argvars[0].v_type == VAR_LIST) { - if (!encode_vim_list_to_buf(argvars[0].vval.v_list, &len, &s)) { + if (!encode_vim_list_to_buf(argvars[0].vval.v_list, &len, &tofree)) { EMSG(_("E474: Failed to convert list to string")); return; } - tofree = s; + s = tofree; if (s == NULL) { assert(len == 0); s = ""; } } else { - s = (char *) get_tv_string_buf_chk(&argvars[0], (char_u *) numbuf); + s = tv_get_string_buf_chk(&argvars[0], numbuf); if (s) { len = strlen(s); } else { @@ -13166,24 +11879,28 @@ static void f_last_buffer_nr(typval_T *argvars, typval_T *rettv, FunPtr fptr) static void f_len(typval_T *argvars, typval_T *rettv, FunPtr fptr) { switch (argvars[0].v_type) { - case VAR_STRING: - case VAR_NUMBER: - rettv->vval.v_number = (varnumber_T)STRLEN( - get_tv_string(&argvars[0])); - break; - case VAR_LIST: - rettv->vval.v_number = list_len(argvars[0].vval.v_list); - break; - case VAR_DICT: - rettv->vval.v_number = dict_len(argvars[0].vval.v_dict); - break; - case VAR_UNKNOWN: - case VAR_SPECIAL: - case VAR_FLOAT: - case VAR_FUNC: - case VAR_PARTIAL: - EMSG(_("E701: Invalid type for len()")); - break; + case VAR_STRING: + case VAR_NUMBER: { + rettv->vval.v_number = (varnumber_T)strlen( + tv_get_string(&argvars[0])); + break; + } + case VAR_LIST: { + rettv->vval.v_number = tv_list_len(argvars[0].vval.v_list); + break; + } + case VAR_DICT: { + rettv->vval.v_number = tv_dict_len(argvars[0].vval.v_dict); + break; + } + case VAR_UNKNOWN: + case VAR_SPECIAL: + case VAR_FLOAT: + case VAR_PARTIAL: + case VAR_FUNC: { + EMSG(_("E701: Invalid type for len()")); + break; + } } } @@ -13268,15 +11985,15 @@ static void f_line(typval_T *argvars, typval_T *rettv, FunPtr fptr) */ static void f_line2byte(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - linenr_T lnum; - - lnum = get_tv_lnum(argvars); - if (lnum < 1 || lnum > curbuf->b_ml.ml_line_count + 1) + const linenr_T lnum = tv_get_lnum(argvars); + if (lnum < 1 || lnum > curbuf->b_ml.ml_line_count + 1) { rettv->vval.v_number = -1; - else + } else { rettv->vval.v_number = ml_find_line_or_offset(curbuf, lnum, NULL); - if (rettv->vval.v_number >= 0) - ++rettv->vval.v_number; + } + if (rettv->vval.v_number >= 0) { + rettv->vval.v_number++; + } } /* @@ -13284,17 +12001,15 @@ static void f_line2byte(typval_T *argvars, typval_T *rettv, FunPtr fptr) */ static void f_lispindent(typval_T *argvars, typval_T *rettv, FunPtr fptr) { - pos_T pos; - linenr_T lnum; - - pos = curwin->w_cursor; - lnum = get_tv_lnum(argvars); + const pos_T pos = curwin->w_cursor; + const linenr_T lnum = tv_get_lnum(argvars); if (lnum >= 1 && lnum <= curbuf->b_ml.ml_line_count) { curwin->w_cursor.lnum = lnum; rettv->vval.v_number = get_lisp_indent(); curwin->w_cursor = pos; - } else + } else { rettv->vval.v_number = -1; + } } /* @@ -13308,73 +12023,119 @@ static void f_localtime(typval_T *argvars, typval_T *rettv, FunPtr fptr) static void get_maparg(typval_T *argvars, typval_T *rettv, int exact) { - char_u *keys; - char_u *which; - char_u buf[NUMBUFLEN]; - char_u *keys_buf = NULL; - char_u *rhs; + char_u *keys_buf = NULL; + char_u *rhs; int mode; int abbr = FALSE; int get_dict = FALSE; mapblock_T *mp; int buffer_local; - /* return empty string for failure */ + // Return empty string for failure. rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; - keys = get_tv_string(&argvars[0]); - if (*keys == NUL) + char_u *keys = (char_u *)tv_get_string(&argvars[0]); + if (*keys == NUL) { return; + } + char buf[NUMBUFLEN]; + const char *which; if (argvars[1].v_type != VAR_UNKNOWN) { - which = get_tv_string_buf_chk(&argvars[1], buf); + which = tv_get_string_buf_chk(&argvars[1], buf); if (argvars[2].v_type != VAR_UNKNOWN) { - abbr = get_tv_number(&argvars[2]); - if (argvars[3].v_type != VAR_UNKNOWN) - get_dict = get_tv_number(&argvars[3]); + abbr = tv_get_number(&argvars[2]); + if (argvars[3].v_type != VAR_UNKNOWN) { + get_dict = tv_get_number(&argvars[3]); + } } - } else - which = (char_u *)""; - if (which == NULL) + } else { + which = ""; + } + if (which == NULL) { return; + } - mode = get_map_mode(&which, 0); + mode = get_map_mode((char_u **)&which, 0); - keys = replace_termcodes(keys, STRLEN(keys), &keys_buf, true, true, false, + keys = replace_termcodes(keys, STRLEN(keys), &keys_buf, true, true, true, CPO_TO_CPO_FLAGS); rhs = check_map(keys, mode, exact, false, abbr, &mp, &buffer_local); xfree(keys_buf); if (!get_dict) { - /* Return a string. */ - if (rhs != NULL) - rettv->vval.v_string = str2special_save(rhs, FALSE); + // Return a string. + if (rhs != NULL) { + rettv->vval.v_string = (char_u *)str2special_save( + (const char *)rhs, false, false); + } } else { - rettv_dict_alloc(rettv); + tv_dict_alloc_ret(rettv); if (rhs != NULL) { // Return a dictionary. - char_u *lhs = str2special_save(mp->m_keys, true); - char *const mapmode = map_mode_to_chars(mp->m_mode); - dict_T *dict = rettv->vval.v_dict; - - dict_add_nr_str(dict, "lhs", 0L, lhs); - dict_add_nr_str(dict, "rhs", 0L, mp->m_orig_str); - dict_add_nr_str(dict, "noremap", mp->m_noremap ? 1L : 0L, NULL); - dict_add_nr_str(dict, "expr", mp->m_expr ? 1L : 0L, NULL); - dict_add_nr_str(dict, "silent", mp->m_silent ? 1L : 0L, NULL); - dict_add_nr_str(dict, "sid", (long)mp->m_script_ID, NULL); - dict_add_nr_str(dict, "buffer", (long)buffer_local, NULL); - dict_add_nr_str(dict, "nowait", mp->m_nowait ? 1L : 0L, NULL); - dict_add_nr_str(dict, "mode", 0L, (char_u *)mapmode); - - xfree(lhs); - xfree(mapmode); + mapblock_fill_dict(rettv->vval.v_dict, mp, buffer_local, true); } } } +/// luaeval() function implementation +static void f_luaeval(typval_T *argvars, typval_T *rettv, FunPtr fptr) + FUNC_ATTR_NONNULL_ALL +{ + const char *const str = (const char *)tv_get_string_chk(&argvars[0]); + if (str == NULL) { + return; + } + + executor_eval_lua(cstr_as_string((char *)str), &argvars[1], rettv); +} + +/// Fill a dictionary with all applicable maparg() like dictionaries +/// +/// @param dict The dictionary to be filled +/// @param mp The maphash that contains the mapping information +/// @param buffer_value The "buffer" value +/// @param compatible True for compatible with old maparg() dict +void mapblock_fill_dict(dict_T *const dict, + const mapblock_T *const mp, + long buffer_value, + bool compatible) + FUNC_ATTR_NONNULL_ALL +{ + char *const lhs = str2special_save((const char *)mp->m_keys, + compatible, !compatible); + char *const mapmode = map_mode_to_chars(mp->m_mode); + varnumber_T noremap_value; + + if (compatible) { + // Keep old compatible behavior + // This is unable to determine whether a mapping is a