New installer: 2021-04-29
This commit is contained in:
		| @@ -102,7 +102,7 @@ | ||||
|       <match extended="true"> | ||||
|         \%{preproc-start} | ||||
|         (include|import)\s* | ||||
|         (".*?"|<.*>) | ||||
|         (".*?"|<.*?>) | ||||
|       </match> | ||||
|       <include> | ||||
|         <context id="included-file" sub-pattern="2" style-ref="included-file" class="path"/> | ||||
|   | ||||
| @@ -87,7 +87,7 @@ | ||||
|                     <match extended="true"> | ||||
|                             \%{preproc-start} | ||||
|                             (include|import)\s* | ||||
|                             (".*?"|<.*>) | ||||
|                             (".*?"|<.*?>) | ||||
|                     </match> | ||||
|                     <include> | ||||
|                         <context id="included-file" sub-pattern="2" style-ref="included-file"/> | ||||
|   | ||||
| @@ -45,6 +45,7 @@ | ||||
|  | ||||
|     <context id="builtin-command" style-ref="builtin-command"> | ||||
|       <prefix>(?i)\b</prefix> <!-- case insensitive --> | ||||
|       <keyword>ADD_COMPILE_DEFINITIONS</keyword> | ||||
|       <keyword>ADD_COMPILE_OPTIONS</keyword> | ||||
|       <keyword>ADD_CUSTOM_COMMAND</keyword> | ||||
|       <keyword>ADD_CUSTOM_TARGET</keyword> | ||||
| @@ -58,6 +59,7 @@ | ||||
|       <keyword>AUX_SOURCE_DIRECTORY</keyword> | ||||
|       <keyword>BUILD_COMMAND</keyword> | ||||
|       <keyword>CMAKE_HOST_SYSTEM_INFORMATION</keyword> | ||||
|       <keyword>CMAKE_LANGUAGE</keyword> | ||||
|       <keyword>CMAKE_MINIMUM_REQUIRED</keyword> | ||||
|       <keyword>CMAKE_PARSE_ARGUMENTS</keyword> | ||||
|       <keyword>CMAKE_POLICY</keyword> | ||||
| @@ -110,8 +112,6 @@ | ||||
|       <keyword>MESSAGE</keyword> | ||||
|       <keyword>OPTION</keyword> | ||||
|       <keyword>PROJECT</keyword> | ||||
|       <keyword>QT_WRAP_CPP</keyword> | ||||
|       <keyword>QT_WRAP_UI</keyword> | ||||
|       <keyword>REMOVE_DEFINITIONS</keyword> | ||||
|       <keyword>SEPARATE_ARGUMENTS</keyword> | ||||
|       <keyword>SET</keyword> | ||||
| @@ -130,6 +130,7 @@ | ||||
|       <keyword>TARGET_LINK_DIRECTORIES</keyword> | ||||
|       <keyword>TARGET_LINK_LIBRARIES</keyword> | ||||
|       <keyword>TARGET_LINK_OPTIONS</keyword> | ||||
|       <keyword>TARGET_PRECOMPILE_HEADERS</keyword> | ||||
|       <keyword>TARGET_SOURCES</keyword> | ||||
|       <keyword>TRY_COMPILE</keyword> | ||||
|       <keyword>TRY_RUN</keyword> | ||||
| @@ -148,6 +149,8 @@ | ||||
|       <keyword>LOAD_COMMAND</keyword> | ||||
|       <keyword>MAKE_DIRECTORY</keyword> | ||||
|       <keyword>OUTPUT_REQUIRED_FILES</keyword> | ||||
|       <keyword>QT_WRAP_CPP</keyword> | ||||
|       <keyword>QT_WRAP_UI</keyword> | ||||
|       <keyword>REMOVE</keyword> | ||||
|       <keyword>SUBDIR_DEPENDS</keyword> | ||||
|       <keyword>SUBDIRS</keyword> | ||||
| @@ -173,6 +176,9 @@ | ||||
|  | ||||
|     <context id="builtin-variable" style-ref="builtin-variable"> | ||||
|       <keyword>\w+_BINARY_DIR</keyword> | ||||
|       <keyword>\w+_DESCRIPTION</keyword> | ||||
|       <keyword>\w+_HOMEPAGE_URL</keyword> | ||||
|       <keyword>\w+_ROOT</keyword> | ||||
|       <keyword>\w+_SOURCE_DIR</keyword> | ||||
|       <keyword>\w+_VERSION</keyword> | ||||
|       <keyword>\w+_VERSION_MAJOR</keyword> | ||||
| @@ -183,67 +189,66 @@ | ||||
|       <keyword>APPLE</keyword> | ||||
|       <keyword>BORLAND</keyword> | ||||
|       <keyword>BUILD_SHARED_LIBS</keyword> | ||||
|       <keyword>CMAKE_\w+_POSTFIX</keyword> | ||||
|       <keyword>CMAKE_\w+_ANDROID_TOOLCHAIN_MACHINE</keyword> | ||||
|       <keyword>CMAKE_\w+_ANDROID_TOOLCHAIN_PREFIX</keyword> | ||||
|       <keyword>CMAKE_\w+_ANDROID_TOOLCHAIN_SUFFIX</keyword> | ||||
|       <keyword>CMAKE_\w+_ARCHIVE_APPEND</keyword> | ||||
|       <keyword>CMAKE_\w+_ARCHIVE_CREATE</keyword> | ||||
|       <keyword>CMAKE_\w+_ARCHIVE_FINISH</keyword> | ||||
|       <keyword>CMAKE_\w+_CLANG_TIDY</keyword> | ||||
|       <keyword>CMAKE_\w+_COMPILER</keyword> | ||||
|       <keyword>CMAKE_\w+_COMPILER_ABI</keyword> | ||||
|       <keyword>CMAKE_\w+_COMPILER_AR</keyword> | ||||
|       <keyword>CMAKE_\w+_COMPILER_ARCHITECTURE_ID</keyword> | ||||
|       <keyword>CMAKE_\w+_COMPILER_EXTERNAL_TOOLCHAIN</keyword> | ||||
|       <keyword>CMAKE_\w+_COMPILER_ID</keyword> | ||||
|       <keyword>CMAKE_\w+_COMPILER_LAUNCHER</keyword> | ||||
|       <keyword>CMAKE_\w+_COMPILER_LOADED</keyword> | ||||
|       <keyword>CMAKE_\w+_COMPILER_PREDEFINES_COMMAND</keyword> | ||||
|       <keyword>CMAKE_\w+_COMPILER_RANLIB</keyword> | ||||
|       <keyword>CMAKE_\w+_COMPILER_TARGET</keyword> | ||||
|       <keyword>CMAKE_\w+_COMPILER_VERSION</keyword> | ||||
|       <keyword>CMAKE_\w+_COMPILER_VERSION_INTERNAL</keyword> | ||||
|       <keyword>CMAKE_\w+_COMPILE_OBJECT</keyword> | ||||
|       <keyword>CMAKE_\w+_CPPCHECK</keyword> | ||||
|       <keyword>CMAKE_\w+_CPPLINT</keyword> | ||||
|       <keyword>CMAKE_\w+_CREATE_SHARED_LIBRARY</keyword> | ||||
|       <keyword>CMAKE_\w+_CREATE_SHARED_MODULE</keyword> | ||||
|       <keyword>CMAKE_\w+_CREATE_STATIC_LIBRARY</keyword> | ||||
|       <keyword>CMAKE_\w+_FLAGS</keyword> | ||||
|       <keyword>CMAKE_\w+_FLAGS_DEBUG</keyword> | ||||
|       <keyword>CMAKE_\w+_FLAGS_DEBUG_INIT</keyword> | ||||
|       <keyword>CMAKE_\w+_FLAGS_INIT</keyword> | ||||
|       <keyword>CMAKE_\w+_FLAGS_MINSIZEREL</keyword> | ||||
|       <keyword>CMAKE_\w+_FLAGS_MINSIZEREL_INIT</keyword> | ||||
|       <keyword>CMAKE_\w+_FLAGS_RELEASE</keyword> | ||||
|       <keyword>CMAKE_\w+_FLAGS_RELEASE_INIT</keyword> | ||||
|       <keyword>CMAKE_\w+_FLAGS_RELWITHDEBINFO</keyword> | ||||
|       <keyword>CMAKE_\w+_FLAGS_RELWITHDEBINFO_INIT</keyword> | ||||
|       <keyword>CMAKE_\w+_GHS_KERNEL_FLAGS_DEBUG</keyword> | ||||
|       <keyword>CMAKE_\w+_GHS_KERNEL_FLAGS_MINSIZEREL</keyword> | ||||
|       <keyword>CMAKE_\w+_GHS_KERNEL_FLAGS_RELEASE</keyword> | ||||
|       <keyword>CMAKE_\w+_GHS_KERNEL_FLAGS_RELWITHDEBINFO</keyword> | ||||
|       <keyword>CMAKE_\w+_IGNORE_EXTENSIONS</keyword> | ||||
|       <keyword>CMAKE_\w+_IMPLICIT_INCLUDE_DIRECTORIES</keyword> | ||||
|       <keyword>CMAKE_\w+_IMPLICIT_LINK_DIRECTORIES</keyword> | ||||
|       <keyword>CMAKE_\w+_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES</keyword> | ||||
|       <keyword>CMAKE_\w+_IMPLICIT_LINK_LIBRARIES</keyword> | ||||
|       <keyword>CMAKE_\w+_INCLUDE_WHAT_YOU_USE</keyword> | ||||
|       <keyword>CMAKE_\w+_LIBRARY_ARCHITECTURE</keyword> | ||||
|       <keyword>CMAKE_\w+_LINKER_PREFERENCE</keyword> | ||||
|       <keyword>CMAKE_\w+_LINKER_PREFERENCE_PROPAGATES</keyword> | ||||
|       <keyword>CMAKE_\w+_LINK_EXECUTABLE</keyword> | ||||
|       <keyword>CMAKE_\w+_OUTPUT_EXTENSION</keyword> | ||||
|       <keyword>CMAKE_\w+_PLATFORM_ID</keyword> | ||||
|       <keyword>CMAKE_\w+_SIMULATE_ID</keyword> | ||||
|       <keyword>CMAKE_\w+_SIMULATE_VERSION</keyword> | ||||
|       <keyword>CMAKE_\w+_SIZEOF_DATA_PTR</keyword> | ||||
|       <keyword>CMAKE_\w+_SOURCE_FILE_EXTENSIONS</keyword> | ||||
|       <keyword>CMAKE_\w+_STANDARD_INCLUDE_DIRECTORIES</keyword> | ||||
|       <keyword>CMAKE_\w+_STANDARD_LIBRARIES</keyword> | ||||
|       <keyword>CMAKE_\w+_VISIBILITY_PRESET</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_ANDROID_TOOLCHAIN_MACHINE</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_ANDROID_TOOLCHAIN_PREFIX</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_ANDROID_TOOLCHAIN_SUFFIX</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_ARCHIVE_APPEND</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_ARCHIVE_CREATE</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_ARCHIVE_FINISH</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_COMPILER</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_COMPILER_ABI</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_COMPILER_AR</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_COMPILER_ARCHITECTURE_ID</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_COMPILER_EXTERNAL_TOOLCHAIN</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_COMPILER_ID</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_COMPILER_LOADED</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_COMPILER_PREDEFINES_COMMAND</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_COMPILER_RANLIB</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_COMPILER_TARGET</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_COMPILER_VERSION</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_COMPILER_VERSION_INTERNAL</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_COMPILE_OBJECT</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_CREATE_SHARED_LIBRARY</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_CREATE_SHARED_MODULE</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_CREATE_STATIC_LIBRARY</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_FLAGS</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_FLAGS_(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_FLAGS_(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)_INIT</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_FLAGS_DEBUG</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_FLAGS_DEBUG_INIT</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_FLAGS_INIT</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_FLAGS_MINSIZEREL</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_FLAGS_MINSIZEREL_INIT</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_FLAGS_RELEASE</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_FLAGS_RELEASE_INIT</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_FLAGS_RELWITHDEBINFO</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_FLAGS_RELWITHDEBINFO_INIT</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_IGNORE_EXTENSIONS</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_IMPLICIT_INCLUDE_DIRECTORIES</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_IMPLICIT_LINK_DIRECTORIES</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_IMPLICIT_LINK_LIBRARIES</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_LIBRARY_ARCHITECTURE</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_LINKER_PREFERENCE</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_LINKER_PREFERENCE_PROPAGATES</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_LINKER_WRAPPER_FLAG</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_LINKER_WRAPPER_FLAG_SEP</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_LINK_EXECUTABLE</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_LINK_LIBRARY_FILE_FLAG</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_LINK_LIBRARY_FLAG</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_LINK_LIBRARY_SUFFIX</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_OUTPUT_EXTENSION</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_PLATFORM_ID</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_SIMULATE_ID</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_SIMULATE_VERSION</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_SIZEOF_DATA_PTR</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_SOURCE_FILE_EXTENSIONS</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_STANDARD_INCLUDE_DIRECTORIES</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_STANDARD_LIBRARIES</keyword> | ||||
|       <keyword>CMAKE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)_VISIBILITY_PRESET</keyword> | ||||
|       <keyword>CMAKE_(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)_POSTFIX</keyword> | ||||
|       <keyword>CMAKE_ABSOLUTE_DESTINATION_FILES</keyword> | ||||
|       <keyword>CMAKE_AIX_EXPORT_ALL_SYMBOLS</keyword> | ||||
|       <keyword>CMAKE_ANDROID_ANT_ADDITIONAL_OPTIONS</keyword> | ||||
|       <keyword>CMAKE_ANDROID_API</keyword> | ||||
|       <keyword>CMAKE_ANDROID_API_MIN</keyword> | ||||
| @@ -272,14 +277,18 @@ | ||||
|       <keyword>CMAKE_APPBUNDLE_PATH</keyword> | ||||
|       <keyword>CMAKE_AR</keyword> | ||||
|       <keyword>CMAKE_ARCHIVE_OUTPUT_DIRECTORY</keyword> | ||||
|       <keyword>CMAKE_ARCHIVE_OUTPUT_DIRECTORY_\w+</keyword> | ||||
|       <keyword>CMAKE_ARCHIVE_OUTPUT_DIRECTORY_(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)</keyword> | ||||
|       <keyword>CMAKE_ARGC</keyword> | ||||
|       <keyword>CMAKE_ARGV0</keyword> | ||||
|       <keyword>CMAKE_AUTOGEN_ORIGIN_DEPENDS</keyword> | ||||
|       <keyword>CMAKE_AUTOGEN_PARALLEL</keyword> | ||||
|       <keyword>CMAKE_AUTOGEN_VERBOSE</keyword> | ||||
|       <keyword>CMAKE_AUTOMOC</keyword> | ||||
|       <keyword>CMAKE_AUTOMOC_COMPILER_PREDEFINES</keyword> | ||||
|       <keyword>CMAKE_AUTOMOC_DEPEND_FILTERS</keyword> | ||||
|       <keyword>CMAKE_AUTOMOC_MACRO_NAMES</keyword> | ||||
|       <keyword>CMAKE_AUTOMOC_MOC_OPTIONS</keyword> | ||||
|       <keyword>CMAKE_AUTOMOC_PATH_PREFIX</keyword> | ||||
|       <keyword>CMAKE_AUTOMOC_RELAXED_MODE</keyword> | ||||
|       <keyword>CMAKE_AUTORCC</keyword> | ||||
|       <keyword>CMAKE_AUTORCC_OPTIONS</keyword> | ||||
| @@ -289,6 +298,7 @@ | ||||
|       <keyword>CMAKE_BACKWARDS_COMPATIBILITY</keyword> | ||||
|       <keyword>CMAKE_BINARY_DIR</keyword> | ||||
|       <keyword>CMAKE_BUILD_RPATH</keyword> | ||||
|       <keyword>CMAKE_BUILD_RPATH_USE_ORIGIN</keyword> | ||||
|       <keyword>CMAKE_BUILD_TOOL</keyword> | ||||
|       <keyword>CMAKE_BUILD_TYPE</keyword> | ||||
|       <keyword>CMAKE_BUILD_WITH_INSTALL_NAME_DIR</keyword> | ||||
| @@ -299,6 +309,7 @@ | ||||
|       <keyword>CMAKE_CACHE_PATCH_VERSION</keyword> | ||||
|       <keyword>CMAKE_CFG_INTDIR</keyword> | ||||
|       <keyword>CMAKE_CL_64</keyword> | ||||
|       <keyword>CMAKE_CODEBLOCKS_COMPILER_ID</keyword> | ||||
|       <keyword>CMAKE_CODEBLOCKS_EXCLUDE_EXTERNAL_FILES</keyword> | ||||
|       <keyword>CMAKE_CODELITE_USE_TARGETS</keyword> | ||||
|       <keyword>CMAKE_COLOR_MAKEFILE</keyword> | ||||
| @@ -308,53 +319,84 @@ | ||||
|       <keyword>CMAKE_COMPILER_IS_GNUCXX</keyword> | ||||
|       <keyword>CMAKE_COMPILER_IS_GNUG77</keyword> | ||||
|       <keyword>CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY</keyword> | ||||
|       <keyword>CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY_\w+</keyword> | ||||
|       <keyword>CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY_(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)</keyword> | ||||
|       <keyword>CMAKE_CONFIGURATION_TYPES</keyword> | ||||
|       <keyword>CMAKE_CPACK_COMMAND</keyword> | ||||
|       <keyword>CMAKE_CROSSCOMPILING</keyword> | ||||
|       <keyword>CMAKE_CROSSCOMPILING_EMULATOR</keyword> | ||||
|       <keyword>CMAKE_CROSS_CONFIGS</keyword> | ||||
|       <keyword>CMAKE_CTEST_ARGUMENTS</keyword> | ||||
|       <keyword>CMAKE_CTEST_COMMAND</keyword> | ||||
|       <keyword>CMAKE_CUDA_ARCHITECTURES</keyword> | ||||
|       <keyword>CMAKE_CUDA_COMPILE_FEATURES</keyword> | ||||
|       <keyword>CMAKE_CUDA_EXTENSIONS</keyword> | ||||
|       <keyword>CMAKE_CUDA_HOST_COMPILER</keyword> | ||||
|       <keyword>CMAKE_CUDA_RESOLVE_DEVICE_SYMBOLS</keyword> | ||||
|       <keyword>CMAKE_CUDA_RUNTIME_LIBRARY</keyword> | ||||
|       <keyword>CMAKE_CUDA_SEPARABLE_COMPILATION</keyword> | ||||
|       <keyword>CMAKE_CUDA_STANDARD</keyword> | ||||
|       <keyword>CMAKE_CUDA_STANDARD_REQUIRED</keyword> | ||||
|       <keyword>CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES</keyword> | ||||
|       <keyword>CMAKE_CURRENT_BINARY_DIR</keyword> | ||||
|       <keyword>CMAKE_CURRENT_FUNCTION</keyword> | ||||
|       <keyword>CMAKE_CURRENT_FUNCTION_LIST_DIR</keyword> | ||||
|       <keyword>CMAKE_CURRENT_FUNCTION_LIST_FILE</keyword> | ||||
|       <keyword>CMAKE_CURRENT_FUNCTION_LIST_LINE</keyword> | ||||
|       <keyword>CMAKE_CURRENT_LIST_DIR</keyword> | ||||
|       <keyword>CMAKE_CURRENT_LIST_FILE</keyword> | ||||
|       <keyword>CMAKE_CURRENT_LIST_LINE</keyword> | ||||
|       <keyword>CMAKE_CURRENT_SOURCE_DIR</keyword> | ||||
|       <keyword>CMAKE_CXX_CLANG_TIDY</keyword> | ||||
|       <keyword>CMAKE_CXX_COMPILER_LAUNCHER</keyword> | ||||
|       <keyword>CMAKE_CXX_COMPILE_FEATURES</keyword> | ||||
|       <keyword>CMAKE_CXX_CPPCHECK</keyword> | ||||
|       <keyword>CMAKE_CXX_CPPLINT</keyword> | ||||
|       <keyword>CMAKE_CXX_EXTENSIONS</keyword> | ||||
|       <keyword>CMAKE_CXX_INCLUDE_WHAT_YOU_USE</keyword> | ||||
|       <keyword>CMAKE_CXX_STANDARD</keyword> | ||||
|       <keyword>CMAKE_CXX_STANDARD_REQUIRED</keyword> | ||||
|       <keyword>CMAKE_C_CLANG_TIDY</keyword> | ||||
|       <keyword>CMAKE_C_COMPILER_LAUNCHER</keyword> | ||||
|       <keyword>CMAKE_C_COMPILE_FEATURES</keyword> | ||||
|       <keyword>CMAKE_C_CPPCHECK</keyword> | ||||
|       <keyword>CMAKE_C_CPPLINT</keyword> | ||||
|       <keyword>CMAKE_C_EXTENSIONS</keyword> | ||||
|       <keyword>CMAKE_C_INCLUDE_WHAT_YOU_USE</keyword> | ||||
|       <keyword>CMAKE_C_STANDARD</keyword> | ||||
|       <keyword>CMAKE_C_STANDARD_REQUIRED</keyword> | ||||
|       <keyword>CMAKE_DEBUG_POSTFIX</keyword> | ||||
|       <keyword>CMAKE_DEBUG_TARGET_PROPERTIES</keyword> | ||||
|       <keyword>CMAKE_DEFAULT_BUILD_TYPE</keyword> | ||||
|       <keyword>CMAKE_DEFAULT_CONFIGS</keyword> | ||||
|       <keyword>CMAKE_DEPENDS_IN_PROJECT_ONLY</keyword> | ||||
|       <keyword>CMAKE_DIRECTORY_LABELS</keyword> | ||||
|       <keyword>CMAKE_DISABLE_FIND_PACKAGE_\w+</keyword> | ||||
|       <keyword>CMAKE_DISABLE_PRECOMPILE_HEADERS</keyword> | ||||
|       <keyword>CMAKE_DL_LIBS</keyword> | ||||
|       <keyword>CMAKE_DOTNET_TARGET_FRAMEWORK</keyword> | ||||
|       <keyword>CMAKE_DOTNET_TARGET_FRAMEWORK_VERSION</keyword> | ||||
|       <keyword>CMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES</keyword> | ||||
|       <keyword>CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT</keyword> | ||||
|       <keyword>CMAKE_ECLIPSE_MAKE_ARGUMENTS</keyword> | ||||
|       <keyword>CMAKE_ECLIPSE_RESOURCE_ENCODING</keyword> | ||||
|       <keyword>CMAKE_ECLIPSE_VERSION</keyword> | ||||
|       <keyword>CMAKE_EDIT_COMMAND</keyword> | ||||
|       <keyword>CMAKE_ENABLE_EXPORTS</keyword> | ||||
|       <keyword>CMAKE_ERROR_DEPRECATED</keyword> | ||||
|       <keyword>CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION</keyword> | ||||
|       <keyword>CMAKE_EXECUTABLE_SUFFIX</keyword> | ||||
|       <keyword>CMAKE_EXECUTE_PROCESS_COMMAND_ECHO</keyword> | ||||
|       <keyword>CMAKE_EXE_LINKER_FLAGS</keyword> | ||||
|       <keyword>CMAKE_EXE_LINKER_FLAGS_\w+</keyword> | ||||
|       <keyword>CMAKE_EXE_LINKER_FLAGS_\w+_INIT</keyword> | ||||
|       <keyword>CMAKE_EXE_LINKER_FLAGS_(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)</keyword> | ||||
|       <keyword>CMAKE_EXE_LINKER_FLAGS_(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)_INIT</keyword> | ||||
|       <keyword>CMAKE_EXE_LINKER_FLAGS_INIT</keyword> | ||||
|       <keyword>CMAKE_EXPORT_COMPILE_COMMANDS</keyword> | ||||
|       <keyword>CMAKE_EXPORT_NO_PACKAGE_REGISTRY</keyword> | ||||
|       <keyword>CMAKE_EXPORT_PACKAGE_REGISTRY</keyword> | ||||
|       <keyword>CMAKE_EXTRA_GENERATOR</keyword> | ||||
|       <keyword>CMAKE_EXTRA_SHARED_LIBRARY_SUFFIXES</keyword> | ||||
|       <keyword>CMAKE_FIND_APPBUNDLE</keyword> | ||||
|       <keyword>CMAKE_FIND_DEBUG_MODE</keyword> | ||||
|       <keyword>CMAKE_FIND_FRAMEWORK</keyword> | ||||
|       <keyword>CMAKE_FIND_LIBRARY_CUSTOM_LIB_SUFFIX</keyword> | ||||
|       <keyword>CMAKE_FIND_LIBRARY_PREFIXES</keyword> | ||||
| @@ -363,6 +405,8 @@ | ||||
|       <keyword>CMAKE_FIND_PACKAGE_NAME</keyword> | ||||
|       <keyword>CMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY</keyword> | ||||
|       <keyword>CMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY</keyword> | ||||
|       <keyword>CMAKE_FIND_PACKAGE_PREFER_CONFIG</keyword> | ||||
|       <keyword>CMAKE_FIND_PACKAGE_RESOLVE_SYMLINKS</keyword> | ||||
|       <keyword>CMAKE_FIND_PACKAGE_SORT_DIRECTION</keyword> | ||||
|       <keyword>CMAKE_FIND_PACKAGE_SORT_ORDER</keyword> | ||||
|       <keyword>CMAKE_FIND_PACKAGE_WARN_NO_MODULE</keyword> | ||||
| @@ -371,15 +415,32 @@ | ||||
|       <keyword>CMAKE_FIND_ROOT_PATH_MODE_LIBRARY</keyword> | ||||
|       <keyword>CMAKE_FIND_ROOT_PATH_MODE_PACKAGE</keyword> | ||||
|       <keyword>CMAKE_FIND_ROOT_PATH_MODE_PROGRAM</keyword> | ||||
|       <keyword>CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH</keyword> | ||||
|       <keyword>CMAKE_FIND_USE_CMAKE_PATH</keyword> | ||||
|       <keyword>CMAKE_FIND_USE_CMAKE_SYSTEM_PATH</keyword> | ||||
|       <keyword>CMAKE_FIND_USE_PACKAGE_REGISTRY</keyword> | ||||
|       <keyword>CMAKE_FIND_USE_PACKAGE_ROOT_PATH</keyword> | ||||
|       <keyword>CMAKE_FIND_USE_SYSTEM_ENVIRONMENT_PATH</keyword> | ||||
|       <keyword>CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY</keyword> | ||||
|       <keyword>CMAKE_FOLDER</keyword> | ||||
|       <keyword>CMAKE_FRAMEWORK</keyword> | ||||
|       <keyword>CMAKE_FRAMEWORK_MULTI_CONFIG_POSTFIX_(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)</keyword> | ||||
|       <keyword>CMAKE_FRAMEWORK_PATH</keyword> | ||||
|       <keyword>CMAKE_Fortran_FORMAT</keyword> | ||||
|       <keyword>CMAKE_Fortran_MODDIR_DEFAULT</keyword> | ||||
|       <keyword>CMAKE_Fortran_MODDIR_FLAG</keyword> | ||||
|       <keyword>CMAKE_Fortran_MODOUT_FLAG</keyword> | ||||
|       <keyword>CMAKE_Fortran_MODULE_DIRECTORY</keyword> | ||||
|       <keyword>CMAKE_Fortran_PREPROCESS</keyword> | ||||
|       <keyword>CMAKE_GENERATOR</keyword> | ||||
|       <keyword>CMAKE_GENERATOR_INSTANCE</keyword> | ||||
|       <keyword>CMAKE_GENERATOR_PLATFORM</keyword> | ||||
|       <keyword>CMAKE_GENERATOR_TOOLSET</keyword> | ||||
|       <keyword>CMAKE_GHS_NO_SOURCE_GROUP_FILE</keyword> | ||||
|       <keyword>CMAKE_GLOBAL_AUTOGEN_TARGET</keyword> | ||||
|       <keyword>CMAKE_GLOBAL_AUTOGEN_TARGET_NAME</keyword> | ||||
|       <keyword>CMAKE_GLOBAL_AUTORCC_TARGET</keyword> | ||||
|       <keyword>CMAKE_GLOBAL_AUTORCC_TARGET_NAME</keyword> | ||||
|       <keyword>CMAKE_GNUtoMS</keyword> | ||||
|       <keyword>CMAKE_HOME_DIRECTORY</keyword> | ||||
|       <keyword>CMAKE_HOST_APPLE</keyword> | ||||
| @@ -399,26 +460,31 @@ | ||||
|       <keyword>CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE</keyword> | ||||
|       <keyword>CMAKE_INCLUDE_PATH</keyword> | ||||
|       <keyword>CMAKE_INSTALL_DEFAULT_COMPONENT_NAME</keyword> | ||||
|       <keyword>CMAKE_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS</keyword> | ||||
|       <keyword>CMAKE_INSTALL_MESSAGE</keyword> | ||||
|       <keyword>CMAKE_INSTALL_NAME_DIR</keyword> | ||||
|       <keyword>CMAKE_INSTALL_PREFIX</keyword> | ||||
|       <keyword>CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT</keyword> | ||||
|       <keyword>CMAKE_INSTALL_REMOVE_ENVIRONMENT_RPATH</keyword> | ||||
|       <keyword>CMAKE_INSTALL_RPATH</keyword> | ||||
|       <keyword>CMAKE_INSTALL_RPATH_USE_LINK_PATH</keyword> | ||||
|       <keyword>CMAKE_INTERNAL_PLATFORM_ABI</keyword> | ||||
|       <keyword>CMAKE_INTERPROCEDURAL_OPTIMIZATION</keyword> | ||||
|       <keyword>CMAKE_INTERPROCEDURAL_OPTIMIZATION_\w+</keyword> | ||||
|       <keyword>CMAKE_INTERPROCEDURAL_OPTIMIZATION_(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)</keyword> | ||||
|       <keyword>CMAKE_IOS_INSTALL_COMBINED</keyword> | ||||
|       <keyword>CMAKE_JOB_POOLS</keyword> | ||||
|       <keyword>CMAKE_JOB_POOL_COMPILE</keyword> | ||||
|       <keyword>CMAKE_JOB_POOL_LINK</keyword> | ||||
|       <keyword>CMAKE_JOB_POOL_PRECOMPILE_HEADER</keyword> | ||||
|       <keyword>CMAKE_LIBRARY_ARCHITECTURE</keyword> | ||||
|       <keyword>CMAKE_LIBRARY_ARCHITECTURE_REGEX</keyword> | ||||
|       <keyword>CMAKE_LIBRARY_OUTPUT_DIRECTORY</keyword> | ||||
|       <keyword>CMAKE_LIBRARY_OUTPUT_DIRECTORY_\w+</keyword> | ||||
|       <keyword>CMAKE_LIBRARY_OUTPUT_DIRECTORY_(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)</keyword> | ||||
|       <keyword>CMAKE_LIBRARY_PATH</keyword> | ||||
|       <keyword>CMAKE_LIBRARY_PATH_FLAG</keyword> | ||||
|       <keyword>CMAKE_LINK_DEF_FILE_FLAG</keyword> | ||||
|       <keyword>CMAKE_LINK_DEPENDS_NO_SHARED</keyword> | ||||
|       <keyword>CMAKE_LINK_DIRECTORIES_BEFORE</keyword> | ||||
|       <keyword>CMAKE_LINK_INTERFACE_LIBRARIES</keyword> | ||||
|       <keyword>CMAKE_LINK_LIBRARY_FILE_FLAG</keyword> | ||||
|       <keyword>CMAKE_LINK_LIBRARY_FLAG</keyword> | ||||
| @@ -430,48 +496,73 @@ | ||||
|       <keyword>CMAKE_MACOSX_RPATH</keyword> | ||||
|       <keyword>CMAKE_MAJOR_VERSION</keyword> | ||||
|       <keyword>CMAKE_MAKE_PROGRAM</keyword> | ||||
|       <keyword>CMAKE_MAP_IMPORTED_CONFIG_\w+</keyword> | ||||
|       <keyword>CMAKE_MATCH_\d+</keyword> | ||||
|       <keyword>CMAKE_MAP_IMPORTED_CONFIG_(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)</keyword> | ||||
|       <keyword>CMAKE_MATCH_COUNT</keyword> | ||||
|       <keyword>CMAKE_MATCH_\d+</keyword> | ||||
|       <keyword>CMAKE_MAXIMUM_RECURSION_DEPTH</keyword> | ||||
|       <keyword>CMAKE_MESSAGE_CONTEXT</keyword> | ||||
|       <keyword>CMAKE_MESSAGE_CONTEXT_SHOW</keyword> | ||||
|       <keyword>CMAKE_MESSAGE_INDENT</keyword> | ||||
|       <keyword>CMAKE_MESSAGE_LOG_LEVEL</keyword> | ||||
|       <keyword>CMAKE_MFC_FLAG</keyword> | ||||
|       <keyword>CMAKE_MINIMUM_REQUIRED_VERSION</keyword> | ||||
|       <keyword>CMAKE_MINOR_VERSION</keyword> | ||||
|       <keyword>CMAKE_MODULE_LINKER_FLAGS</keyword> | ||||
|       <keyword>CMAKE_MODULE_LINKER_FLAGS_\w+</keyword> | ||||
|       <keyword>CMAKE_MODULE_LINKER_FLAGS_\w+_INIT</keyword> | ||||
|       <keyword>CMAKE_MODULE_LINKER_FLAGS_(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)</keyword> | ||||
|       <keyword>CMAKE_MODULE_LINKER_FLAGS_(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)_INIT</keyword> | ||||
|       <keyword>CMAKE_MODULE_LINKER_FLAGS_INIT</keyword> | ||||
|       <keyword>CMAKE_MODULE_PATH</keyword> | ||||
|       <keyword>CMAKE_MSVCIDE_RUN_PATH</keyword> | ||||
|       <keyword>CMAKE_MSVC_RUNTIME_LIBRARY</keyword> | ||||
|       <keyword>CMAKE_NETRC</keyword> | ||||
|       <keyword>CMAKE_NETRC_FILE</keyword> | ||||
|       <keyword>CMAKE_NINJA_OUTPUT_PATH_PREFIX</keyword> | ||||
|       <keyword>CMAKE_NOT_USING_CONFIG_FLAGS</keyword> | ||||
|       <keyword>CMAKE_NO_BUILTIN_CHRPATH</keyword> | ||||
|       <keyword>CMAKE_NO_SYSTEM_FROM_IMPORTED</keyword> | ||||
|       <keyword>CMAKE_OBJCXX_EXTENSIONS</keyword> | ||||
|       <keyword>CMAKE_OBJCXX_STANDARD</keyword> | ||||
|       <keyword>CMAKE_OBJCXX_STANDARD_REQUIRED</keyword> | ||||
|       <keyword>CMAKE_OBJC_EXTENSIONS</keyword> | ||||
|       <keyword>CMAKE_OBJC_STANDARD</keyword> | ||||
|       <keyword>CMAKE_OBJC_STANDARD_REQUIRED</keyword> | ||||
|       <keyword>CMAKE_OBJECT_PATH_MAX</keyword> | ||||
|       <keyword>CMAKE_OSX_ARCHITECTURES</keyword> | ||||
|       <keyword>CMAKE_OSX_DEPLOYMENT_TARGET</keyword> | ||||
|       <keyword>CMAKE_OSX_SYSROOT</keyword> | ||||
|       <keyword>CMAKE_PARENT_LIST_FILE</keyword> | ||||
|       <keyword>CMAKE_PATCH_VERSION</keyword> | ||||
|       <keyword>CMAKE_PCH_WARN_INVALID</keyword> | ||||
|       <keyword>CMAKE_PDB_OUTPUT_DIRECTORY</keyword> | ||||
|       <keyword>CMAKE_PDB_OUTPUT_DIRECTORY_\w+</keyword> | ||||
|       <keyword>CMAKE_PDB_OUTPUT_DIRECTORY_(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)</keyword> | ||||
|       <keyword>CMAKE_POLICY_DEFAULT_CMP\d{4}</keyword> | ||||
|       <keyword>CMAKE_POLICY_WARNING_CMP\d{4}</keyword> | ||||
|       <keyword>CMAKE_POSITION_INDEPENDENT_CODE</keyword> | ||||
|       <keyword>CMAKE_PREFIX_PATH</keyword> | ||||
|       <keyword>CMAKE_PROGRAM_PATH</keyword> | ||||
|       <keyword>CMAKE_PROJECT_\w+_INCLUDE</keyword> | ||||
|       <keyword>CMAKE_PROJECT_DESCRIPTION</keyword> | ||||
|       <keyword>CMAKE_PROJECT_HOMEPAGE_URL</keyword> | ||||
|       <keyword>CMAKE_PROJECT_INCLUDE</keyword> | ||||
|       <keyword>CMAKE_PROJECT_INCLUDE_BEFORE</keyword> | ||||
|       <keyword>CMAKE_PROJECT_NAME</keyword> | ||||
|       <keyword>CMAKE_PROJECT_VERSION</keyword> | ||||
|       <keyword>CMAKE_PROJECT_VERSION_MAJOR</keyword> | ||||
|       <keyword>CMAKE_PROJECT_VERSION_MINOR</keyword> | ||||
|       <keyword>CMAKE_PROJECT_VERSION_PATCH</keyword> | ||||
|       <keyword>CMAKE_PROJECT_VERSION_TWEAK</keyword> | ||||
|       <keyword>CMAKE_PROJECT_\w+_INCLUDE</keyword> | ||||
|       <keyword>CMAKE_PROJECT_\w+_INCLUDE_BEFORE</keyword> | ||||
|       <keyword>CMAKE_RANLIB</keyword> | ||||
|       <keyword>CMAKE_ROOT</keyword> | ||||
|       <keyword>CMAKE_RULE_MESSAGES</keyword> | ||||
|       <keyword>CMAKE_RUNTIME_OUTPUT_DIRECTORY</keyword> | ||||
|       <keyword>CMAKE_RUNTIME_OUTPUT_DIRECTORY_\w+</keyword> | ||||
|       <keyword>CMAKE_RUNTIME_OUTPUT_DIRECTORY_(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)</keyword> | ||||
|       <keyword>CMAKE_SCRIPT_MODE_FILE</keyword> | ||||
|       <keyword>CMAKE_SHARED_LIBRARY_PREFIX</keyword> | ||||
|       <keyword>CMAKE_SHARED_LIBRARY_SUFFIX</keyword> | ||||
|       <keyword>CMAKE_SHARED_LINKER_FLAGS</keyword> | ||||
|       <keyword>CMAKE_SHARED_LINKER_FLAGS_\w+</keyword> | ||||
|       <keyword>CMAKE_SHARED_LINKER_FLAGS_\w+_INIT</keyword> | ||||
|       <keyword>CMAKE_SHARED_LINKER_FLAGS_(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)</keyword> | ||||
|       <keyword>CMAKE_SHARED_LINKER_FLAGS_(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)_INIT</keyword> | ||||
|       <keyword>CMAKE_SHARED_LINKER_FLAGS_INIT</keyword> | ||||
|       <keyword>CMAKE_SHARED_MODULE_PREFIX</keyword> | ||||
|       <keyword>CMAKE_SHARED_MODULE_SUFFIX</keyword> | ||||
| @@ -486,11 +577,12 @@ | ||||
|       <keyword>CMAKE_STATIC_LIBRARY_PREFIX</keyword> | ||||
|       <keyword>CMAKE_STATIC_LIBRARY_SUFFIX</keyword> | ||||
|       <keyword>CMAKE_STATIC_LINKER_FLAGS</keyword> | ||||
|       <keyword>CMAKE_STATIC_LINKER_FLAGS_\w+</keyword> | ||||
|       <keyword>CMAKE_STATIC_LINKER_FLAGS_\w+_INIT</keyword> | ||||
|       <keyword>CMAKE_STATIC_LINKER_FLAGS_(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)</keyword> | ||||
|       <keyword>CMAKE_STATIC_LINKER_FLAGS_(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL)_INIT</keyword> | ||||
|       <keyword>CMAKE_STATIC_LINKER_FLAGS_INIT</keyword> | ||||
|       <keyword>CMAKE_SUBLIME_TEXT_2_ENV_SETTINGS</keyword> | ||||
|       <keyword>CMAKE_SUBLIME_TEXT_2_EXCLUDE_BUILD_TREE</keyword> | ||||
|       <keyword>CMAKE_SUPPRESS_REGENERATION</keyword> | ||||
|       <keyword>CMAKE_SYSROOT</keyword> | ||||
|       <keyword>CMAKE_SYSROOT_COMPILE</keyword> | ||||
|       <keyword>CMAKE_SYSROOT_LINK</keyword> | ||||
| @@ -506,40 +598,76 @@ | ||||
|       <keyword>CMAKE_SYSTEM_PROGRAM_PATH</keyword> | ||||
|       <keyword>CMAKE_SYSTEM_VERSION</keyword> | ||||
|       <keyword>CMAKE_Swift_LANGUAGE_VERSION</keyword> | ||||
|       <keyword>CMAKE_Swift_MODULE_DIRECTORY</keyword> | ||||
|       <keyword>CMAKE_Swift_NUM_THREADS</keyword> | ||||
|       <keyword>CMAKE_TOOLCHAIN_FILE</keyword> | ||||
|       <keyword>CMAKE_TRY_COMPILE_CONFIGURATION</keyword> | ||||
|       <keyword>CMAKE_TRY_COMPILE_PLATFORM_VARIABLES</keyword> | ||||
|       <keyword>CMAKE_TRY_COMPILE_TARGET_TYPE</keyword> | ||||
|       <keyword>CMAKE_TWEAK_VERSION</keyword> | ||||
|       <keyword>CMAKE_UNITY_BUILD</keyword> | ||||
|       <keyword>CMAKE_UNITY_BUILD_BATCH_SIZE</keyword> | ||||
|       <keyword>CMAKE_USER_MAKE_RULES_OVERRIDE</keyword> | ||||
|       <keyword>CMAKE_USER_MAKE_RULES_OVERRIDE_\w+</keyword> | ||||
|       <keyword>CMAKE_USER_MAKE_RULES_OVERRIDE_(C|CXX|CUDA|OBJC|OBJCXX|Fortran|ASM)</keyword> | ||||
|       <keyword>CMAKE_USE_RELATIVE_PATHS</keyword> | ||||
|       <keyword>CMAKE_VERBOSE_MAKEFILE</keyword> | ||||
|       <keyword>CMAKE_VERSION</keyword> | ||||
|       <keyword>CMAKE_VISIBILITY_INLINES_HIDDEN</keyword> | ||||
|       <keyword>CMAKE_VS_DEVENV_COMMAND</keyword> | ||||
|       <keyword>CMAKE_VS_GLOBALS</keyword> | ||||
|       <keyword>CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD</keyword> | ||||
|       <keyword>CMAKE_VS_INCLUDE_PACKAGE_TO_DEFAULT_BUILD</keyword> | ||||
|       <keyword>CMAKE_VS_INTEL_Fortran_PROJECT_VERSION</keyword> | ||||
|       <keyword>CMAKE_VS_JUST_MY_CODE_DEBUGGING</keyword> | ||||
|       <keyword>CMAKE_VS_MSBUILD_COMMAND</keyword> | ||||
|       <keyword>CMAKE_VS_NsightTegra_VERSION</keyword> | ||||
|       <keyword>CMAKE_VS_PLATFORM_NAME</keyword> | ||||
|       <keyword>CMAKE_VS_PLATFORM_NAME_DEFAULT</keyword> | ||||
|       <keyword>CMAKE_VS_PLATFORM_TOOLSET</keyword> | ||||
|       <keyword>CMAKE_VS_PLATFORM_TOOLSET_CUDA</keyword> | ||||
|       <keyword>CMAKE_VS_PLATFORM_TOOLSET_CUDA_CUSTOM_DIR</keyword> | ||||
|       <keyword>CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE</keyword> | ||||
|       <keyword>CMAKE_VS_PLATFORM_TOOLSET_VERSION</keyword> | ||||
|       <keyword>CMAKE_VS_SDK_EXCLUDE_DIRECTORIES</keyword> | ||||
|       <keyword>CMAKE_VS_SDK_EXECUTABLE_DIRECTORIES</keyword> | ||||
|       <keyword>CMAKE_VS_SDK_INCLUDE_DIRECTORIES</keyword> | ||||
|       <keyword>CMAKE_VS_SDK_LIBRARY_DIRECTORIES</keyword> | ||||
|       <keyword>CMAKE_VS_SDK_LIBRARY_WINRT_DIRECTORIES</keyword> | ||||
|       <keyword>CMAKE_VS_SDK_REFERENCE_DIRECTORIES</keyword> | ||||
|       <keyword>CMAKE_VS_SDK_SOURCE_DIRECTORIES</keyword> | ||||
|       <keyword>CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION</keyword> | ||||
|       <keyword>CMAKE_VS_WINRT_BY_DEFAULT</keyword> | ||||
|       <keyword>CMAKE_WARN_DEPRECATED</keyword> | ||||
|       <keyword>CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION</keyword> | ||||
|       <keyword>CMAKE_WIN32_EXECUTABLE</keyword> | ||||
|       <keyword>CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS</keyword> | ||||
|       <keyword>CMAKE_XCODE_ATTRIBUTE_\w+</keyword> | ||||
|       <keyword>CMAKE_XCODE_GENERATE_SCHEME</keyword> | ||||
|       <keyword>CMAKE_XCODE_GENERATE_TOP_LEVEL_PROJECT_ONLY</keyword> | ||||
|       <keyword>CMAKE_XCODE_PLATFORM_TOOLSET</keyword> | ||||
|       <keyword>CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER</keyword> | ||||
|       <keyword>CMAKE_XCODE_SCHEME_ADDRESS_SANITIZER_USE_AFTER_RETURN</keyword> | ||||
|       <keyword>CMAKE_XCODE_SCHEME_DEBUG_DOCUMENT_VERSIONING</keyword> | ||||
|       <keyword>CMAKE_XCODE_SCHEME_DISABLE_MAIN_THREAD_CHECKER</keyword> | ||||
|       <keyword>CMAKE_XCODE_SCHEME_DYNAMIC_LIBRARY_LOADS</keyword> | ||||
|       <keyword>CMAKE_XCODE_SCHEME_DYNAMIC_LINKER_API_USAGE</keyword> | ||||
|       <keyword>CMAKE_XCODE_SCHEME_ENVIRONMENT</keyword> | ||||
|       <keyword>CMAKE_XCODE_SCHEME_GUARD_MALLOC</keyword> | ||||
|       <keyword>CMAKE_XCODE_SCHEME_MAIN_THREAD_CHECKER_STOP</keyword> | ||||
|       <keyword>CMAKE_XCODE_SCHEME_MALLOC_GUARD_EDGES</keyword> | ||||
|       <keyword>CMAKE_XCODE_SCHEME_MALLOC_SCRIBBLE</keyword> | ||||
|       <keyword>CMAKE_XCODE_SCHEME_MALLOC_STACK</keyword> | ||||
|       <keyword>CMAKE_XCODE_SCHEME_THREAD_SANITIZER</keyword> | ||||
|       <keyword>CMAKE_XCODE_SCHEME_THREAD_SANITIZER_STOP</keyword> | ||||
|       <keyword>CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER</keyword> | ||||
|       <keyword>CMAKE_XCODE_SCHEME_UNDEFINED_BEHAVIOUR_SANITIZER_STOP</keyword> | ||||
|       <keyword>CMAKE_XCODE_SCHEME_WORKING_DIRECTORY</keyword> | ||||
|       <keyword>CMAKE_XCODE_SCHEME_ZOMBIE_OBJECTS</keyword> | ||||
|       <keyword>CPACK_ABSOLUTE_DESTINATION_FILES</keyword> | ||||
|       <keyword>CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY</keyword> | ||||
|       <keyword>CPACK_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION</keyword> | ||||
|       <keyword>CPACK_INCLUDE_TOPLEVEL_DIRECTORY</keyword> | ||||
|       <keyword>CPACK_INSTALL_SCRIPT</keyword> | ||||
|       <keyword>CPACK_INSTALL_DEFAULT_DIRECTORY_PERMISSIONS</keyword> | ||||
|       <keyword>CPACK_PACKAGING_INSTALL_PREFIX</keyword> | ||||
|       <keyword>CPACK_SET_DESTDIR</keyword> | ||||
|       <keyword>CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION</keyword> | ||||
| @@ -569,7 +697,7 @@ | ||||
|       <keyword>CTEST_CUSTOM_POST_TEST</keyword> | ||||
|       <keyword>CTEST_CUSTOM_PRE_MEMCHECK</keyword> | ||||
|       <keyword>CTEST_CUSTOM_PRE_TEST</keyword> | ||||
|       <keyword>CTEST_CUSTOM_TEST_IGNORE</keyword> | ||||
|       <keyword>CTEST_CUSTOM_TESTS_IGNORE</keyword> | ||||
|       <keyword>CTEST_CUSTOM_WARNING_EXCEPTION</keyword> | ||||
|       <keyword>CTEST_CUSTOM_WARNING_MATCH</keyword> | ||||
|       <keyword>CTEST_CVS_CHECKOUT</keyword> | ||||
| @@ -599,9 +727,12 @@ | ||||
|       <keyword>CTEST_P4_COMMAND</keyword> | ||||
|       <keyword>CTEST_P4_OPTIONS</keyword> | ||||
|       <keyword>CTEST_P4_UPDATE_OPTIONS</keyword> | ||||
|       <keyword>CTEST_RESOURCE_SPEC_FILE</keyword> | ||||
|       <keyword>CTEST_RUN_CURRENT_SCRIPT</keyword> | ||||
|       <keyword>CTEST_SCP_COMMAND</keyword> | ||||
|       <keyword>CTEST_SITE</keyword> | ||||
|       <keyword>CTEST_SOURCE_DIRECTORY</keyword> | ||||
|       <keyword>CTEST_SUBMIT_URL</keyword> | ||||
|       <keyword>CTEST_SVN_COMMAND</keyword> | ||||
|       <keyword>CTEST_SVN_OPTIONS</keyword> | ||||
|       <keyword>CTEST_SVN_UPDATE_OPTIONS</keyword> | ||||
| @@ -611,10 +742,12 @@ | ||||
|       <keyword>CTEST_UPDATE_COMMAND</keyword> | ||||
|       <keyword>CTEST_UPDATE_OPTIONS</keyword> | ||||
|       <keyword>CTEST_UPDATE_VERSION_ONLY</keyword> | ||||
|       <keyword>CTEST_UPDATE_VERSION_OVERRIDE</keyword> | ||||
|       <keyword>CTEST_USE_LAUNCHERS</keyword> | ||||
|       <keyword>CYGWIN</keyword> | ||||
|       <keyword>EXECUTABLE_OUTPUT_PATH</keyword> | ||||
|       <keyword>GHS-MULTI</keyword> | ||||
|       <keyword>IOS</keyword> | ||||
|       <keyword>LIBRARY_OUTPUT_PATH</keyword> | ||||
|       <keyword>MINGW</keyword> | ||||
|       <keyword>MSVC</keyword> | ||||
| @@ -628,9 +761,12 @@ | ||||
|       <keyword>MSVC80</keyword> | ||||
|       <keyword>MSVC90</keyword> | ||||
|       <keyword>MSVC_IDE</keyword> | ||||
|       <keyword>MSVC_TOOLSET_VERSION</keyword> | ||||
|       <keyword>MSVC_VERSION</keyword> | ||||
|       <keyword>MSYS</keyword> | ||||
|       <keyword>PROJECT_BINARY_DIR</keyword> | ||||
|       <keyword>PROJECT_DESCRIPTION</keyword> | ||||
|       <keyword>PROJECT_HOMEPAGE_URL</keyword> | ||||
|       <keyword>PROJECT_NAME</keyword> | ||||
|       <keyword>PROJECT_SOURCE_DIR</keyword> | ||||
|       <keyword>PROJECT_VERSION</keyword> | ||||
| @@ -648,30 +784,379 @@ | ||||
|     </context> | ||||
|  | ||||
|     <context id="operator" style-ref="operator"> | ||||
|       <keyword>@ONLY</keyword> | ||||
|       <keyword>ABSOLUTE</keyword> | ||||
|       <keyword>AFTER</keyword> | ||||
|       <keyword>ALIAS</keyword> | ||||
|       <keyword>ALPHABET</keyword> | ||||
|       <keyword>AND</keyword> | ||||
|       <keyword>ANDROID_MK</keyword> | ||||
|       <keyword>APPEND</keyword> | ||||
|       <keyword>APPEND_STRING</keyword> | ||||
|       <keyword>ARCHIVE</keyword> | ||||
|       <keyword>ARCHIVE_CREATE</keyword> | ||||
|       <keyword>ARCHIVE_EXTRACT</keyword> | ||||
|       <keyword>ARGS</keyword> | ||||
|       <keyword>ASCII</keyword> | ||||
|       <keyword>ASM_EXTENSIONS</keyword> | ||||
|       <keyword>ASM_STANDARD</keyword> | ||||
|       <keyword>ASM_STANDARD_REQUIRED</keyword> | ||||
|       <keyword>AUTHOR_WARNING</keyword> | ||||
|       <keyword>BEFORE</keyword> | ||||
|       <keyword>BOOL</keyword> | ||||
|       <keyword>BUILD</keyword> | ||||
|       <keyword>BUILD_ID</keyword> | ||||
|       <keyword>BUILD_TYPE</keyword> | ||||
|       <keyword>BRIEF_DOCS</keyword> | ||||
|       <keyword>BRUNDLE</keyword> | ||||
|       <keyword>BYPRODUCTS</keyword> | ||||
|       <keyword>C_EXTENSIONS</keyword> | ||||
|       <keyword>C_STANDARD</keyword> | ||||
|       <keyword>C_STANDARD_REQUIRED</keyword> | ||||
|       <keyword>CACHE</keyword> | ||||
|       <keyword>CACHED_VARIABLE</keyword> | ||||
|       <keyword>CALL</keyword> | ||||
|       <keyword>CAPTURE_CMAKE_ERROR</keyword> | ||||
|       <keyword>CDASH_UPLOAD</keyword> | ||||
|       <keyword>CDASH_UPLOAD_TYPE</keyword> | ||||
|       <keyword>CLEAR</keyword> | ||||
|       <keyword>CMAKE_FIND_ROOT_PATH_BOTH</keyword> | ||||
|       <keyword>CMAKE_FLAGS</keyword> | ||||
|       <keyword>CODE</keyword> | ||||
|       <keyword>COMMAND</keyword> | ||||
|       <keyword>COMMAND_ECHO</keyword> | ||||
|       <keyword>COMMAND_EXPAND_LISTS</keyword> | ||||
|       <keyword>COMMAND_NAME</keyword> | ||||
|       <keyword>COMMENT</keyword> | ||||
|       <keyword>COMPARE</keyword> | ||||
|       <keyword>COMPILE_DEFINITIONS</keyword> | ||||
|       <keyword>COMPILE_OUTPUT_VARIABLE</keyword> | ||||
|       <keyword>COMPONENT</keyword> | ||||
|       <keyword>COMPONENTS</keyword> | ||||
|       <keyword>CONCAT</keyword> | ||||
|       <keyword>CONFIGURATION</keyword> | ||||
|       <keyword>CONFIGURATIONS</keyword> | ||||
|       <keyword>CONFIGURE</keyword> | ||||
|       <keyword>COPY</keyword> | ||||
|       <keyword>COPY_FILE</keyword> | ||||
|       <keyword>COPY_FILE_ERROR</keyword> | ||||
|       <keyword>COPYONLY</keyword> | ||||
|       <keyword>CREATE_LINK</keyword> | ||||
|       <keyword>CRLF</keyword> | ||||
|       <keyword>CUDA_EXTENSIONS</keyword> | ||||
|       <keyword>CUDA_STANDARD</keyword> | ||||
|       <keyword>CUDA_STANDARD_REQUIRED</keyword> | ||||
|       <keyword>CXX_EXTENSIONS</keyword> | ||||
|       <keyword>CXX_STANDARD</keyword> | ||||
|       <keyword>CXX_STANDARD_REQUIRED</keyword> | ||||
|       <keyword>DEBUG</keyword> | ||||
|       <keyword>DECIMAL</keyword> | ||||
|       <keyword>DEFECT_COUNT</keyword> | ||||
|       <keyword>DEFINED</keyword> | ||||
|       <keyword>DEFINITION</keyword> | ||||
|       <keyword>DEPENDS</keyword> | ||||
|       <keyword>DEPFILE</keyword> | ||||
|       <keyword>DEPRECATION</keyword> | ||||
|       <keyword>DESCRIPTION</keyword> | ||||
|       <keyword>DESTDIR</keyword> | ||||
|       <keyword>DESTINATION</keyword> | ||||
|       <keyword>DIRECTORY</keyword> | ||||
|       <keyword>DIRECTORY_PERMISSIONS</keyword> | ||||
|       <keyword>DOC</keyword> | ||||
|       <keyword>DOS</keyword> | ||||
|       <keyword>DOWNLOAD</keyword> | ||||
|       <keyword>ECHO_ERROR_VARIABLE</keyword> | ||||
|       <keyword>ECHO_OUTPUT_VARIABLE</keyword> | ||||
|       <keyword>ENCODING</keyword> | ||||
|       <keyword>END</keyword> | ||||
|       <keyword>EQUAL</keyword> | ||||
|       <keyword>ERROR_FILE</keyword> | ||||
|       <keyword>ERROR_QUIET</keyword> | ||||
|       <keyword>ERROR_STRIP_TRAILING_WHITESPACE</keyword> | ||||
|       <keyword>ERROR_VARIABLE</keyword> | ||||
|       <keyword>ESCAPE_QUOTES</keyword> | ||||
|       <keyword>EVAL</keyword> | ||||
|       <keyword>EXACT</keyword> | ||||
|       <keyword>EXCLUDE</keyword> | ||||
|       <keyword>EXCLUDE_FIXTURE</keyword> | ||||
|       <keyword>EXCLUDE_FIXTURE_CLEANUP</keyword> | ||||
|       <keyword>EXCLUDE_FIXTURE_SETUP</keyword> | ||||
|       <keyword>EXCLUDE_FROM_ALL</keyword> | ||||
|       <keyword>EXCLUDE_LABEL</keyword> | ||||
|       <keyword>EXISTS</keyword> | ||||
|       <keyword>EXPORT</keyword> | ||||
|       <keyword>EXPORT_ANDROID_MK</keyword> | ||||
|       <keyword>EXPORT_LINK_INTERFACE_LIBRARIES</keyword> | ||||
|       <keyword>EXPR</keyword> | ||||
|       <keyword>EXT</keyword> | ||||
|       <keyword>EXTRA_INCLUDE</keyword> | ||||
|       <keyword>FATAL_ERROR</keyword> | ||||
|       <keyword>FLAGS</keyword> | ||||
|       <keyword>FILE</keyword> | ||||
|       <keyword>FILE_PERMISSIONS</keyword> | ||||
|       <keyword>FILES</keyword> | ||||
|       <keyword>FILES_MATCHING</keyword> | ||||
|       <keyword>FILEPATH</keyword> | ||||
|       <keyword>FILTER</keyword> | ||||
|       <keyword>FIND</keyword> | ||||
|       <keyword>FORCE</keyword> | ||||
|       <keyword>Fortran_EXTENSIONS</keyword> | ||||
|       <keyword>Fortran_STANDARD</keyword> | ||||
|       <keyword>Fortran_STANDARD_REQUIRED</keyword> | ||||
|       <keyword>FRAMEWORK</keyword> | ||||
|       <keyword>FULL_DOCS</keyword> | ||||
|       <keyword>FUNCTION</keyword> | ||||
|       <keyword>GENERATE</keyword> | ||||
|       <keyword>GENEX_STRIP</keyword> | ||||
|       <keyword>GET</keyword> | ||||
|       <keyword>GET_RUNTIME_DEPENDENCIES</keyword> | ||||
|       <keyword>GLOB</keyword> | ||||
|       <keyword>GLOB_RECURSE</keyword> | ||||
|       <keyword>GLOBAL</keyword> | ||||
|       <keyword>GREATER</keyword> | ||||
|       <keyword>GREATER_EQUAL</keyword> | ||||
|       <keyword>GROUP</keyword> | ||||
|       <keyword>GROUP_EXECUTE</keyword> | ||||
|       <keyword>GROUP_READ</keyword> | ||||
|       <keyword>GUID</keyword> | ||||
|       <keyword>HEX</keyword> | ||||
|       <keyword>HEXADECIMAL</keyword> | ||||
|       <keyword>HINTS</keyword> | ||||
|       <keyword>HOMEPAGE_URL</keyword> | ||||
|       <keyword>HTTPHEADER</keyword> | ||||
|       <keyword>IMPLICIT_DEPENDS</keyword> | ||||
|       <keyword>IMPORTED</keyword> | ||||
|       <keyword>IN</keyword> | ||||
|       <keyword>INCLUDE</keyword> | ||||
|       <keyword>INCLUDE_LABEL</keyword> | ||||
|       <keyword>INCLUDE_INTERNALS</keyword> | ||||
|       <keyword>INCLUDES</keyword> | ||||
|       <keyword>INHERITED</keyword> | ||||
|       <keyword>INPUT</keyword> | ||||
|       <keyword>INPUT_FILE</keyword> | ||||
|       <keyword>INSERT</keyword> | ||||
|       <keyword>INSTALL</keyword> | ||||
|       <keyword>INTERFACE</keyword> | ||||
|       <keyword>INTERNAL</keyword> | ||||
|       <keyword>IN_LIST</keyword> | ||||
|       <keyword>IS_ABSOLUTE</keyword> | ||||
|       <keyword>IS_DIRECTORY</keyword> | ||||
|       <keyword>IS_NEWER_THAN</keyword> | ||||
|       <keyword>IS_SYMLINK</keyword> | ||||
|       <keyword>ITEMS</keyword> | ||||
|       <keyword>JOB_POOL</keyword> | ||||
|       <keyword>JOIN</keyword> | ||||
|       <keyword>LABELS</keyword> | ||||
|       <keyword>LANGUAGES</keyword> | ||||
|       <keyword>LAST_EXT</keyword> | ||||
|       <keyword>LENGTH</keyword> | ||||
|       <keyword>LESS</keyword> | ||||
|       <keyword>LESS_EQUAL</keyword> | ||||
|       <keyword>LF</keyword> | ||||
|       <keyword>LIBRARY</keyword> | ||||
|       <keyword>LINK_INTERFACE_LIBRARIES</keyword> | ||||
|       <keyword>LINK_LIBRARIES</keyword> | ||||
|       <keyword>LINK_OPTIONS</keyword> | ||||
|       <keyword>LINK_PRIVATE</keyword> | ||||
|       <keyword>LINK_PUBLIC</keyword> | ||||
|       <keyword>LOCK</keyword> | ||||
|       <keyword>MACOSX_BUNDLE</keyword> | ||||
|       <keyword>MAIN_DEPENDENCY</keyword> | ||||
|       <keyword>MAKE_C_IDENTIFIER</keyword> | ||||
|       <keyword>MAKE_DIRECTORY</keyword> | ||||
|       <keyword>MATCH</keyword> | ||||
|       <keyword>MATCHALL</keyword> | ||||
|       <keyword>MATCHES</keyword> | ||||
|       <keyword>MD5</keyword> | ||||
|       <keyword>MESSAGE_NEVER</keyword> | ||||
|       <keyword>MODULE</keyword> | ||||
|       <keyword>NAME</keyword> | ||||
|       <keyword>NAMES</keyword> | ||||
|       <keyword>NAME_WE</keyword> | ||||
|       <keyword>NAME_WLE</keyword> | ||||
|       <keyword>NAME_WE</keyword> | ||||
|       <keyword>NAMELINK_COMPONENT</keyword> | ||||
|       <keyword>NAMELINK_ONLY</keyword> | ||||
|       <keyword>NAMELINK_SKIP</keyword> | ||||
|       <keyword>NAMES</keyword> | ||||
|       <keyword>NAMESPACE</keyword> | ||||
|       <keyword>NATIVE_COMMAND</keyword> | ||||
|       <keyword>NEW</keyword> | ||||
|       <keyword>NEW_PROCESS</keyword> | ||||
|       <keyword>NEWLINE_STYLE</keyword> | ||||
|       <keyword>NO_CMAKE_ENVIRONMENT_PATH</keyword> | ||||
|       <keyword>NO_CMAKE_FIND_ROOT_PATH</keyword> | ||||
|       <keyword>NO_CMAKE_PATH</keyword> | ||||
|       <keyword>NO_CMAKE_SYSTEM_PATH</keyword> | ||||
|       <keyword>NO_DEFAULT_PATH</keyword> | ||||
|       <keyword>NO_PACKAGE_ROOT_PATH</keyword> | ||||
|       <keyword>NO_POLICY_SCOPE</keyword> | ||||
|       <keyword>NOT</keyword> | ||||
|       <keyword>NOTEQUAL</keyword> | ||||
|       <keyword>NOTICE</keyword> | ||||
|       <keyword>NUMBER_ERRORS</keyword> | ||||
|       <keyword>NUMBER_WARNINGS</keyword> | ||||
|       <keyword>OBJC_EXTENSIONS</keyword> | ||||
|       <keyword>OBJC_STANDARD</keyword> | ||||
|       <keyword>OBJC_STANDARD_REQUIRED</keyword> | ||||
|       <keyword>OBJCXX_EXTENSIONS</keyword> | ||||
|       <keyword>OBJCXX_STANDARD</keyword> | ||||
|       <keyword>OBJCXX_STANDARD_REQUIRED</keyword> | ||||
|       <keyword>OBJECT</keyword> | ||||
|       <keyword>OBJECTS</keyword> | ||||
|       <keyword>OLD</keyword> | ||||
|       <keyword>ONLY_CMAKE_FIND_ROOT_PATH</keyword> | ||||
|       <keyword>OPTIONAL</keyword> | ||||
|       <keyword>OPTIONAL_COMPONENTS</keyword> | ||||
|       <keyword>OPTIONS</keyword> | ||||
|       <keyword>OR</keyword> | ||||
|       <keyword>OUTPUT</keyword> | ||||
|       <keyword>OUTPUT_FILE</keyword> | ||||
|       <keyword>OUTPUT_FORMAT</keyword> | ||||
|       <keyword>OUTPUT_QUIET</keyword> | ||||
|       <keyword>OUTPUT_STRIP_TRAILING_WHITESPACE</keyword> | ||||
|       <keyword>OUTPUT_VARIABLE</keyword> | ||||
|       <keyword>OWNER_EXECUTE</keyword> | ||||
|       <keyword>OWNER_READ</keyword> | ||||
|       <keyword>OWNER_WRITE</keyword> | ||||
|       <keyword>PARALLEL_LEVEL</keyword> | ||||
|       <keyword>PARENT_SCOPE</keyword> | ||||
|       <keyword>PARTS</keyword> | ||||
|       <keyword>PATH</keyword> | ||||
|       <keyword>PATH_SUFFIXES</keyword> | ||||
|       <keyword>PATHS</keyword> | ||||
|       <keyword>PATTERN</keyword> | ||||
|       <keyword>PERMISSIONS</keyword> | ||||
|       <keyword>PLATFORM</keyword> | ||||
|       <keyword>POLICY</keyword> | ||||
|       <keyword>POP</keyword> | ||||
|       <keyword>POP_BACK</keyword> | ||||
|       <keyword>POP_FRONT</keyword> | ||||
|       <keyword>POST_BUILD</keyword> | ||||
|       <keyword>PREFIX</keyword> | ||||
|       <keyword>PREORDER</keyword> | ||||
|       <keyword>PREPEND</keyword> | ||||
|       <keyword>PRE_BUILD</keyword> | ||||
|       <keyword>PRE_LINK</keyword> | ||||
|       <keyword>PRIVATE</keyword> | ||||
|       <keyword>PRIVATE_HEADER</keyword> | ||||
|       <keyword>PROGRAM</keyword> | ||||
|       <keyword>PROGRAM_ARGS</keyword> | ||||
|       <keyword>PROGRAMS</keyword> | ||||
|       <keyword>PROPERTY</keyword> | ||||
|       <keyword>PROPERTIES</keyword> | ||||
|       <keyword>PUBLIC</keyword> | ||||
|       <keyword>PUBLIC_HEADER</keyword> | ||||
|       <keyword>PUSH</keyword> | ||||
|       <keyword>QUERY</keyword> | ||||
|       <keyword>QUIET</keyword> | ||||
|       <keyword>RANDOM</keyword> | ||||
|       <keyword>RANDOM_SEED</keyword> | ||||
|       <keyword>RANGE</keyword> | ||||
|       <keyword>READ</keyword> | ||||
|       <keyword>READ_SYMLINK</keyword> | ||||
|       <keyword>READ_WITH_PREFIX</keyword> | ||||
|       <keyword>REALPATH</keyword> | ||||
|       <keyword>REGEX</keyword> | ||||
|       <keyword>REGULAR_EXPRESSION</keyword> | ||||
|       <keyword>RELATIVE_PATH</keyword> | ||||
|       <keyword>REMOVE</keyword> | ||||
|       <keyword>REMOVE_AT</keyword> | ||||
|       <keyword>REMOVE_DUPLICATES</keyword> | ||||
|       <keyword>REMOVE_ITEM</keyword> | ||||
|       <keyword>REMOVE_RECURSE</keyword> | ||||
|       <keyword>RENAME</keyword> | ||||
|       <keyword>REPEAT</keyword> | ||||
|       <keyword>REPLACE</keyword> | ||||
|       <keyword>REQUIRED</keyword> | ||||
|       <keyword>RESOURCE</keyword> | ||||
|       <keyword>RESOURCE_SPEC_FILE</keyword> | ||||
|       <keyword>RESULT</keyword> | ||||
|       <keyword>RESULT_VARIABLE</keyword> | ||||
|       <keyword>RESULTS_VARIABLE</keyword> | ||||
|       <keyword>RETRY_COUNT</keyword> | ||||
|       <keyword>RETRY_DELAY</keyword> | ||||
|       <keyword>RETURN_VALUE</keyword> | ||||
|       <keyword>REUSE_FROM</keyword> | ||||
|       <keyword>REVERSE</keyword> | ||||
|       <keyword>RUN_OUTPUT_VARIABLE</keyword> | ||||
|       <keyword>RUNTIME</keyword> | ||||
|       <keyword>RUNTIME_DIRECTORY</keyword> | ||||
|       <keyword>SCHEDULE_RANDOM</keyword> | ||||
|       <keyword>SCRIPT</keyword> | ||||
|       <keyword>SEND_ERROR</keyword> | ||||
|       <keyword>SET</keyword> | ||||
|       <keyword>SHA1</keyword> | ||||
|       <keyword>SHA224</keyword> | ||||
|       <keyword>SHA256</keyword> | ||||
|       <keyword>SHA384</keyword> | ||||
|       <keyword>SHA512</keyword> | ||||
|       <keyword>SHA3_224</keyword> | ||||
|       <keyword>SHA3_256</keyword> | ||||
|       <keyword>SHA3_384</keyword> | ||||
|       <keyword>SHA3_512</keyword> | ||||
|       <keyword>SHARED</keyword> | ||||
|       <keyword>SIZE</keyword> | ||||
|       <keyword>SORT</keyword> | ||||
|       <keyword>SOURCE</keyword> | ||||
|       <keyword>START</keyword> | ||||
|       <keyword>STATIC</keyword> | ||||
|       <keyword>STATUS</keyword> | ||||
|       <keyword>STOP_ON_FAILURE</keyword> | ||||
|       <keyword>STOP_TIME</keyword> | ||||
|       <keyword>STREQUAL</keyword> | ||||
|       <keyword>STRGREATER</keyword> | ||||
|       <keyword>STRGREATER_EQUAL</keyword> | ||||
|       <keyword>STRIDE</keyword> | ||||
|       <keyword>STRING</keyword> | ||||
|       <keyword>STRINGS</keyword> | ||||
|       <keyword>STRIP</keyword> | ||||
|       <keyword>STRLESS</keyword> | ||||
|       <keyword>STRLESS_EQUAL</keyword> | ||||
|       <keyword>SUBLIST</keyword> | ||||
|       <keyword>SUBMIT_URL</keyword> | ||||
|       <keyword>SUBSTRING</keyword> | ||||
|       <keyword>SYSTEM</keyword> | ||||
|       <keyword>TARGET</keyword> | ||||
|       <keyword>TARGET_DIRECTORY</keyword> | ||||
|       <keyword>TARGETS</keyword> | ||||
|       <keyword>TEST</keyword> | ||||
|       <keyword>TEST_LOAD</keyword> | ||||
|       <keyword>TIMEOUT</keyword> | ||||
|       <keyword>TIMESTAMP</keyword> | ||||
|       <keyword>TOLOWER</keyword> | ||||
|       <keyword>TOUCH</keyword> | ||||
|       <keyword>TOUCH_NOCREATE</keyword> | ||||
|       <keyword>TOUPPER</keyword> | ||||
|       <keyword>TO_CMAKE_PATH</keyword> | ||||
|       <keyword>TO_NATIVE_PATH</keyword> | ||||
|       <keyword>TRACE</keyword> | ||||
|       <keyword>TRANSFORM</keyword> | ||||
|       <keyword>TREE</keyword> | ||||
|       <keyword>TYPE</keyword> | ||||
|       <keyword>UNIX</keyword> | ||||
|       <keyword>UNIX_COMMAND</keyword> | ||||
|       <keyword>UNKNOWN</keyword> | ||||
|       <keyword>UPLOAD</keyword> | ||||
|       <keyword>UPPER</keyword> | ||||
|       <keyword>USE_SOURCE_PERMISSIONS</keyword> | ||||
|       <keyword>USES_TERMINAL</keyword> | ||||
|       <keyword>UTC</keyword> | ||||
|       <keyword>UUID</keyword> | ||||
|       <keyword>VARIABLE</keyword> | ||||
|       <keyword>VERBATIM</keyword> | ||||
|       <keyword>VERBOSE</keyword> | ||||
|       <keyword>VERSION</keyword> | ||||
|       <keyword>VERSION_EQUAL</keyword> | ||||
|       <keyword>VERSION_GREATER</keyword> | ||||
|       <keyword>VERSION_GREATER_EQUAL</keyword> | ||||
|       <keyword>VERSION_LESS</keyword> | ||||
|       <keyword>VERSION_LESS_EQUAL</keyword> | ||||
|       <keyword>WARNING</keyword> | ||||
|       <keyword>WIN32</keyword> | ||||
|       <keyword>WINDOWS_COMMAND</keyword> | ||||
|       <keyword>WORKING_DIRECTORY</keyword> | ||||
|       <keyword>WRITE</keyword> | ||||
|       <keyword>ZIP_LISTS</keyword> | ||||
|     </context> | ||||
|  | ||||
|     <context id="control" style-ref="control"> | ||||
|   | ||||
| @@ -131,6 +131,7 @@ | ||||
|       <keyword>private</keyword> | ||||
|       <keyword>protected</keyword> | ||||
|       <keyword>public</keyword> | ||||
|       <keyword>record</keyword> | ||||
|       <keyword>ref</keyword> | ||||
|       <keyword>sealed</keyword> | ||||
|       <keyword>static</keyword> | ||||
| @@ -157,6 +158,7 @@ | ||||
|       <keyword>goto</keyword> | ||||
|       <keyword>if</keyword> | ||||
|       <keyword>in</keyword> | ||||
|       <keyword>init</keyword> | ||||
|       <keyword>is</keyword> | ||||
|       <keyword>nameof</keyword> | ||||
|       <keyword>new</keyword> | ||||
|   | ||||
| @@ -7,7 +7,7 @@ | ||||
|  Copyright (C) 2004 Scott Martin <scott@coffeeblack.org> | ||||
|  Copyright (C) 2010 Patryk Zawadzki <patrys@pld-linux.org> | ||||
|  Copyright (C) 2016 Tobias Schönberg <tobias47n9e@gmail.com> | ||||
|  Copyright (C) 2018-2019 Jeffery To <jeffery.to@gmail.com> | ||||
|  Copyright (C) 2018-2020 Jeffery To <jeffery.to@gmail.com> | ||||
|  | ||||
|  GtkSourceView is free software; you can redistribute it and/or | ||||
|  modify it under the terms of the GNU Lesser General Public | ||||
| @@ -96,7 +96,8 @@ | ||||
|  | ||||
|   <default-regex-options case-sensitive="false"/> | ||||
|  | ||||
|   <keyword-char-class>[a-z0-9_\x{80}-\x{10ffff}\\-]</keyword-char-class> | ||||
|   <!-- from keyword-code-point --> | ||||
|   <keyword-char-class>[^\x{0}-\x{2C}\x{2E}\x{2F}\x{3A}-\x{40}\x{5B}\x{5D}\x{5E}\x{60}\x{7B}-\x{7F}]</keyword-char-class> | ||||
|  | ||||
|   <definitions> | ||||
|  | ||||
| @@ -125,30 +126,78 @@ | ||||
|       ) | ||||
|     </define-regex> | ||||
|  | ||||
|     <!-- https://drafts.csswg.org/css-syntax/#non-ascii-code-point --> | ||||
|     <define-regex id="non-ascii">[\x{80}-\x{10ffff}]</define-regex> | ||||
|     <!-- | ||||
|     https://drafts.csswg.org/css-syntax/#name-start-code-point | ||||
|  | ||||
|     includes: | ||||
|     U+0041-U+005A Latin capital letter A to Z (A-Z) | ||||
|     U+005F        Low line (_) | ||||
|     U+0061-U+007A Latin small letter A to Z (a-z) | ||||
|     U+0080-       Non-ASCII | ||||
|     --> | ||||
|     <define-regex id="identifier-start-code-point" extended="true"> | ||||
|       [^\x{0}-\x{40}\x{5B}-\x{5E}\x{60}\x{7B}-\x{7F}] | ||||
|     </define-regex> | ||||
|  | ||||
|     <!-- | ||||
|     https://drafts.csswg.org/css-syntax/#name-code-point | ||||
|  | ||||
|     includes: | ||||
|     U+002D        Hyphen-minus (-) | ||||
|     U+0030-U+0039 Digit zero to nine (0-9) | ||||
|     U+0041-U+005A Latin capital letter A to Z (A-Z) | ||||
|     U+005F        Low line (_) | ||||
|     U+0061-U+007A Latin small letter A to Z (a-z) | ||||
|     U+0080-       Non-ASCII | ||||
|     --> | ||||
|     <define-regex id="identifier-code-point" extended="true"> | ||||
|       [^\x{0}-\x{2C}\x{2E}\x{2F}\x{3A}-\x{40}\x{5B}-\x{5E}\x{60}\x{7B}-\x{7F}] | ||||
|     </define-regex> | ||||
|  | ||||
|     <!-- | ||||
|     identifier-code-point, excluding hyphen | ||||
|  | ||||
|     includes: | ||||
|     U+0030-U+0039 Digit zero to nine (0-9) | ||||
|     U+0041-U+005A Latin capital letter A to Z (A-Z) | ||||
|     U+005F        Low line (_) | ||||
|     U+0061-U+007A Latin small letter A to Z (a-z) | ||||
|     U+0080-       Non-ASCII | ||||
|     --> | ||||
|     <define-regex id="identifier-prefix-code-point" extended="true"> | ||||
|       [^\x{0}-\x{2F}\x{3A}-\x{40}\x{5B}-\x{5E}\x{60}\x{7B}-\x{7F}] | ||||
|     </define-regex> | ||||
|  | ||||
|     <!-- | ||||
|     identifier-code-point, including backslash | ||||
|  | ||||
|     includes: | ||||
|     U+002D        Hyphen-minus (-) | ||||
|     U+0030-U+0039 Digit zero to nine (0-9) | ||||
|     U+0041-U+005A Latin capital letter A to Z (A-Z) | ||||
|     U+005C        Reverse solidus (\) | ||||
|     U+005F        Low line (_) | ||||
|     U+0061-U+007A Latin small letter A to Z (a-z) | ||||
|     U+0080-       Non-ASCII | ||||
|     --> | ||||
|     <define-regex id="keyword-code-point" extended="true"> | ||||
|       [^\x{0}-\x{2C}\x{2E}\x{2F}\x{3A}-\x{40}\x{5B}\x{5D}\x{5E}\x{60}\x{7B}-\x{7F}] | ||||
|     </define-regex> | ||||
|  | ||||
|     <!-- | ||||
|     a combination of name-start code point and escape | ||||
|     https://drafts.csswg.org/css-syntax/#name-start-code-point | ||||
|     https://www.w3.org/TR/selectors-3/#lex | ||||
|     --> | ||||
|     <define-regex id="identifier-start-char" extended="true"> | ||||
|       [a-z_] | \%{non-ascii} | \%{escape} | ||||
|       \%{identifier-start-code-point} | \%{escape} | ||||
|     </define-regex> | ||||
|  | ||||
|     <!-- | ||||
|     a combination of name code point and escape | ||||
|     https://drafts.csswg.org/css-syntax/#name-code-point | ||||
|     https://www.w3.org/TR/selectors-3/#lex | ||||
|     --> | ||||
|     <define-regex id="identifier-chars" extended="true"> | ||||
|       (?> (?: [a-z0-9_-]+ | \%{non-ascii}+ | \%{escape}+ )+ ) | ||||
|     </define-regex> | ||||
|  | ||||
|     <!-- for lookbehinds (and lookaheads) --> | ||||
|     <define-regex id="single-identifier-char" extended="true"> | ||||
|       [a-z0-9_-] | \%{non-ascii} | ||||
|       (?> (?: \%{identifier-code-point}+ | \%{escape}+ )+ ) | ||||
|     </define-regex> | ||||
|  | ||||
|     <!-- https://drafts.csswg.org/css-syntax/#ident-token-diagram --> | ||||
| @@ -156,12 +205,22 @@ | ||||
|       (?: -- | -? \%{identifier-start-char} ) \%{identifier-chars}? | ||||
|     </define-regex> | ||||
|  | ||||
|     <!-- identifier-chars, excluding hyphen --> | ||||
|     <define-regex id="identifier-prefix-chars" extended="true"> | ||||
|       (?> (?: \%{identifier-prefix-code-point}+ | \%{escape}+ )+ ) | ||||
|     </define-regex> | ||||
|  | ||||
|     <!-- | ||||
|     https://www.w3.org/TR/CSS21/syndata.html#vendor-keywords | ||||
|     https://en.wikipedia.org/wiki/CSS_hack#List_of_prefixes | ||||
|     --> | ||||
|     <define-regex id="vendor-specific-prefix" extended="true"> | ||||
|       (?: [_-] \%{identifier-start-char}+ | mso | prince ) - | ||||
|       (?: | ||||
|         [_-] \%{identifier-start-char} \%{identifier-prefix-chars}? | | ||||
|         mso | | ||||
|         prince | ||||
|       ) | ||||
|       - | ||||
|     </define-regex> | ||||
|  | ||||
|     <define-regex id="vendor-specific-identifier" extended="true"> | ||||
| @@ -173,6 +232,14 @@ | ||||
|       -- \%{identifier-chars}+ | ||||
|     </define-regex> | ||||
|  | ||||
|     <define-regex id="keyword-start" extended="true"> | ||||
|       (?<! \%{keyword-code-point} ) | ||||
|     </define-regex> | ||||
|  | ||||
|     <define-regex id="keyword-end" extended="true"> | ||||
|       (?! \%{keyword-code-point} ) | ||||
|     </define-regex> | ||||
|  | ||||
|     <define-regex id="declaration-value-end">(?=[!;}])</define-regex> | ||||
|  | ||||
|     <define-regex id="test-value-end">(?=\))</define-regex> | ||||
| @@ -220,15 +287,21 @@ | ||||
|  | ||||
|     <!-- custom identifier --> | ||||
|     <context id="name" style-ref="name"> | ||||
|       <match>\%[\%{identifier}</match> | ||||
|       <match extended="true"> | ||||
|         \%{keyword-start} \%{identifier} | ||||
|       </match> | ||||
|     </context> | ||||
|  | ||||
|     <context id="vendor-specific-name" style-ref="vendor-specific"> | ||||
|       <match>\%[\%{vendor-specific-identifier}</match> | ||||
|       <match extended="true"> | ||||
|         \%{keyword-start} \%{vendor-specific-identifier} | ||||
|       </match> | ||||
|     </context> | ||||
|  | ||||
|     <context id="custom-property-name" style-ref="custom-property-name"> | ||||
|       <match>\%[\%{custom-property-identifier}</match> | ||||
|       <match extended="true"> | ||||
|         \%{keyword-start} \%{custom-property-identifier} | ||||
|       </match> | ||||
|     </context> | ||||
|  | ||||
|     <context id="escape" style-ref="escape"> | ||||
| @@ -270,10 +343,15 @@ | ||||
|     </context> | ||||
|  | ||||
|     <context id="hexadecimal-color" style-ref="color"> | ||||
|       <match>#([a-f0-9]{8}|[a-f0-9]{6}|[a-f0-9]{4}|[a-f0-9]{3})\%]</match> | ||||
|       <match extended="true"> | ||||
|         \# (?: [a-f0-9]{8} | [a-f0-9]{6} | [a-f0-9]{4} | [a-f0-9]{3} ) | ||||
|         \%{keyword-end} | ||||
|       </match> | ||||
|     </context> | ||||
|  | ||||
|     <context id="css3-named-color" style-ref="color"> | ||||
|       <prefix>\%{keyword-start}</prefix> | ||||
|       <suffix>\%{keyword-end}</suffix> | ||||
|       <keyword>aliceblue</keyword> | ||||
|       <keyword>antiquewhite</keyword> | ||||
|       <keyword>aquamarine</keyword> | ||||
| @@ -408,6 +486,8 @@ | ||||
|     </context> | ||||
|  | ||||
|     <context id="named-color" style-ref="color"> | ||||
|       <prefix>\%{keyword-start}</prefix> | ||||
|       <suffix>\%{keyword-end}</suffix> | ||||
|       <keyword>aqua</keyword> | ||||
|       <keyword>black</keyword> | ||||
|       <keyword>blue</keyword> | ||||
| @@ -452,11 +532,12 @@ | ||||
|     </define-regex> | ||||
|  | ||||
|     <define-regex id="non-number-char" extended="true"> | ||||
|       \%{single-identifier-char} | \. | ||||
|       \%{keyword-code-point} | \. | ||||
|     </define-regex> | ||||
|  | ||||
|     <context id="dimension" style-ref="dimension"> | ||||
|       <prefix>(?<!\%{non-number-char})\%{number}</prefix> | ||||
|       <suffix>\%{keyword-end}</suffix> | ||||
|       <keyword>ch</keyword> | ||||
|       <keyword>cm</keyword> | ||||
|       <keyword>deg</keyword> | ||||
| @@ -492,6 +573,7 @@ | ||||
|  | ||||
|     <context id="resolution" style-ref="dimension"> | ||||
|       <prefix>(?<!\%{non-number-char})\%{positive-number}</prefix> | ||||
|       <suffix>\%{keyword-end}</suffix> | ||||
|       <keyword>dpcm</keyword> | ||||
|       <keyword>dpi</keyword> | ||||
|       <keyword>dppx</keyword> | ||||
| @@ -534,8 +616,9 @@ | ||||
|  | ||||
|     <context id="unicode-range" style-ref="unicode-range"> | ||||
|       <match extended="true"> | ||||
|         \%[ u \+ (?> [a-f0-9?]{1,6} ) (?> - [a-f0-9]{1,6} )? | ||||
|         (?! \%{single-identifier-char} ) | ||||
|         \%{keyword-start} | ||||
|         u \+ (?> [a-f0-9?]{1,6} ) (?> - [a-f0-9]{1,6} )? | ||||
|         \%{keyword-end} | ||||
|       </match> | ||||
|     </context> | ||||
|  | ||||
| @@ -543,6 +626,8 @@ | ||||
|     <!-- functions --> | ||||
|  | ||||
|     <context id="css3-function-arguments" style-ref="keyword"> | ||||
|       <prefix>\%{keyword-start}</prefix> | ||||
|       <suffix>\%{keyword-end}</suffix> | ||||
|       <keyword>at</keyword> | ||||
|       <keyword>auto-fill</keyword> | ||||
|       <keyword>auto-fit</keyword> | ||||
| @@ -566,7 +651,9 @@ | ||||
|     </context> | ||||
|  | ||||
|     <context id="url"> | ||||
|       <start>url\(</start> | ||||
|       <start extended="true"> | ||||
|         \%{keyword-start} url \( | ||||
|       </start> | ||||
|       <end>\)</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="function"/> | ||||
| @@ -580,7 +667,9 @@ | ||||
|  | ||||
|     <!-- https://drafts.csswg.org/css-variables/#using-variables --> | ||||
|     <context id="var"> | ||||
|       <start>var\(</start> | ||||
|       <start extended="true"> | ||||
|         \%{keyword-start} var \( | ||||
|       </start> | ||||
|       <end>\)</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="function"/> | ||||
| @@ -600,7 +689,9 @@ | ||||
|     </context> | ||||
|  | ||||
|     <context id="vendor-specific-function"> | ||||
|       <start>\%[\%{vendor-specific-identifier}\(</start> | ||||
|       <start extended="true"> | ||||
|         \%{keyword-start} \%{vendor-specific-identifier} \( | ||||
|       </start> | ||||
|       <end>\)</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="vendor-specific"/> | ||||
| @@ -612,7 +703,9 @@ | ||||
|     </context> | ||||
|  | ||||
|     <context id="function"> | ||||
|       <start>\%[\%{identifier}\(</start> | ||||
|       <start extended="true"> | ||||
|         \%{keyword-start} \%{identifier} \( | ||||
|       </start> | ||||
|       <end>\)</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="function"/> | ||||
| @@ -686,6 +779,8 @@ | ||||
|     <!-- style properties --> | ||||
|  | ||||
|     <context id="svg-property-names" style-ref="property-name"> | ||||
|       <prefix>\%{keyword-start}</prefix> | ||||
|       <suffix>\%{keyword-end}</suffix> | ||||
|       <keyword>clip-path</keyword> | ||||
|       <keyword>clip-rule</keyword> | ||||
|       <keyword>color-interpolatation-filters</keyword> | ||||
| @@ -716,6 +811,8 @@ | ||||
|     </context> | ||||
|  | ||||
|     <context id="css3-property-names" style-ref="property-name"> | ||||
|       <prefix>\%{keyword-start}</prefix> | ||||
|       <suffix>\%{keyword-end}</suffix> | ||||
|       <keyword>align-content</keyword> | ||||
|       <keyword>align-items</keyword> | ||||
|       <keyword>align-self</keyword> | ||||
| @@ -851,6 +948,8 @@ | ||||
|     </context> | ||||
|  | ||||
|     <context id="property-names" style-ref="property-name"> | ||||
|       <prefix>\%{keyword-start}</prefix> | ||||
|       <suffix>\%{keyword-end}</suffix> | ||||
|       <keyword>azimuth</keyword> | ||||
|       <keyword>background-attachment</keyword> | ||||
|       <keyword>background-color</keyword> | ||||
| @@ -981,6 +1080,8 @@ | ||||
|     </context> | ||||
|  | ||||
|     <context id="animatable-properties" style-ref="keyword"> | ||||
|       <prefix>\%{keyword-start}</prefix> | ||||
|       <suffix>\%{keyword-end}</suffix> | ||||
|       <keyword>background-color</keyword> | ||||
|       <keyword>background-position</keyword> | ||||
|       <keyword>background-size</keyword> | ||||
| @@ -1075,6 +1176,8 @@ | ||||
|     </context> | ||||
|  | ||||
|     <context id="svg-property-values" style-ref="keyword"> | ||||
|       <prefix>\%{keyword-start}</prefix> | ||||
|       <suffix>\%{keyword-end}</suffix> | ||||
|       <keyword>alphabetic</keyword> | ||||
|       <keyword>bevel</keyword> | ||||
|       <keyword>butt</keyword> | ||||
| @@ -1108,6 +1211,8 @@ | ||||
|     </context> | ||||
|  | ||||
|     <context id="east-asian-variant-values" style-ref="keyword"> | ||||
|       <prefix>\%{keyword-start}</prefix> | ||||
|       <suffix>\%{keyword-end}</suffix> | ||||
|       <keyword>jis04</keyword> | ||||
|       <keyword>jis78</keyword> | ||||
|       <keyword>jis83</keyword> | ||||
| @@ -1117,6 +1222,8 @@ | ||||
|     </context> | ||||
|  | ||||
|     <context id="page-sizes" style-ref="keyword"> | ||||
|       <prefix>\%{keyword-start}</prefix> | ||||
|       <suffix>\%{keyword-end}</suffix> | ||||
|       <keyword>A3</keyword> | ||||
|       <keyword>A4</keyword> | ||||
|       <keyword>A5</keyword> | ||||
| @@ -1130,12 +1237,13 @@ | ||||
|     </context> | ||||
|  | ||||
|     <context id="css3-property-values" style-ref="keyword"> | ||||
|       <prefix>\%{keyword-start}</prefix> | ||||
|       <suffix>\%{keyword-end}</suffix> | ||||
|       <keyword>active</keyword> | ||||
|       <keyword>add</keyword> | ||||
|       <keyword>allow-end</keyword> | ||||
|       <keyword>all-petite-caps</keyword> | ||||
|       <keyword>all-small-caps</keyword> | ||||
|       <keyword>all-scroll</keyword> <!-- css2, but needed for regex --> | ||||
|       <keyword>all</keyword> | ||||
|       <keyword>alpha</keyword> | ||||
|       <keyword>alternate-reverse</keyword> | ||||
| @@ -1209,7 +1317,6 @@ | ||||
|       <keyword>kashida</keyword> | ||||
|       <keyword>keep-all</keyword> | ||||
|       <keyword>last</keyword> | ||||
|       <keyword>left-side</keyword> <!-- css2, but needed for regex --> | ||||
|       <keyword>left</keyword> | ||||
|       <keyword>lighten</keyword> | ||||
|       <keyword>linear</keyword> | ||||
| @@ -1287,6 +1394,8 @@ | ||||
|     </context> | ||||
|  | ||||
|     <context id="property-values" style-ref="keyword"> | ||||
|       <prefix>\%{keyword-start}</prefix> | ||||
|       <suffix>\%{keyword-end}</suffix> | ||||
|       <keyword>above</keyword> | ||||
|       <keyword>absolute</keyword> | ||||
|       <keyword>alias</keyword> | ||||
| @@ -1546,6 +1655,8 @@ | ||||
|     <!-- modifiers --> | ||||
|  | ||||
|     <context id="modifiers" style-ref="modifier"> | ||||
|       <prefix>\%{keyword-start}</prefix> | ||||
|       <suffix>\%{keyword-end}</suffix> | ||||
|       <keyword>important</keyword> | ||||
|     </context> | ||||
|  | ||||
| @@ -1623,12 +1734,16 @@ | ||||
|     <!-- media queries --> | ||||
|  | ||||
|     <context id="media-query-operators" style-ref="media-query-operator"> | ||||
|       <prefix>\%{keyword-start}</prefix> | ||||
|       <suffix>\%{keyword-end}</suffix> | ||||
|       <keyword>and</keyword> | ||||
|       <keyword>not</keyword> | ||||
|       <keyword>only</keyword> | ||||
|     </context> | ||||
|  | ||||
|     <context id="media-types" style-ref="media-type"> | ||||
|       <prefix>\%{keyword-start}</prefix> | ||||
|       <suffix>\%{keyword-end}</suffix> | ||||
|       <keyword>all</keyword> | ||||
|       <keyword>print</keyword> | ||||
|       <keyword>screen</keyword> | ||||
| @@ -1636,6 +1751,8 @@ | ||||
|     </context> | ||||
|  | ||||
|     <context id="css3-media-features" style-ref="media-feature"> | ||||
|       <prefix>\%{keyword-start}</prefix> | ||||
|       <suffix>\%{keyword-end}</suffix> | ||||
|       <keyword>any-hover</keyword> | ||||
|       <keyword>any-pointer</keyword> | ||||
|       <keyword>aspect-ratio</keyword> | ||||
| @@ -1672,6 +1789,8 @@ | ||||
|     </context> | ||||
|  | ||||
|     <context id="css3-media-feature-values" style-ref="media-feature-value"> | ||||
|       <prefix>\%{keyword-start}</prefix> | ||||
|       <suffix>\%{keyword-end}</suffix> | ||||
|       <keyword>browser</keyword> | ||||
|       <keyword>coarse</keyword> | ||||
|       <keyword>fast</keyword> | ||||
| @@ -1835,7 +1954,9 @@ | ||||
|     </context> | ||||
|  | ||||
|     <context id="at-charset-error" style-ref="error"> | ||||
|       <start>@charset\%]</start> | ||||
|       <start extended="true"> | ||||
|         @charset \%{keyword-end} | ||||
|       </start> | ||||
|       <include> | ||||
|         <context ref="embedded-lang-hook"/> | ||||
|         <!-- no comment here --> | ||||
| @@ -1844,7 +1965,9 @@ | ||||
|     </context> | ||||
|  | ||||
|     <context id="at-charset-no-error"> | ||||
|       <start>@charset\%]</start> | ||||
|       <start extended="true"> | ||||
|         @charset \%{keyword-end} | ||||
|       </start> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="at-rule"/> | ||||
|         <context ref="embedded-lang-hook"/> | ||||
| @@ -1872,7 +1995,9 @@ | ||||
|     --> | ||||
|  | ||||
|     <context id="at-font-face"> | ||||
|       <start>@font-face\%]</start> | ||||
|       <start extended="true"> | ||||
|         @font-face \%{keyword-end} | ||||
|       </start> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="at-rule"/> | ||||
|         <context ref="embedded-lang-hook"/> | ||||
| @@ -1891,6 +2016,7 @@ | ||||
|  | ||||
|     <context id="font-feature-types" style-ref="at-rule-inner-selector"> | ||||
|       <prefix>@</prefix> | ||||
|       <suffix>\%{keyword-end}</suffix> | ||||
|       <keyword>annotation</keyword> | ||||
|       <keyword>character-variant</keyword> | ||||
|       <keyword>ornaments</keyword> | ||||
| @@ -1956,7 +2082,9 @@ | ||||
|     </context> | ||||
|  | ||||
|     <context id="at-font-feature-values"> | ||||
|       <start>@font-feature-values\%]</start> | ||||
|       <start extended="true"> | ||||
|         @font-feature-values \%{keyword-end} | ||||
|       </start> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="at-rule"/> | ||||
|         <context ref="embedded-lang-hook"/> | ||||
| @@ -1972,7 +2100,9 @@ | ||||
|     --> | ||||
|  | ||||
|     <context id="at-import"> | ||||
|       <start>@import\%]</start> | ||||
|       <start extended="true"> | ||||
|         @import \%{keyword-end} | ||||
|       </start> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="at-rule"/> | ||||
|         <context ref="embedded-lang-hook"/> | ||||
| @@ -1991,6 +2121,8 @@ | ||||
|     --> | ||||
|  | ||||
|     <context id="keyframe-selector" style-ref="at-rule-inner-selector"> | ||||
|       <prefix>\%{keyword-start}</prefix> | ||||
|       <suffix>\%{keyword-end}</suffix> | ||||
|       <keyword>from</keyword> | ||||
|       <keyword>to</keyword> | ||||
|     </context> | ||||
| @@ -2016,7 +2148,9 @@ | ||||
|     </context> | ||||
|  | ||||
|     <context id="vendor-specific-at-keyframes"> | ||||
|       <start>@\%{vendor-specific-prefix}keyframes\%]</start> | ||||
|       <start extended="true"> | ||||
|         @ \%{vendor-specific-prefix} keyframes \%{keyword-end} | ||||
|       </start> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="vendor-specific"/> | ||||
|         <context ref="embedded-lang-hook"/> | ||||
| @@ -2028,7 +2162,9 @@ | ||||
|     </context> | ||||
|  | ||||
|     <context id="at-keyframes"> | ||||
|       <start>@keyframes\%]</start> | ||||
|       <start extended="true"> | ||||
|         @keyframes \%{keyword-end} | ||||
|       </start> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="at-rule"/> | ||||
|         <context ref="embedded-lang-hook"/> | ||||
| @@ -2044,7 +2180,9 @@ | ||||
|     --> | ||||
|  | ||||
|     <context id="at-media"> | ||||
|       <start>@media\%]</start> | ||||
|       <start extended="true"> | ||||
|         @media \%{keyword-end} | ||||
|       </start> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="at-rule"/> | ||||
|         <context ref="embedded-lang-hook"/> | ||||
| @@ -2065,7 +2203,9 @@ | ||||
|     </context> | ||||
|  | ||||
|     <context id="at-namespace"> | ||||
|       <start>@namespace\%]</start> | ||||
|       <start extended="true"> | ||||
|         @namespace \%{keyword-end} | ||||
|       </start> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="at-rule"/> | ||||
|         <context ref="embedded-lang-hook"/> | ||||
| @@ -2086,7 +2226,9 @@ | ||||
|  | ||||
|     <context id="pseudo-page-names" end-parent="true" style-ref="pseudo-class"> | ||||
|       <start extended="true"> | ||||
|         \%[ (?: blank | first | left | right ) \%] | ||||
|         \%{keyword-start} | ||||
|         (?: blank | first | left | right ) | ||||
|         \%{keyword-end} | ||||
|       </start> | ||||
|       <end>\%{def:always-match}</end> | ||||
|     </context> | ||||
| @@ -2104,6 +2246,7 @@ | ||||
|  | ||||
|     <context id="page-margin-box-types" style-ref="at-rule-inner-selector"> | ||||
|       <prefix>@</prefix> | ||||
|       <suffix>\%{keyword-end}</suffix> | ||||
|       <keyword>bottom-center</keyword> | ||||
|       <keyword>bottom-left-corner</keyword> | ||||
|       <keyword>bottom-left</keyword> | ||||
| @@ -2137,7 +2280,9 @@ | ||||
|     </context> | ||||
|  | ||||
|     <context id="at-page"> | ||||
|       <start>@page\%]</start> | ||||
|       <start extended="true"> | ||||
|         @page \%{keyword-end} | ||||
|       </start> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="at-rule"/> | ||||
|         <context ref="embedded-lang-hook"/> | ||||
| @@ -2154,6 +2299,8 @@ | ||||
|     --> | ||||
|  | ||||
|     <context id="at-supports-operators" style-ref="at-rule-operator"> | ||||
|       <prefix>\%{keyword-start}</prefix> | ||||
|       <suffix>\%{keyword-end}</suffix> | ||||
|       <keyword>and</keyword> | ||||
|       <keyword>not</keyword> | ||||
|       <keyword>or</keyword> | ||||
| @@ -2202,7 +2349,9 @@ | ||||
|     </context> | ||||
|  | ||||
|     <context id="at-supports"> | ||||
|       <start>@supports\%]</start> | ||||
|       <start extended="true"> | ||||
|         @supports \%{keyword-end} | ||||
|       </start> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="at-rule"/> | ||||
|         <context ref="embedded-lang-hook"/> | ||||
| @@ -2237,7 +2386,9 @@ | ||||
|     <!-- namespace qualifier --> | ||||
|  | ||||
|     <context id="namespace-qualifier"> | ||||
|       <match>(\%[\%{identifier}|\*)?(\|)</match> | ||||
|       <match extended="true"> | ||||
|         ( \%{keyword-start} \%{identifier} | \* )? ( \| ) | ||||
|       </match> | ||||
|       <include> | ||||
|         <context sub-pattern="1" style-ref="namespace"/> | ||||
|         <context sub-pattern="2" style-ref="namespace-qualifier"/> | ||||
| @@ -2255,7 +2406,9 @@ | ||||
|     </context> | ||||
|  | ||||
|     <context id="type-selector" style-ref="type-selector"> | ||||
|       <match>\%[\%{identifier}</match> | ||||
|       <match extended="true"> | ||||
|         \%{keyword-start} \%{identifier} | ||||
|       </match> | ||||
|     </context> | ||||
|  | ||||
|     <context id="universal-selector" style-ref="universal-selector"> | ||||
| @@ -2263,7 +2416,9 @@ | ||||
|     </context> | ||||
|  | ||||
|     <context id="attribute-selector-attribute-name" once-only="true" style-ref="attribute-selector-name"> | ||||
|       <match>\%[\%{identifier}</match> | ||||
|       <match extended="true"> | ||||
|         \%{keyword-start} \%{identifier} | ||||
|       </match> | ||||
|     </context> | ||||
|  | ||||
|     <context id="attribute-selector-operator" once-only="true" style-ref="attribute-selector-operator"> | ||||
| @@ -2311,20 +2466,26 @@ | ||||
|     <!-- pseudo-elements --> | ||||
|  | ||||
|     <context id="vendor-specific-pseudo-element-name" end-parent="true" style-ref="vendor-specific"> | ||||
|       <start>\%[\%{vendor-specific-identifier}</start> | ||||
|       <start extended="true"> | ||||
|         \%{keyword-start} \%{vendor-specific-identifier} | ||||
|       </start> | ||||
|       <end>\%{def:always-match}</end> | ||||
|     </context> | ||||
|  | ||||
|     <context id="single-colon-pseudo-element-names" end-parent="true" style-ref="pseudo-element"> | ||||
|       <start extended="true"> | ||||
|         \%[ (?: after | before | first-letter | first-line ) \%] | ||||
|         \%{keyword-start} | ||||
|         (?: after | before | first-letter | first-line ) | ||||
|         \%{keyword-end} | ||||
|       </start> | ||||
|       <end>\%{def:always-match}</end> | ||||
|     </context> | ||||
|  | ||||
|     <context id="pseudo-element-names" end-parent="true" style-ref="pseudo-element"> | ||||
|       <start extended="true"> | ||||
|         \%[ (?: placeholder | selection ) \%] | ||||
|         \%{keyword-start} | ||||
|         (?: placeholder | selection ) | ||||
|         \%{keyword-end} | ||||
|       </start> | ||||
|       <end>\%{def:always-match}</end> | ||||
|     </context> | ||||
| @@ -2351,13 +2512,15 @@ | ||||
|     <!-- pseudo-classes --> | ||||
|  | ||||
|     <context id="vendor-specific-pseudo-class-name" end-parent="true" style-ref="vendor-specific"> | ||||
|       <start>\%[\%{vendor-specific-identifier}</start> | ||||
|       <start extended="true"> | ||||
|         \%{keyword-start} \%{vendor-specific-identifier} | ||||
|       </start> | ||||
|       <end>\%{def:always-match}</end> | ||||
|     </context> | ||||
|  | ||||
|     <context id="pseudo-class-names" end-parent="true" style-ref="pseudo-class"> | ||||
|       <start extended="true"> | ||||
|         \%[ | ||||
|         \%{keyword-start} | ||||
|         (?: | ||||
|           active | | ||||
|           checked | | ||||
| @@ -2387,7 +2550,7 @@ | ||||
|           valid | | ||||
|           visited | ||||
|         ) | ||||
|         \%] | ||||
|         \%{keyword-end} | ||||
|       </start> | ||||
|       <end>\%{def:always-match}</end> | ||||
|     </context> | ||||
| @@ -2399,7 +2562,9 @@ | ||||
|     </context> | ||||
|  | ||||
|     <context id="lang-pseudo-class" end-parent="true"> | ||||
|       <start>\%[lang\(</start> | ||||
|       <start extended="true"> | ||||
|         \%{keyword-start} lang \( | ||||
|       </start> | ||||
|       <end>\)</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="pseudo-class"/> | ||||
| @@ -2425,7 +2590,9 @@ | ||||
|     </context> | ||||
|  | ||||
|     <context id="not-pseudo-class" end-parent="true"> | ||||
|       <start>\%[not\(</start> | ||||
|       <start extended="true"> | ||||
|         \%{keyword-start} not \( | ||||
|       </start> | ||||
|       <end>\)</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="pseudo-class"/> | ||||
| @@ -2441,6 +2608,8 @@ | ||||
|     </context> | ||||
|  | ||||
|     <context id="nth-pseudo-class-keywords" once-only="true" style-ref="keyword"> | ||||
|       <prefix>\%{keyword-start}</prefix> | ||||
|       <suffix>\%{keyword-end}</suffix> | ||||
|       <keyword>even</keyword> | ||||
|       <keyword>odd</keyword> | ||||
|     </context> | ||||
| @@ -2497,7 +2666,9 @@ | ||||
|  | ||||
|     <context id="nth-pseudo-class" end-parent="true"> | ||||
|       <start extended="true"> | ||||
|         \%[ (nth-child | nth-of-type | nth-last-child | nth-last-of-type) \( | ||||
|         \%{keyword-start} | ||||
|         (?: nth-child | nth-of-type | nth-last-child | nth-last-of-type ) | ||||
|         \( | ||||
|       </start> | ||||
|       <end>\)</end> | ||||
|       <include> | ||||
|   | ||||
| @@ -152,15 +152,31 @@ | ||||
|     <!-- $^ never matches. --> | ||||
|     <define-regex id="never-match">$^</define-regex> | ||||
|  | ||||
|     <!-- Unicode ID_Start and ID_Continue characters | ||||
|          Descriptions from https://www.unicode.org/reports/tr31/#Table_Lexical_Classes_for_Identifiers | ||||
|          Other_ID_Start and Other_ID_Continue code points from https://www.unicode.org/Public/12.1.0/ucd/PropList.txt | ||||
|     <!-- Unicode lexical classes for identifiers | ||||
|  | ||||
|          Descriptions from: | ||||
|          https://www.unicode.org/reports/tr31/#Table_Lexical_Classes_for_Identifiers | ||||
|          Code point data from: | ||||
|          https://www.unicode.org/Public/13.0.0/ucd/DerivedCoreProperties.txt | ||||
|          https://www.unicode.org/Public/13.0.0/ucd/PropList.txt | ||||
|  | ||||
|          U+2E2F VERTICAL TILDE is the only applicable code point in | ||||
|          Pattern_Syntax (and Pattern_White_Space) to subtract to form | ||||
|          ID_Start and ID_Continue | ||||
|     --> | ||||
|     <define-regex id="unicode-id-start" extended="true"> | ||||
|       [\p{L}\p{Nl}\x{1885}-\x{1886}\x{2118}\x{212E}\x{309B}-\x{309C}] | ||||
|       (?!\x{2E2F}) [\p{L}\p{Nl}\x{1885}-\x{1886}\x{2118}\x{212E}\x{309B}-\x{309C}] | ||||
|     </define-regex> | ||||
|     <define-regex id="unicode-id-continue" extended="true"> | ||||
|       [\p{L}\p{Nl}\x{1885}-\x{1886}\x{2118}\x{212E}\x{309B}-\x{309C}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{00B7}\x{0387}\x{1369}-\x{1371}\x{19DA}] | ||||
|       (?!\x{2E2F}) [\p{L}\p{Nl}\x{1885}-\x{1886}\x{2118}\x{212E}\x{309B}-\x{309C}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{00B7}\x{0387}\x{1369}-\x{1371}\x{19DA}] | ||||
|     </define-regex> | ||||
|     <define-regex id="unicode-xid-start" extended="true"> | ||||
|       (?![\x{037A}\x{0E33}\x{0EB3}\x{309B}-\x{309C}\x{FC5E}-\x{FC63}\x{FDFA}-\x{FDFB}\x{FE70}\x{FE72}\x{FE74}\x{FE76}\x{FE78}\x{FE7A}\x{FE7C}\x{FE7E}\x{FF9E}-\x{FF9F}]) | ||||
|       \%{unicode-id-start} | ||||
|     </define-regex> | ||||
|     <define-regex id="unicode-xid-continue" extended="true"> | ||||
|       (?![\x{037A}\x{309B}-\x{309C}\x{FC5E}-\x{FC63}\x{FDFA}-\x{FDFB}\x{FE70}\x{FE72}\x{FE74}\x{FE76}\x{FE78}\x{FE7A}\x{FE7C}\x{FE7E}]) | ||||
|       \%{unicode-id-continue} | ||||
|     </define-regex> | ||||
|  | ||||
|     <define-regex id="decimal" extended="true"> | ||||
|   | ||||
| @@ -0,0 +1,39 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <!-- | ||||
|  | ||||
|  This file is part of GtkSourceView | ||||
|  | ||||
|  GtkSourceView is free software; you can redistribute it and/or | ||||
|  modify it under the terms of the GNU Lesser General Public | ||||
|  License as published by the Free Software Foundation; either | ||||
|  version 2.1 of the License, or (at your option) any later version. | ||||
|  | ||||
|  GtkSourceView is distributed in the hope that it will be useful, | ||||
|  but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
|  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU | ||||
|  Lesser General Public License for more details. | ||||
|  | ||||
|  You should have received a copy of the GNU Lesser General Public License | ||||
|  along with this library; if not, see <http://www.gnu.org/licenses/>. | ||||
|  | ||||
| --> | ||||
| <language id="erb-html" name="ERB (HTML)" version="2.0" _section="Markup"> | ||||
|   <metadata> | ||||
|     <property name="mimetypes">text/rhtml</property> | ||||
|     <property name="globs">*.html.erb;*.rhtml</property> | ||||
|     <property name="block-comment-start"><!--</property> | ||||
|     <property name="block-comment-end">--></property> | ||||
|   </metadata> | ||||
|  | ||||
|   <definitions> | ||||
|     <replace id="html:embedded-lang-hook" ref="erb:erb"/> | ||||
|  | ||||
|     <context id="erb-html"> | ||||
|       <include> | ||||
|         <context ref="erb:erb"/> | ||||
|         <context ref="html:html"/> | ||||
|       </include> | ||||
|     </context> | ||||
|   </definitions> | ||||
| </language> | ||||
|  | ||||
| @@ -0,0 +1,39 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <!-- | ||||
|  | ||||
|  This file is part of GtkSourceView | ||||
|  | ||||
|  GtkSourceView is free software; you can redistribute it and/or | ||||
|  modify it under the terms of the GNU Lesser General Public | ||||
|  License as published by the Free Software Foundation; either | ||||
|  version 2.1 of the License, or (at your option) any later version. | ||||
|  | ||||
|  GtkSourceView is distributed in the hope that it will be useful, | ||||
|  but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
|  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU | ||||
|  Lesser General Public License for more details. | ||||
|  | ||||
|  You should have received a copy of the GNU Lesser General Public License | ||||
|  along with this library; if not, see <http://www.gnu.org/licenses/>. | ||||
|  | ||||
| --> | ||||
| <language id="erb-js" name="ERB (JavaScript)" version="2.0" _section="Markup"> | ||||
|   <metadata> | ||||
|     <property name="globs">*.js.erb</property> | ||||
|     <property name="line-comment-start">//</property> | ||||
|     <property name="block-comment-start">/*</property> | ||||
|     <property name="block-comment-end">*/</property> | ||||
|   </metadata> | ||||
|  | ||||
|   <definitions> | ||||
|     <replace id="js:embedded-lang-hooks" ref="erb:erb"/> | ||||
|  | ||||
|     <context id="erb-js"> | ||||
|       <include> | ||||
|         <context ref="erb:erb"/> | ||||
|         <context ref="js:js"/> | ||||
|       </include> | ||||
|     </context> | ||||
|   </definitions> | ||||
| </language> | ||||
|  | ||||
							
								
								
									
										66
									
								
								gtk-nsis-pack/share/gtksourceview-4/language-specs/erb.lang
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										66
									
								
								gtk-nsis-pack/share/gtksourceview-4/language-specs/erb.lang
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,66 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <!-- | ||||
|  | ||||
|  This file is part of GtkSourceView | ||||
|  | ||||
|  GtkSourceView is free software; you can redistribute it and/or | ||||
|  modify it under the terms of the GNU Lesser General Public | ||||
|  License as published by the Free Software Foundation; either | ||||
|  version 2.1 of the License, or (at your option) any later version. | ||||
|  | ||||
|  GtkSourceView is distributed in the hope that it will be useful, | ||||
|  but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
|  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU | ||||
|  Lesser General Public License for more details. | ||||
|  | ||||
|  You should have received a copy of the GNU Lesser General Public License | ||||
|  along with this library; if not, see <http://www.gnu.org/licenses/>. | ||||
|  | ||||
| --> | ||||
| <language id="erb" name="ERB" version="2.0" _section="Markup"> | ||||
|   <metadata> | ||||
|     <property name="mimetypes">text/erb</property> | ||||
|     <property name="globs">*.erb</property> | ||||
|     <property name="block-comment-start"><%#</property> | ||||
|     <property name="block-comment-end">%></property> | ||||
|   </metadata> | ||||
|  | ||||
|   <styles> | ||||
|     <style id="preprocessor" name="Preprocessor tags" map-to="def:preprocessor"/> | ||||
|     <style id="erb-comment"  name="Embedded Ruby comment" map-to="def:comment"/> | ||||
|     <style id="erb-block" name="Embedded Ruby code"/> | ||||
|   </styles> | ||||
|  | ||||
|   <definitions> | ||||
|     <context id="erb-comment" style-ref="erb-comment" class-disabled="no-spell-check" class="comment"> | ||||
|       <start><%#</start> | ||||
|       <end>%></end> | ||||
|       <include> | ||||
|         <context ref="def:in-comment"/> | ||||
|       </include> | ||||
|     </context> | ||||
|  | ||||
|     <context id="erb-literal" style-ref="preprocessor"> | ||||
|       <match><%%</match> | ||||
|     </context> | ||||
|  | ||||
|     <context id="erb-block" style-ref="erb-block" class="no-spell-check"> | ||||
|       <start><%[=-]?</start> | ||||
|       <end>-?%></end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="preprocessor"/> | ||||
|         <context sub-pattern="0" where="end" style-ref="preprocessor"/> | ||||
|         <context ref="ruby:ruby:*"/> | ||||
|       </include> | ||||
|     </context> | ||||
|  | ||||
|     <context id="erb"> | ||||
|       <include> | ||||
|         <context ref="erb-comment"/> | ||||
|         <context ref="erb-literal"/> | ||||
|         <context ref="erb-block"/> | ||||
|       </include> | ||||
|     </context> | ||||
|   </definitions> | ||||
| </language> | ||||
|  | ||||
| @@ -77,7 +77,7 @@ | ||||
|       <match extended="true"> | ||||
|         \%{preproc-start} | ||||
|         (include|import)\s* | ||||
|         (".*?"|<.*>) | ||||
|         (".*?"|<.*?>) | ||||
|       </match> | ||||
|       <include> | ||||
|         <context id="included-file" sub-pattern="2" style-ref="included-file" class="path"/> | ||||
|   | ||||
| @@ -142,7 +142,7 @@ | ||||
|     </define-regex> | ||||
|  | ||||
|     <context id="imaginary" style-ref="imaginary"> | ||||
|       <match>(?<![\w\.])(\%{float}|\%{oct}|\%{bin}|\%{hex}|\[0-9]+)[i]\b</match> | ||||
|       <match>(?<![\w\.])(\%{float}|\%{oct}|\%{bin}|\%{hex}|\%{dec})[i]\b</match> | ||||
|     </context> | ||||
|  | ||||
|     <context id="float" style-ref="floating-point"> | ||||
|   | ||||
| @@ -8,7 +8,7 @@ | ||||
|  Copyright (C) 2005 Stef Walter (formerly Nate Nielsen) <stef@memberwebs.com> | ||||
|  Copyright (C) 2005-2007 Marco Barisione <barisione@gmail.com> | ||||
|  Copyright (C) 2005-2007 Emanuele Aina | ||||
|  Copyright (C) 2019 Jeffery To <jeffery.to@gmail.com> | ||||
|  Copyright (C) 2019-2020 Jeffery To <jeffery.to@gmail.com> | ||||
|  | ||||
|  GtkSourceView is free software; you can redistribute it and/or | ||||
|  modify it under the terms of the GNU Lesser General Public | ||||
| @@ -26,7 +26,7 @@ | ||||
| --> | ||||
| <language id="js-expr" name="JavaScript Expressions" version="2.0" _section="Script" hidden="true"> | ||||
|   <!-- from js:identifier-char --> | ||||
|   <keyword-char-class>[\p{L}\p{Nl}\x{1885}-\x{1886}\x{2118}\x{212E}\x{309B}-\x{309C}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{00B7}\x{0387}\x{1369}-\x{1371}\x{19DA}$\x{200C}\x{200D}]</keyword-char-class> | ||||
|   <keyword-char-class>(?!\x{2E2F})[\p{L}\p{Nl}\x{1885}-\x{1886}\x{2118}\x{212E}\x{309B}-\x{309C}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{00B7}\x{0387}\x{1369}-\x{1371}\x{19DA}$\x{200C}\x{200D}]</keyword-char-class> | ||||
|  | ||||
|   <definitions> | ||||
|  | ||||
| @@ -37,11 +37,11 @@ | ||||
|     <!-- | ||||
|          Expression / context structure: | ||||
|  | ||||
|          left-hand side (lhs) expression:  new Array () | ||||
|                                            === ===== == | ||||
|                                            /     |     \ | ||||
|                                 pre-primary   primary   post-primary | ||||
|                                 expression   expression  expression | ||||
|          left-hand side (lhs) expression:  Array () | ||||
|                                            ===== == | ||||
|                                             /      \ | ||||
|                                      primary        post-primary | ||||
|                                  expression          expression | ||||
|  | ||||
|          expression: - obj.count + 1 | ||||
|                      = ========= === | ||||
| @@ -51,48 +51,134 @@ | ||||
|     --> | ||||
|  | ||||
|  | ||||
|     <!-- # Pre-primary expression --> | ||||
|     <!-- # "import" expression | ||||
|  | ||||
|     <context id="_pre-primary-expression"> | ||||
|          import("module") | ||||
|          import.meta | ||||
|     --> | ||||
|  | ||||
|     <!-- a consequence of this is that "import" by itself (when used as | ||||
|          a primary expression) will not be highlighted as an error --> | ||||
|  | ||||
|     <!-- ES2020 --> | ||||
|     <!-- <ImportCall> (part of) --> | ||||
|     <context id="_choice-import-call-expression" end-parent="true"> | ||||
|       <start>\(</start> | ||||
|       <end>\)</end> | ||||
|       <include> | ||||
|         <context ref="js:embedded-lang-hooks"/> | ||||
|         <context ref="js:comments"/> | ||||
|  | ||||
|         <!-- ES2017, cannot be followed by line terminator --> | ||||
|         <context id="_async-pre-primary-expression-keyword" style-ref="js:keyword"> | ||||
|           <match extended="true"> | ||||
|             \%[ async \%] | ||||
|             (?=                                       # preceeds arrow function | ||||
|               \%{js:optional-whitespace-or-comments} | ||||
|               (?: | ||||
|                 \%{js:identifier} | ||||
|                 \%{js:optional-whitespace-or-comments} | ||||
|                 => | | ||||
|                 \(                                      # can this be better? | ||||
|               ) | ||||
|             ) | ||||
|             (?!                                       # does not preceed "function" (leave to function expression) | ||||
|               \%{js:optional-whitespace-or-comments} | ||||
|               \%[ function \%] | ||||
|             ) | ||||
|           </match> | ||||
|         </context> <!-- /_async-pre-primary-expression-keyword --> | ||||
|         <context id="_import-call-expression-content"> | ||||
|           <include> | ||||
|             <context ref="expression-without-comma"/> | ||||
|           </include> | ||||
|         </context> <!-- /_import-call-expression-content --> | ||||
|       </include> | ||||
|     </context> <!-- /_choice-import-call-expression --> | ||||
|  | ||||
|         <context id="_new-pre-primary-expression-keyword" style-ref="js:keyword"> | ||||
|           <match extended="true"> | ||||
|             \%[ new \%] (?! \%{js:new-target-object-keyword-suffix} ) | ||||
|           </match> | ||||
|         </context> <!-- /_new-pre-primary-expression-keyword --> | ||||
|     <!-- ES2020 --> | ||||
|     <!-- <ImportMeta> (part of) --> | ||||
|     <context id="_choice-import-meta-expression" end-parent="true"> | ||||
|       <start>\.</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
|         <context ref="js:embedded-lang-hooks"/> | ||||
|         <context ref="js:comments"/> | ||||
|  | ||||
|         <context id="_import-meta-expression-content"> | ||||
|           <include> | ||||
|  | ||||
|             <context id="_import-meta-expression-keyword" style-ref="js:keyword" once-only="true"> | ||||
|               <match>\%{js:meta-keyword}</match> | ||||
|             </context> <!-- /_import-meta-expression-keyword --> | ||||
|  | ||||
|           </include> | ||||
|         </context> <!-- /_import-meta-expression-content --> | ||||
|  | ||||
|       </include> | ||||
|     </context> <!-- /_pre-primary-expression --> | ||||
|     </context> <!-- /_choice-import-meta-expression --> | ||||
|  | ||||
|     <context id="_ordered-pre-primary-expression" once-only="true"> | ||||
|     <context id="_choice-import-expression" end-parent="true"> | ||||
|       <start>\%{js:import-keyword}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
|         <context ref="js:embedded-lang-hooks"/> | ||||
|         <context ref="js:comments"/> | ||||
|  | ||||
|         <context id="_import-expression-content"> | ||||
|           <include> | ||||
|             <context ref="_choice-import-call-expression"/> | ||||
|             <context ref="_choice-import-meta-expression"/> | ||||
|           </include> | ||||
|         </context> <!-- /_import-expression-content --> | ||||
|  | ||||
|       </include> | ||||
|     </context> <!-- /_choice-import-expression --> | ||||
|  | ||||
|  | ||||
|     <!-- # "new" expression | ||||
|  | ||||
|          new Array() | ||||
|          new.target | ||||
|     --> | ||||
|  | ||||
|     <!-- <NewTarget> (part of) --> | ||||
|     <context id="_choice-new-target-expression" end-parent="true"> | ||||
|       <start>\.</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
|         <context ref="js:embedded-lang-hooks"/> | ||||
|         <context ref="js:comments"/> | ||||
|  | ||||
|         <context id="_new-target-expression-content"> | ||||
|           <include> | ||||
|  | ||||
|             <context id="_new-target-expression-keyword" style-ref="js:keyword" once-only="true"> | ||||
|               <match>\%{js:target-keyword}</match> | ||||
|             </context> <!-- /_new-target-expression-keyword --> | ||||
|  | ||||
|           </include> | ||||
|         </context> <!-- /_new-target-expression-content --> | ||||
|  | ||||
|       </include> | ||||
|     </context> <!-- /_choice-new-target-expression --> | ||||
|  | ||||
|     <context id="_choice-new-object-expression" end-parent="true"> | ||||
|       <start>\%{js:before-next-token}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context ref="_pre-primary-expression"/> | ||||
|         <context ref="js:embedded-lang-hooks"/> | ||||
|         <context ref="js:comments"/> | ||||
|  | ||||
|         <context id="_new-object-expression-content"> | ||||
|           <include> | ||||
|             <context ref="_primary-expression"/> | ||||
|           </include> | ||||
|         </context> <!-- /_new-object-expression-content --> | ||||
|       </include> | ||||
|     </context> <!-- /_ordered-pre-primary-expression --> | ||||
|     </context> <!-- /_choice-new-object-expression --> | ||||
|  | ||||
|     <context id="_choice-new-expression" end-parent="true"> | ||||
|       <start>\%{js:new-keyword}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
|         <context ref="js:embedded-lang-hooks"/> | ||||
|         <context ref="js:comments"/> | ||||
|  | ||||
|         <context id="_new-expression-content"> | ||||
|           <include> | ||||
|             <context ref="_choice-new-target-expression"/> | ||||
|             <context ref="_choice-new-object-expression"/> | ||||
|           </include> | ||||
|         </context> <!-- /_new-expression-content --> | ||||
|  | ||||
|       </include> | ||||
|     </context> <!-- /_choice-new-expression --> | ||||
|  | ||||
|  | ||||
|     <!-- # Grouping / arrow function parameters | ||||
| @@ -181,24 +267,28 @@ | ||||
|             <context ref="js-lit:choice-template-literal"/> | ||||
|             <context ref="js-fn:choice-function-expression"/> | ||||
|             <context ref="js-fn:choice-class-expression"/> | ||||
|             <context ref="_choice-import-expression"/> | ||||
|             <context ref="_choice-new-expression"/> | ||||
|             <context ref="_choice-grouping"/> | ||||
|             <context ref="js-lit:choice-number"/> | ||||
|             <context ref="js-lit:choice-string"/> | ||||
|  | ||||
|             <context id="_choice-primary-expression-identifier" end-parent="true"> | ||||
|               <start>(?=\%{js:identifier-start})</start> | ||||
|               <start>\%{js:identifier-container-start}</start> | ||||
|               <end>\%{def:always-match}</end> | ||||
|               <include> | ||||
|                 <!-- no embedded-lang-hooks here --> | ||||
|                 <!-- no comments here --> | ||||
|                 <!-- do not extend the context by matching comments or | ||||
|                      embedded-lang-hooks, which may lead to multiple identifiers --> | ||||
|                      embedded-lang-hooks, which may lead to multiple | ||||
|                      identifiers --> | ||||
|  | ||||
|                 <context id="_primary-expression-identifier-content"> | ||||
|                   <include> | ||||
|                     <!-- technically these would be choices, but it would be very | ||||
|                          difficult to turn large keyword contexts into container | ||||
|                          contexts with end-parent="true" --> | ||||
|                     <!-- technically these would be choices, but it | ||||
|                          would be very difficult to turn large keyword | ||||
|                          contexts into container contexts with | ||||
|                          end-parent="true" --> | ||||
|                     <context ref="js-lit:null-value"/> | ||||
|                     <context ref="js-lit:boolean"/> | ||||
|                     <context ref="js-val:global-values"/> | ||||
| @@ -288,9 +378,33 @@ | ||||
|          func?.() | ||||
|     --> | ||||
|  | ||||
|     <context id="_choice-property-identifier" end-parent="true"> | ||||
|       <start>\%{js:identifier-container-start}</start> | ||||
|       <end>\%{def:always-match}</end> | ||||
|       <include> | ||||
|         <!-- no embedded-lang-hooks here --> | ||||
|         <!-- no comments here --> | ||||
|         <!-- do not extend the context by matching comments or | ||||
|              embedded-lang-hooks, which may lead to multiple | ||||
|              identifiers --> | ||||
|  | ||||
|         <context id="_property-identifier-content"> | ||||
|           <include> | ||||
|             <!-- technically these would be choices, but it would be | ||||
|                  very difficult to turn large keyword contexts into | ||||
|                  container contexts with end-parent="true" --> | ||||
|             <context ref="js-val:properties-methods"/> | ||||
|             <context ref="js:identifier-name"/> | ||||
|           </include> | ||||
|         </context> <!-- /_property-identifier-content --> | ||||
|  | ||||
|       </include> | ||||
|     </context> <!-- /_choice-property-identifier --> | ||||
|  | ||||
|     <context id="_post-primary-expression"> | ||||
|       <include> | ||||
|         <context ref="js:embedded-lang-hooks"/> | ||||
|         <context ref="js:comments"/> | ||||
|  | ||||
|         <!-- <MemberExpression> (part of) --> | ||||
|         <context id="_dot-property-accessors"> | ||||
| @@ -302,8 +416,7 @@ | ||||
|  | ||||
|             <context id="_dot-property-accessor-content"> | ||||
|               <include> | ||||
|                 <context ref="js-val:properties-methods"/> | ||||
|                 <context ref="js:identifier-name"/> | ||||
|                 <context ref="_choice-property-identifier"/> | ||||
|               </include> | ||||
|             </context> <!-- /_dot-property-accessor-content --> | ||||
|  | ||||
| @@ -329,7 +442,7 @@ | ||||
|  | ||||
|         <!-- ES2020 --> | ||||
|         <!-- <OptionalChain> (part of) --> | ||||
|         <context id="_optional-chain"> | ||||
|         <context id="_optional-chains"> | ||||
|           <start>\?\.(?![0-9])</start> | ||||
|           <end>\%{js:before-next-token}</end> | ||||
|           <include> | ||||
| @@ -341,13 +454,12 @@ | ||||
|                 <!-- only match dot-property accessor content here | ||||
|                      this context will end early for other cases | ||||
|                 --> | ||||
|                 <context ref="js-val:properties-methods"/> | ||||
|                 <context ref="js:identifier-name"/> | ||||
|                 <context ref="_choice-property-identifier"/> | ||||
|               </include> | ||||
|             </context> <!-- /_optional-chain-content --> | ||||
|  | ||||
|           </include> | ||||
|         </context> <!-- /_optional-chain --> | ||||
|         </context> <!-- /_optional-chains --> | ||||
|  | ||||
|         <context ref="_function-arguments-lists"/> | ||||
|         <context ref="js-lit:template-literals"/> | ||||
| @@ -367,7 +479,7 @@ | ||||
|  | ||||
|     <!-- shared between pre- and post-lhs expressions --> | ||||
|     <context id="_increment-decrement-operators" style-ref="js:increment-decrement-operator"> | ||||
|       <match>(\+\+|--)</match> | ||||
|       <match>\+\+|--</match> | ||||
|     </context> <!-- /_increment-decrement-operators --> | ||||
|  | ||||
|  | ||||
| @@ -378,24 +490,42 @@ | ||||
|         <context ref="js:embedded-lang-hooks"/> | ||||
|         <context ref="_increment-decrement-operators"/> | ||||
|  | ||||
|         <!-- ES2017, cannot be followed by line terminator --> | ||||
|         <context id="_async-keywords" style-ref="js:keyword"> | ||||
|           <match extended="true"> | ||||
|             \%{js:async-keyword} | ||||
|             # preceeds arrow function | ||||
|             (?= | ||||
|               \%{js:optional-whitespace-or-comments} | ||||
|               (?: | ||||
|                 \%{js:identifier} \%{js:optional-whitespace-or-comments} => | | ||||
|                 \(  # can this be better? | ||||
|               ) | ||||
|             ) | ||||
|             # does not preceed "function" (leave to function expression) | ||||
|             (?! \%{js:optional-whitespace-or-comments} \%{js:function-keyword} ) | ||||
|           </match> | ||||
|         </context> <!-- /_async-keywords --> | ||||
|  | ||||
|         <!-- await: ES2017 --> | ||||
|         <context id="_keyword-unary-operators" style-ref="js:keyword"> | ||||
|           <keyword>await</keyword> <!-- ES2017 --> | ||||
|           <keyword>delete</keyword> | ||||
|           <keyword>typeof</keyword> | ||||
|           <keyword>void</keyword> | ||||
|           <keyword>yield</keyword> | ||||
|           <match extended="true"> | ||||
|             \%{js:await-keyword} | | ||||
|             \%{js:delete-keyword} | | ||||
|             \%{js:typeof-keyword} | | ||||
|             \%{js:void-keyword} | | ||||
|             \%{js:yield-keyword} | ||||
|           </match> | ||||
|         </context> <!-- /_keyword-unary-operators --> | ||||
|  | ||||
|         <context ref="js:generator-modifier"/> <!-- for yield* --> | ||||
|  | ||||
|         <context id="_unary-operators" style-ref="js:unary-operator"> | ||||
|           <match extended="true"> | ||||
|             ( | ||||
|               \+ |  # unary plus | ||||
|               - |   # unary negation | ||||
|               ~ |   # bitwise not | ||||
|               !     # logical not | ||||
|             ) | ||||
|             \+ |  # unary plus | ||||
|             - |   # unary negation | ||||
|             ~ |   # bitwise not | ||||
|             !     # logical not | ||||
|           </match> | ||||
|         </context> <!-- /_unary-operators --> | ||||
|  | ||||
| @@ -437,7 +567,6 @@ | ||||
|  | ||||
|         <context id="_lhs-expression-content"> | ||||
|           <include> | ||||
|             <context ref="_ordered-pre-primary-expression"/> | ||||
|             <context ref="_ordered-primary-expression"/> | ||||
|             <context ref="_ordered-post-primary-expression"/> | ||||
|           </include> | ||||
| @@ -456,7 +585,7 @@ | ||||
|  | ||||
|     <!-- ## Without comma --> | ||||
|  | ||||
|     <context id="_ternary-operator-without-comma-false-clause" once-only="true"> | ||||
|     <context id="_ternary-operator-without-comma-false-expression" once-only="true"> | ||||
|       <start>:</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
| @@ -464,14 +593,14 @@ | ||||
|         <context ref="js:embedded-lang-hooks"/> | ||||
|         <context ref="js:comments"/> | ||||
|  | ||||
|         <context id="_ternary-operator-without-comma-false-clause-content"> | ||||
|         <context id="_ternary-operator-without-comma-false-expression-content"> | ||||
|           <include> | ||||
|             <context ref="expression-without-comma"/> | ||||
|           </include> | ||||
|         </context> <!-- /_ternary-operator-without-comma-false-clause-content --> | ||||
|         </context> <!-- /_ternary-operator-without-comma-false-expression-content --> | ||||
|  | ||||
|       </include> | ||||
|     </context> <!-- /_ternary-operator-without-comma-false-clause --> | ||||
|     </context> <!-- /_ternary-operator-without-comma-false-expression --> | ||||
|  | ||||
|     <context id="_choice-ternary-operator-without-comma-true-expression" end-parent="true"> | ||||
|       <start>\%{js:before-next-token}</start> | ||||
| @@ -483,7 +612,7 @@ | ||||
|         <context id="_ternary-operator-without-comma-true-expression-content"> | ||||
|           <include> | ||||
|             <context ref="expression-without-comma"/> | ||||
|             <context ref="_ternary-operator-without-comma-false-clause"/> | ||||
|             <context ref="_ternary-operator-without-comma-false-expression"/> | ||||
|           </include> | ||||
|         </context> <!-- /_ternary-operator-without-comma-true-expression-content --> | ||||
|  | ||||
| @@ -510,7 +639,7 @@ | ||||
|  | ||||
|     <!-- ## With comma --> | ||||
|  | ||||
|     <context id="_ternary-operator-with-comma-false-clause" once-only="true"> | ||||
|     <context id="_ternary-operator-with-comma-false-expression" once-only="true"> | ||||
|       <start>:</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
| @@ -518,14 +647,14 @@ | ||||
|         <context ref="js:embedded-lang-hooks"/> | ||||
|         <context ref="js:comments"/> | ||||
|  | ||||
|         <context id="_ternary-operator-with-comma-false-clause-content"> | ||||
|         <context id="_ternary-operator-with-comma-false-expression-content"> | ||||
|           <include> | ||||
|             <context ref="expression-with-comma"/> | ||||
|           </include> | ||||
|         </context> <!-- /_ternary-operator-with-comma-false-clause-content --> | ||||
|         </context> <!-- /_ternary-operator-with-comma-false-expression-content --> | ||||
|  | ||||
|       </include> | ||||
|     </context> <!-- /_ternary-operator-with-comma-false-clause --> | ||||
|     </context> <!-- /_ternary-operator-with-comma-false-expression --> | ||||
|  | ||||
|     <context id="_choice-ternary-operator-with-comma-true-expression" end-parent="true"> | ||||
|       <start>\%{js:before-next-token}</start> | ||||
| @@ -536,8 +665,8 @@ | ||||
|  | ||||
|         <context id="_ternary-operator-with-comma-true-expression-content"> | ||||
|           <include> | ||||
|             <context ref="expression-with-comma"/> | ||||
|             <context ref="_ternary-operator-with-comma-false-clause"/> | ||||
|             <context ref="expression-without-comma"/> <!-- comma not allowed --> | ||||
|             <context ref="_ternary-operator-with-comma-false-expression"/> | ||||
|           </include> | ||||
|         </context> <!-- /_ternary-operator-with-comma-true-expression-content --> | ||||
|  | ||||
| @@ -566,22 +695,20 @@ | ||||
|     <!-- # Binary operators --> | ||||
|  | ||||
|     <define-regex id="_keyword-binary-operator" extended="true"> | ||||
|       (?: \%[ (?: instanceof | in ) \%] ) | ||||
|       \%{js:instanceof-keyword} | \%{js:in-keyword} | ||||
|     </define-regex> <!-- /_keyword-binary-operator --> | ||||
|  | ||||
|     <!-- excluding comma operator --> | ||||
|     <define-regex id="_binary-operator" extended="true"> | ||||
|       (?: | ||||
|         \*\* =? |                            # exponentiation (assignment) (ES2016) | ||||
|         [+/*%-] =? |                         # arithmetic (assignment) | ||||
|         [!=]==? |                            # equality | ||||
|         && | \|\| |                  # logical | ||||
|         \?\? |                               # nullish coalescing (ES2020) | ||||
|         [&|^] =? |                       # bitwise logical (assignment) | ||||
|         (?: << | >>>? ) =? |  # bitwise shift (assignment) | ||||
|         [<>]=? |                       # relational | ||||
|         =                                    # assignment | ||||
|       ) | ||||
|       \*\* =? |                            # exponentiation (assignment) (ES2016) | ||||
|       [+/*%-] =? |                         # arithmetic (assignment) | ||||
|       [!=]==? |                            # equality | ||||
|       && | \|\| |                  # logical | ||||
|       \?\? |                               # nullish coalescing (ES2020) | ||||
|       [&|^] =? |                       # bitwise logical (assignment) | ||||
|       (?: << | >>>? ) =? |  # bitwise shift (assignment) | ||||
|       [<>]=? |                       # relational | ||||
|       =                                    # assignment | ||||
|     </define-regex> <!-- /_binary-operator --> | ||||
|  | ||||
|     <!-- ## Without comma --> | ||||
| @@ -640,7 +767,7 @@ | ||||
|     </context> <!-- /_keyword-binary-operators-with-comma --> | ||||
|  | ||||
|     <context id="_binary-operators-with-comma"> | ||||
|       <start>(\%{_binary-operator}|,)</start> | ||||
|       <start>\%{_binary-operator}|,</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:binary-operator"/> | ||||
|   | ||||
| @@ -8,7 +8,7 @@ | ||||
|  Copyright (C) 2005 Stef Walter (formerly Nate Nielsen) <stef@memberwebs.com> | ||||
|  Copyright (C) 2005-2007 Marco Barisione <barisione@gmail.com> | ||||
|  Copyright (C) 2005-2007 Emanuele Aina | ||||
|  Copyright (C) 2019 Jeffery To <jeffery.to@gmail.com> | ||||
|  Copyright (C) 2019-2020 Jeffery To <jeffery.to@gmail.com> | ||||
|  | ||||
|  GtkSourceView is free software; you can redistribute it and/or | ||||
|  modify it under the terms of the GNU Lesser General Public | ||||
| @@ -26,7 +26,7 @@ | ||||
| --> | ||||
| <language id="js-fn" name="JavaScript Functions and Classes" version="2.0" _section="Script" hidden="true"> | ||||
|   <!-- from js:identifier-char --> | ||||
|   <keyword-char-class>[\p{L}\p{Nl}\x{1885}-\x{1886}\x{2118}\x{212E}\x{309B}-\x{309C}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{00B7}\x{0387}\x{1369}-\x{1371}\x{19DA}$\x{200C}\x{200D}]</keyword-char-class> | ||||
|   <keyword-char-class>(?!\x{2E2F})[\p{L}\p{Nl}\x{1885}-\x{1886}\x{2118}\x{212E}\x{309B}-\x{309C}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{00B7}\x{0387}\x{1369}-\x{1371}\x{19DA}$\x{200C}\x{200D}]</keyword-char-class> | ||||
|  | ||||
|   <definitions> | ||||
|  | ||||
| @@ -43,8 +43,8 @@ | ||||
|  | ||||
|     <!-- ## Function expression keyword --> | ||||
|  | ||||
|     <context id="_function-expression-async-keyword" style-ref="js:keyword"> | ||||
|       <keyword>async</keyword> | ||||
|     <context id="_function-expression-async-keyword" style-ref="js:keyword" once-only="true"> | ||||
|       <match>\%{js:async-keyword}</match> | ||||
|     </context> <!-- /_function-expression-async-keyword --> | ||||
|  | ||||
|     <context id="_ordered-function-expression-async-keyword" once-only="true"> | ||||
| @@ -55,8 +55,8 @@ | ||||
|       </include> | ||||
|     </context> <!-- /_ordered-function-expression-async-keyword --> | ||||
|  | ||||
|     <context id="_function-expression-function-keyword" style-ref="js:keyword"> | ||||
|       <keyword>function</keyword> | ||||
|     <context id="_function-expression-function-keyword" style-ref="js:keyword" once-only="true"> | ||||
|       <match>\%{js:function-keyword}</match> | ||||
|     </context> <!-- /_function-expression-function-keyword --> | ||||
|  | ||||
|     <context id="_ordered-function-expression-function-keyword" once-only="true"> | ||||
| @@ -72,7 +72,7 @@ | ||||
|     <context id="_function-parameters-content"> | ||||
|       <include> | ||||
|         <context ref="js:ordered-rest-syntax"/> | ||||
|         <context ref="js:ordered-assignment-target"/> | ||||
|         <context ref="js:ordered-binding"/> | ||||
|         <context ref="js:ordered-default-value-assignment"/> | ||||
|       </include> | ||||
|     </context> <!-- /_function-parameters-content --> | ||||
| @@ -227,52 +227,24 @@ | ||||
|          } | ||||
|     --> | ||||
|  | ||||
|     <context id="_method-definition-modifier" once-only="true"> | ||||
|     <context id="_property-accessor-keyword" style-ref="js:keyword" once-only="true"> | ||||
|       <match extended="true"> | ||||
|         \%{js:get-keyword} | \%{js:set-keyword} | ||||
|       </match> | ||||
|     </context> <!-- /_property-accessor-keyword --> | ||||
|  | ||||
|     <context id="ordered-property-accessor-keyword" once-only="true"> | ||||
|       <start>\%{js:before-next-token}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context ref="js:embedded-lang-hooks"/> | ||||
|         <context ref="js:comments"/> | ||||
|  | ||||
|         <context id="_method-definition-modifier-content"> | ||||
|           <include> | ||||
|  | ||||
|             <context id="_choice-method-definition-modifier-keyword" style-ref="js:keyword" end-parent="true"> | ||||
|               <keyword>get</keyword> | ||||
|               <keyword>set</keyword> | ||||
|             </context> <!-- /_choice-method-definition-modifier-keyword --> | ||||
|  | ||||
|             <!-- ES2017, cannot be followed by line terminator --> | ||||
|             <context id="_choice-async-method-definition-modifier-keyword" style-ref="js:keyword" end-parent="true"> | ||||
|               <match extended="true"> | ||||
|                 \%[ async \%] | ||||
|                 (?= | ||||
|                   \%{js:optional-whitespace-or-comments} | ||||
|                   (?: | ||||
|                     \%{js:identifier-start} | | ||||
|                     \%{js:generator-modifier} | ||||
|                   ) | ||||
|                 ) | ||||
|               </match> | ||||
|             </context> <!-- /_choice-async-method-definition-modifier-keyword --> | ||||
|  | ||||
|           </include> | ||||
|         </context> <!-- /_method-definition-modifier-content --> | ||||
|  | ||||
|         <context ref="_property-accessor-keyword"/> | ||||
|       </include> | ||||
|     </context> <!-- /_method-definition-modifier --> | ||||
|     </context> <!-- /ordered-property-accessor-keyword --> | ||||
|  | ||||
|     <context id="_ordered-method-definition-modifier" once-only="true"> | ||||
|       <start>\%{js:before-next-token}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context ref="_method-definition-modifier"/> | ||||
|       </include> | ||||
|     </context> <!-- /_ordered-method-definition-modifier --> | ||||
|  | ||||
|     <!-- <MethodDefinition> --> | ||||
|     <context id="_method-definition" once-only="true"> | ||||
|       <start>\%{js:before-next-token}</start> | ||||
|     <!-- <MethodDefinition> (part of) --> | ||||
|     <!-- note that this does not include js-lit:ordered-property-name --> | ||||
|     <context id="choice-method-definition" style-ref="js:function-expression" end-parent="true"> | ||||
|       <start>(?=\()</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context ref="js:embedded-lang-hooks"/> | ||||
| @@ -280,24 +252,33 @@ | ||||
|  | ||||
|         <context id="_method-definition-content"> | ||||
|           <include> | ||||
|             <context ref="_ordered-method-definition-modifier"/> | ||||
|             <context ref="js:ordered-generator-modifier"/> | ||||
|             <context ref="js-lit:ordered-property-name"/> | ||||
|             <context ref="_ordered-function-parameters-list" style-ref="js:function-expression"/> | ||||
|             <context ref="_last-function-body" style-ref="js:function-expression"/> | ||||
|             <context ref="_ordered-function-parameters-list"/> | ||||
|             <context ref="_last-function-body"/> | ||||
|           </include> | ||||
|         </context> <!-- /_method-definition-content --> | ||||
|  | ||||
|       </include> | ||||
|     </context> <!-- /_method-definition --> | ||||
|     </context> <!-- /choice-method-definition --> | ||||
|  | ||||
|     <context id="ordered-method-definition" once-only="true"> | ||||
|       <start>\%{js:before-next-token}</start> | ||||
|     <!-- <MethodDefinition> (part of) --> | ||||
|     <context id="choice-method-keyword-method-definition" style-ref="js:function-expression" end-parent="true"> | ||||
|       <start>\%{js:method-keyword}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context ref="_method-definition"/> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
|         <context ref="js:embedded-lang-hooks"/> | ||||
|         <context ref="js:comments"/> | ||||
|  | ||||
|         <context id="_method-keyword-method-definition-content"> | ||||
|           <include> | ||||
|             <context ref="js:ordered-generator-modifier"/> | ||||
|             <context ref="js-lit:ordered-property-name"/> | ||||
|             <context ref="choice-method-definition"/> | ||||
|           </include> | ||||
|         </context> <!-- /_method-keyword-method-definition-content --> | ||||
|  | ||||
|       </include> | ||||
|     </context> <!-- /ordered-method-definition --> | ||||
|     </context> <!-- /choice-method-keyword-method-definition --> | ||||
|  | ||||
|  | ||||
|     <!-- # Class expression | ||||
| @@ -322,7 +303,7 @@ | ||||
|           <include> | ||||
|  | ||||
|             <context id="_choice-class-optional-name-ignore-extends" end-parent="true"> | ||||
|               <start>(?=\%[extends\%])</start> | ||||
|               <start>(?=\%{js:extends-keyword})</start> | ||||
|               <end>\%{def:always-match}</end> | ||||
|             </context> <!-- /_choice-class-optional-name-ignore-extends --> | ||||
|  | ||||
| @@ -344,7 +325,7 @@ | ||||
|     <!-- ## Class extends clause --> | ||||
|  | ||||
|     <context id="_class-extends-clause" once-only="true"> | ||||
|       <start>\%[extends\%]</start> | ||||
|       <start>\%{js:extends-keyword}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
| @@ -370,24 +351,8 @@ | ||||
|  | ||||
|     <!-- ## Class body --> | ||||
|  | ||||
|     <context id="_class-body-member-modifier" once-only="true"> | ||||
|       <start>\%{js:before-next-token}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context ref="js:embedded-lang-hooks"/> | ||||
|         <context ref="js:comments"/> | ||||
|  | ||||
|         <context id="_class-body-member-modifier-content"> | ||||
|           <include> | ||||
|  | ||||
|             <context id="_choice-class-body-member-modifier-keyword" style-ref="js:keyword" end-parent="true"> | ||||
|               <keyword>static</keyword> | ||||
|             </context> <!-- /_choice-class-body-member-modifier-keyword --> | ||||
|  | ||||
|           </include> | ||||
|         </context> <!-- /_class-body-member-modifier-content --> | ||||
|  | ||||
|       </include> | ||||
|     <context id="_class-body-member-modifier" style-ref="js:keyword" once-only="true"> | ||||
|       <match>\%{js:static-keyword}</match> | ||||
|     </context> <!-- /_class-body-member-modifier --> | ||||
|  | ||||
|     <context id="_ordered-class-body-member-modifier" once-only="true"> | ||||
| @@ -398,6 +363,45 @@ | ||||
|       </include> | ||||
|     </context> <!-- /_ordered-class-body-member-modifier --> | ||||
|  | ||||
|     <context id="_choice-class-body-keyword-named-method-member" style-ref="js:function-expression" end-parent="true"> | ||||
|       <start extended="true"> | ||||
|         (?: \%{js:get-keyword} | \%{js:set-keyword} | \%{js:static-keyword} ) | ||||
|         (?= \%{js:optional-whitespace-or-comments} \( ) | ||||
|       </start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:identifier"/> | ||||
|         <context ref="js:embedded-lang-hooks"/> | ||||
|         <context ref="js:comments"/> | ||||
|  | ||||
|         <context id="_class-body-keyword-named-method-member-content"> | ||||
|           <include> | ||||
|             <context ref="choice-method-definition"/> | ||||
|           </include> | ||||
|         </context> <!-- /_class-body-keyword-named-method-member-content --> | ||||
|  | ||||
|       </include> | ||||
|     </context> <!-- /_choice-class-body-keyword-named-method-member --> | ||||
|  | ||||
|     <context id="_choice-class-body-constructor-member" style-ref="js:function-expression" end-parent="true"> | ||||
|       <start extended="true"> | ||||
|         \%{js:keyword-start} constructor \%{js:keyword-end} | ||||
|       </start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:built-in-method"/> | ||||
|         <context ref="js:embedded-lang-hooks"/> | ||||
|         <context ref="js:comments"/> | ||||
|  | ||||
|         <context id="_class-body-constructor-member-content"> | ||||
|           <include> | ||||
|             <context ref="choice-method-definition"/> | ||||
|           </include> | ||||
|         </context> <!-- /_class-body-constructor-member-content --> | ||||
|  | ||||
|       </include> | ||||
|     </context> <!-- /_choice-class-body-constructor-member --> | ||||
|  | ||||
|     <context id="_class-body-members"> | ||||
|       <start>\%{js:before-next-token}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
| @@ -407,8 +411,20 @@ | ||||
|  | ||||
|         <context id="_class-body-member-content"> | ||||
|           <include> | ||||
|             <!-- try to match before and after modifier --> | ||||
|             <context ref="_choice-class-body-keyword-named-method-member"/> | ||||
|  | ||||
|             <!-- should not be combined with modifier, but cannot prevent it --> | ||||
|             <context ref="_choice-class-body-constructor-member"/> | ||||
|  | ||||
|             <context ref="_ordered-class-body-member-modifier"/> | ||||
|             <context ref="ordered-method-definition"/> | ||||
|  | ||||
|             <context ref="choice-method-keyword-method-definition"/> | ||||
|  | ||||
|             <context ref="ordered-property-accessor-keyword"/> | ||||
|             <context ref="js-lit:ordered-property-name"/> | ||||
|  | ||||
|             <context ref="choice-method-definition"/> | ||||
|           </include> | ||||
|         </context> <!-- /_class-body-member-content --> | ||||
|  | ||||
| @@ -443,7 +459,7 @@ | ||||
|  | ||||
|     <!-- <ClassExpression> / <ClassDeclaration> --> | ||||
|     <context id="choice-class-expression" style-ref="js:class-expression" end-parent="true"> | ||||
|       <start>\%{js:class-expression-keyword}</start> | ||||
|       <start>\%{js:class-keyword}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
| @@ -463,7 +479,7 @@ | ||||
|  | ||||
|     <!-- <ClassExpression> / <ClassDeclaration> --> | ||||
|     <context id="choice-class-expression-required-name" style-ref="js:class-expression" end-parent="true"> | ||||
|       <start>\%{js:class-expression-keyword}</start> | ||||
|       <start>\%{js:class-keyword}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
|   | ||||
| @@ -8,7 +8,7 @@ | ||||
|  Copyright (C) 2005 Stef Walter (formerly Nate Nielsen) <stef@memberwebs.com> | ||||
|  Copyright (C) 2005-2007 Marco Barisione <barisione@gmail.com> | ||||
|  Copyright (C) 2005-2007 Emanuele Aina | ||||
|  Copyright (C) 2019 Jeffery To <jeffery.to@gmail.com> | ||||
|  Copyright (C) 2019-2020 Jeffery To <jeffery.to@gmail.com> | ||||
|  | ||||
|  GtkSourceView is free software; you can redistribute it and/or | ||||
|  modify it under the terms of the GNU Lesser General Public | ||||
| @@ -26,7 +26,7 @@ | ||||
| --> | ||||
| <language id="js-lit" name="JavaScript Literals" version="2.0" _section="Script" hidden="true"> | ||||
|   <!-- from js:identifier-char --> | ||||
|   <keyword-char-class>[\p{L}\p{Nl}\x{1885}-\x{1886}\x{2118}\x{212E}\x{309B}-\x{309C}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{00B7}\x{0387}\x{1369}-\x{1371}\x{19DA}$\x{200C}\x{200D}]</keyword-char-class> | ||||
|   <keyword-char-class>(?!\x{2E2F})[\p{L}\p{Nl}\x{1885}-\x{1886}\x{2118}\x{212E}\x{309B}-\x{309C}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{00B7}\x{0387}\x{1369}-\x{1371}\x{19DA}$\x{200C}\x{200D}]</keyword-char-class> | ||||
|  | ||||
|   <definitions> | ||||
|  | ||||
| @@ -39,13 +39,14 @@ | ||||
|  | ||||
|     <!-- <NullLiteral> --> | ||||
|     <context id="null-value" style-ref="js:null-value"> | ||||
|       <keyword>null</keyword> | ||||
|       <match>\%{js:null-keyword}</match> | ||||
|     </context> <!-- /null-value --> | ||||
|  | ||||
|     <!-- <BooleanLiteral> --> | ||||
|     <context id="boolean" style-ref="js:boolean"> | ||||
|       <keyword>false</keyword> | ||||
|       <keyword>true</keyword> | ||||
|       <match extended="true"> | ||||
|         \%{js:false-keyword} | \%{js:true-keyword} | ||||
|       </match> | ||||
|     </context> <!-- /boolean --> | ||||
|  | ||||
|  | ||||
| @@ -66,30 +67,20 @@ | ||||
|         <!-- <DecimalLiteral> --> | ||||
|         <context id="_choice-decimal" style-ref="js:decimal" end-parent="true"> | ||||
|           <start extended="true"> | ||||
|             (?<! \%{js:identifier-char} | \. ) | ||||
|             (?= | ||||
|               \%{_decimal} | ||||
|               (?! \%{js:identifier-part} | \. ) | ||||
|             ) | ||||
|             \%{js:number-start} (?= \%{_decimal} \%{js:number-end} ) | ||||
|           </start> | ||||
|           <end>\%{_decimal}</end> | ||||
|         </context> <!-- /_choice-decimal --> | ||||
|  | ||||
|         <define-regex id="_decimal-integer" extended="true"> | ||||
|           (?> | ||||
|             (?: [1-9][0-9]* | 0 ) | ||||
|           ) | ||||
|           (?> [1-9][0-9]* | 0 ) | ||||
|         </define-regex> <!-- /_decimal-integer --> | ||||
|  | ||||
|         <!-- ES2020 --> | ||||
|         <!-- <DecimalBigIntegerLiteral> --> | ||||
|         <context id="_choice-decimal-big-integer" style-ref="js:decimal" end-parent="true"> | ||||
|           <start extended="true"> | ||||
|             (?<! \%{js:identifier-char} | \. ) | ||||
|             (?= | ||||
|               \%{_decimal-integer} n | ||||
|               (?! \%{js:identifier-part} | \. ) | ||||
|             ) | ||||
|             \%{js:number-start} (?= \%{_decimal-integer} n \%{js:number-end} ) | ||||
|           </start> | ||||
|           <end>\%{_decimal-integer}n</end> | ||||
|         </context> <!-- /_choice-decimal-big-integer --> | ||||
| @@ -101,11 +92,7 @@ | ||||
|         <!-- <BinaryIntegerLiteral> --> | ||||
|         <context id="_choice-binary-integer" style-ref="js:binary-integer" end-parent="true"> | ||||
|           <start extended="true"> | ||||
|             (?<! \%{js:identifier-char} | \. ) | ||||
|             (?= | ||||
|               \%{_binary-integer} n? | ||||
|               (?! \%{js:identifier-part} | \. ) | ||||
|             ) | ||||
|             \%{js:number-start} (?= \%{_binary-integer} n? \%{js:number-end} ) | ||||
|           </start> | ||||
|           <end>\%{_binary-integer}n?</end> | ||||
|         </context> <!-- /_choice-binary-integer --> | ||||
| @@ -117,11 +104,7 @@ | ||||
|         <!-- <OctalIntegerLiteral> --> | ||||
|         <context id="_choice-octal-integer" style-ref="js:octal-integer" end-parent="true"> | ||||
|           <start extended="true"> | ||||
|             (?<! \%{js:identifier-char} | \. ) | ||||
|             (?= | ||||
|               \%{_octal-integer} n? | ||||
|               (?! \%{js:identifier-part} | \. ) | ||||
|             ) | ||||
|             \%{js:number-start} (?= \%{_octal-integer} n? \%{js:number-end} ) | ||||
|           </start> | ||||
|           <end>\%{_octal-integer}n?</end> | ||||
|         </context> <!-- /_choice-octal-integer --> | ||||
| @@ -133,11 +116,7 @@ | ||||
|  | ||||
|         <context id="_choice-hex-integer" style-ref="js:hex-integer" end-parent="true"> | ||||
|           <start extended="true"> | ||||
|             (?<! \%{js:identifier-char} | \. ) | ||||
|             (?= | ||||
|               \%{_hex-integer} n? | ||||
|               (?! \%{js:identifier-part} | \. ) | ||||
|             ) | ||||
|             \%{js:number-start} (?= \%{_hex-integer} n? \%{js:number-end} ) | ||||
|           </start> | ||||
|           <end>\%{_hex-integer}n?</end> | ||||
|         </context> <!-- /_choice-hex-integer --> | ||||
| @@ -149,11 +128,7 @@ | ||||
|         <!-- Annex B: <LegacyOctalIntegerLiteral> --> | ||||
|         <context id="_choice-legacy-octal-integer" style-ref="js:error" end-parent="true"> | ||||
|           <start extended="true"> | ||||
|             (?<! \%{js:identifier-char} | \. ) | ||||
|             (?= | ||||
|               \%{_legacy-octal-integer} | ||||
|               (?! \%{js:identifier-part} | \. ) | ||||
|             ) | ||||
|             \%{js:number-start} (?= \%{_legacy-octal-integer} \%{js:number-end} ) | ||||
|           </start> | ||||
|           <end>\%{_legacy-octal-integer}</end> | ||||
|         </context> <!-- /_choice-legacy-octal-integer --> | ||||
| @@ -172,7 +147,7 @@ | ||||
|         <context id="_legacy-octal-escape-sequences" style-ref="js:escape"> | ||||
|           <match extended="true"> | ||||
|             \\ | ||||
|             ( | ||||
|             (?: | ||||
|               0     [0-7]{1,2} |  # 0-padded number, not \0 (null character) | ||||
|               [1-3] [0-7]{0,2} |  # max \377 | ||||
|               [4-7] [0-7]{0,1} | ||||
| @@ -183,13 +158,11 @@ | ||||
|         <!-- <EscapeSequence> (preceeded by backslash) --> | ||||
|         <context id="_escape-sequences" style-ref="js:escape"> | ||||
|           <match extended="true"> | ||||
|             ( | ||||
|               \%{js:unicode-escape} | | ||||
|               \\ | ||||
|               ( | ||||
|                 x[0-9a-fA-F]{2} |  # hexadecimal escape | ||||
|                 [^1-9xu]           # single character escape | ||||
|               ) | ||||
|             \%{js:unicode-escape} | | ||||
|             \\ | ||||
|             (?: | ||||
|               x[0-9a-fA-F]{2} |  # hexadecimal escape | ||||
|               [^1-9xu]           # single character escape | ||||
|             ) | ||||
|           </match> | ||||
|         </context> <!-- /_escape-sequences --> | ||||
| @@ -312,16 +285,6 @@ | ||||
|  | ||||
|             <context ref="choice-number"/> | ||||
|             <context ref="choice-string"/> | ||||
|  | ||||
|             <define-regex id="_special-property-names" extended="true"> | ||||
|               (?: \%[ constructor \%] ) | ||||
|             </define-regex> <!-- /_special-property-names --> | ||||
|  | ||||
|             <context id="_choice-special-property-name" style-ref="js:built-in-method" end-parent="true"> | ||||
|               <start>(?=\%{_special-property-names})</start> | ||||
|               <end>\%{_special-property-names}</end> | ||||
|             </context> <!-- /_choice-special-property-name --> | ||||
|  | ||||
|             <context ref="js:choice-identifier-name"/> | ||||
|           </include> | ||||
|         </context> <!-- /_property-name-content --> | ||||
| @@ -342,7 +305,8 @@ | ||||
|  | ||||
|          { | ||||
|            propertyA: 'a', | ||||
|            propertyB: getB(), | ||||
|            "propertyB": getB(), | ||||
|            1: 'one', | ||||
|            [ computedName() ]: 2 + 3, | ||||
|            method() { ... }, | ||||
|            get prop() { return this._prop; }, | ||||
| @@ -351,42 +315,103 @@ | ||||
|          } | ||||
|     --> | ||||
|  | ||||
|     <!-- ES2018 --> | ||||
|     <context id="_choice-object-literal-spread-syntax" end-parent="true"> | ||||
|       <start>\%{js:spread-syntax}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:spread-syntax"/> | ||||
|         <context ref="js:embedded-lang-hooks"/> | ||||
|         <context ref="js:comments"/> | ||||
|  | ||||
|         <context id="_object-literal-spread-syntax-content"> | ||||
|           <include> | ||||
|             <context ref="js-expr:expression-without-comma"/> | ||||
|           </include> | ||||
|         </context> <!-- /_object-literal-spread-syntax-content --> | ||||
|  | ||||
|       </include> | ||||
|     </context> <!-- /_choice-object-literal-spread-syntax --> | ||||
|  | ||||
|     <context id="_object-literal-property-value" once-only="true"> | ||||
|       <start>:</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context ref="js:embedded-lang-hooks"/> | ||||
|         <context ref="js:comments"/> | ||||
|  | ||||
|         <context id="_object-literal-property-value-content"> | ||||
|           <include> | ||||
|             <context ref="js-expr:expression-without-comma"/> | ||||
|           </include> | ||||
|         </context> <!-- /_object-literal-property-value-content --> | ||||
|  | ||||
|       </include> | ||||
|     </context> <!-- /_object-literal-property-value --> | ||||
|  | ||||
|     <context id="_ordered-object-literal-property-value" once-only="true"> | ||||
|       <start>\%{js:before-next-token}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context ref="_object-literal-property-value"/> | ||||
|       </include> | ||||
|     </context> <!-- /_ordered-object-literal-property-value --> | ||||
|  | ||||
|     <context id="_choice-object-literal-keyword-named-property-or-method" end-parent="true"> | ||||
|       <start extended="true"> | ||||
|         (?: \%{js:get-keyword} | \%{js:set-keyword} ) | ||||
|         (?= \%{js:optional-whitespace-or-comments} [:=(] ) | ||||
|       </start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:identifier"/> | ||||
|         <context ref="js:embedded-lang-hooks"/> | ||||
|         <context ref="js:comments"/> | ||||
|  | ||||
|         <context id="_object-literal-keyword-named-property-or-method-content"> | ||||
|           <include> | ||||
|             <context ref="js-fn:choice-method-definition"/> | ||||
|  | ||||
|             <context ref="_ordered-object-literal-property-value"/> | ||||
|             <context ref="js:ordered-default-value-assignment"/> <!-- for destructuring assignment --> | ||||
|           </include> | ||||
|         </context> <!-- /_object-literal-keyword-named-property-or-method-content --> | ||||
|  | ||||
|       </include> | ||||
|     </context> <!-- /_choice-object-literal-keyword-named-property-or-method --> | ||||
|  | ||||
|     <context id="_choice-object-literal-property-or-method" end-parent="true"> | ||||
|       <start extended="true"> | ||||
|         (?= [\['"] ) |                         # computed property name, string | ||||
|         \%{js:number-start} (?= \.? [0-9] ) |  # number | ||||
|         \%{js:identifier-container-start}      # identifier | ||||
|       </start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context ref="js:embedded-lang-hooks"/> | ||||
|         <context ref="js:comments"/> | ||||
|  | ||||
|         <context id="_object-literal-property-or-method-content"> | ||||
|           <include> | ||||
|             <context ref="js-fn:ordered-property-accessor-keyword"/> | ||||
|             <context ref="ordered-property-name"/> | ||||
|  | ||||
|             <context ref="js-fn:choice-method-definition"/> | ||||
|  | ||||
|             <context ref="_ordered-object-literal-property-value"/> | ||||
|             <context ref="js:ordered-default-value-assignment"/> <!-- for destructuring assignment --> | ||||
|           </include> | ||||
|         </context> <!-- /_object-literal-property-or-method-content --> | ||||
|  | ||||
|       </include> | ||||
|     </context> <!-- /_choice-object-literal-property-or-method --> | ||||
|  | ||||
|     <context id="_object-literal-property-content"> | ||||
|       <include> | ||||
|  | ||||
|         <context id="_object-literal-property-name" once-only="true"> | ||||
|           <start>\%{js:before-next-token}</start> | ||||
|           <end>\%{js:before-next-token}</end> | ||||
|           <include> | ||||
|             <context ref="js:embedded-lang-hooks"/> | ||||
|             <context ref="js:comments"/> | ||||
|  | ||||
|             <context id="_object-literal-property-name-content"> | ||||
|               <include> | ||||
|                 <context ref="js:ordered-spread-syntax"/> <!-- ES2018 --> | ||||
|                 <context ref="js-fn:ordered-method-definition"/> <!-- includes property-name --> | ||||
|               </include> | ||||
|             </context> <!-- /_object-literal-property-name-content --> | ||||
|  | ||||
|           </include> | ||||
|         </context> <!-- /_object-literal-property-name --> | ||||
|  | ||||
|         <context id="_object-literal-property-value" once-only="true"> | ||||
|           <start>:</start> | ||||
|           <end>\%{js:before-next-token}</end> | ||||
|           <include> | ||||
|             <context ref="js:embedded-lang-hooks"/> | ||||
|             <context ref="js:comments"/> | ||||
|  | ||||
|             <context id="_object-literal-property-value-content"> | ||||
|               <include> | ||||
|                 <context ref="js-expr:expression-without-comma"/> | ||||
|               </include> | ||||
|             </context> <!-- /_object-literal-property-value-content --> | ||||
|  | ||||
|           </include> | ||||
|         </context> <!-- /_object-literal-property-value --> | ||||
|  | ||||
|         <context ref="_choice-object-literal-spread-syntax"/> | ||||
|         <context ref="_choice-object-literal-keyword-named-property-or-method"/> | ||||
|         <context ref="js-fn:choice-method-keyword-method-definition"/> | ||||
|         <context ref="_choice-object-literal-property-or-method"/> | ||||
|       </include> | ||||
|     </context> <!-- /_object-literal-property-content --> | ||||
|  | ||||
| @@ -441,7 +466,7 @@ | ||||
|     <!-- ES2018 --> | ||||
|     <context id="_unicode-property-escapes" style-ref="js:escape"> | ||||
|       <match extended="true"> | ||||
|         \\ [pP] \{ ( [a-zA-Z_]+ = )? [a-zA-Z0-9_]+ \} | ||||
|         \\ [pP] { (?: [a-zA-Z_]+ = )? [a-zA-Z0-9_]+ } | ||||
|       </match> | ||||
|     </context> <!-- /_unicode-property-escapes --> | ||||
|  | ||||
| @@ -529,7 +554,7 @@ | ||||
|  | ||||
|         <context id="_template-head" style-ref="js:template-literal" once-only="true"> | ||||
|           <start>(?<=`)</start> | ||||
|           <end>(?=`|\$\{)</end> | ||||
|           <end>(?=`|\${)</end> | ||||
|           <include> | ||||
|             <context ref="js:embedded-lang-hooks"/> | ||||
|             <!-- no comments here --> | ||||
| @@ -541,7 +566,7 @@ | ||||
|  | ||||
|         <context id="_template-substitution-tails" style-ref="js:template-literal"> | ||||
|           <start>(?<=})</start> | ||||
|           <end>(?=`|\$\{)</end> | ||||
|           <end>(?=`|\${)</end> | ||||
|           <include> | ||||
|             <context ref="js:embedded-lang-hooks"/> | ||||
|             <!-- no comments here --> | ||||
| @@ -550,7 +575,7 @@ | ||||
|         </context> <!-- /_template-substitution-tails --> | ||||
|  | ||||
|         <context id="_template-placeholders"> | ||||
|           <start>\$\{</start> | ||||
|           <start>\${</start> | ||||
|           <end>}</end> | ||||
|           <include> | ||||
|             <context sub-pattern="0" where="start" style-ref="js:template-placeholder"/> | ||||
|   | ||||
| @@ -8,7 +8,7 @@ | ||||
|  Copyright (C) 2005 Stef Walter (formerly Nate Nielsen) <stef@memberwebs.com> | ||||
|  Copyright (C) 2005-2007 Marco Barisione <barisione@gmail.com> | ||||
|  Copyright (C) 2005-2007 Emanuele Aina | ||||
|  Copyright (C) 2019 Jeffery To <jeffery.to@gmail.com> | ||||
|  Copyright (C) 2019-2020 Jeffery To <jeffery.to@gmail.com> | ||||
|  | ||||
|  GtkSourceView is free software; you can redistribute it and/or | ||||
|  modify it under the terms of the GNU Lesser General Public | ||||
| @@ -26,7 +26,7 @@ | ||||
| --> | ||||
| <language id="js-mod" name="JavaScript Modules" version="2.0" _section="Script" hidden="true"> | ||||
|   <!-- from js:identifier-char --> | ||||
|   <keyword-char-class>[\p{L}\p{Nl}\x{1885}-\x{1886}\x{2118}\x{212E}\x{309B}-\x{309C}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{00B7}\x{0387}\x{1369}-\x{1371}\x{19DA}$\x{200C}\x{200D}]</keyword-char-class> | ||||
|   <keyword-char-class>(?!\x{2E2F})[\p{L}\p{Nl}\x{1885}-\x{1886}\x{2118}\x{212E}\x{309B}-\x{309C}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{00B7}\x{0387}\x{1369}-\x{1371}\x{19DA}$\x{200C}\x{200D}]</keyword-char-class> | ||||
|  | ||||
|   <definitions> | ||||
|  | ||||
| @@ -43,7 +43,7 @@ | ||||
|     --> | ||||
|  | ||||
|     <context id="_from-module" once-only="true"> | ||||
|       <start>\%[from\%]</start> | ||||
|       <start>\%{js:from-keyword}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
| @@ -74,7 +74,7 @@ | ||||
|     --> | ||||
|  | ||||
|     <context id="_as-namespace" once-only="true"> | ||||
|       <start>\%[as\%]</start> | ||||
|       <start>\%{js:as-keyword}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
| @@ -124,7 +124,7 @@ | ||||
|     --> | ||||
|  | ||||
|     <context id="_name-group-identifier" once-only="true"> | ||||
|       <start>(?=\%{js:identifier-start})</start> | ||||
|       <start>\%{js:identifier-container-start}</start> | ||||
|       <end>\%{def:always-match}</end> | ||||
|       <include> | ||||
|         <!-- no embedded-lang-hooks here --> | ||||
| @@ -136,7 +136,7 @@ | ||||
|           <include> | ||||
|  | ||||
|             <context id="_name-group-keywords" style-ref="js:keyword"> | ||||
|               <keyword>default</keyword> | ||||
|               <match>\%{js:default-keyword}</match> | ||||
|             </context> <!-- /_name-group-keywords --> | ||||
|  | ||||
|             <context ref="js:identifier"/> | ||||
| @@ -147,7 +147,7 @@ | ||||
|     </context> <!-- /_name-group-identifier --> | ||||
|  | ||||
|     <context id="_name-group-as-identifier" once-only="true"> | ||||
|       <start>\%[as\%]</start> | ||||
|       <start>\%{js:as-keyword}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
| @@ -226,7 +226,7 @@ | ||||
|     --> | ||||
|  | ||||
|     <context id="_choice-export-named" end-parent="true"> | ||||
|       <start>(?=\{)</start> | ||||
|       <start>(?={)</start> | ||||
|       <end>\%{js:statement-end}</end> | ||||
|       <include> | ||||
|         <context ref="js:embedded-lang-hooks"/> | ||||
| @@ -250,7 +250,7 @@ | ||||
|     --> | ||||
|  | ||||
|     <context id="_choice-export-default" end-parent="true"> | ||||
|       <start>\%[default\%]</start> | ||||
|       <start>\%{js:default-keyword}</start> | ||||
|       <end>\%{js:statement-end}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
| @@ -279,7 +279,7 @@ | ||||
|  | ||||
|     <!-- <ExportDeclaration> --> | ||||
|     <context id="export-declarations" style-ref="js:export-import-declaration"> | ||||
|       <start>\%[export\%]</start> | ||||
|       <start>\%{js:export-keyword}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
| @@ -309,7 +309,7 @@ | ||||
|     --> | ||||
|  | ||||
|     <context id="_choice-import-named" end-parent="true"> | ||||
|       <start>(?=\{)</start> | ||||
|       <start>(?={)</start> | ||||
|       <end>\%{js:statement-end}</end> | ||||
|       <include> | ||||
|         <context ref="js:embedded-lang-hooks"/> | ||||
| @@ -366,7 +366,7 @@ | ||||
|     </context> <!-- /_choice-import-default-only --> | ||||
|  | ||||
|     <context id="_choice-import-default" end-parent="true"> | ||||
|       <start>(?=\%{js:identifier-start})</start> | ||||
|       <start>\%{js:identifier-container-start}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context ref="js:embedded-lang-hooks"/> | ||||
| @@ -392,10 +392,9 @@ | ||||
|     --> | ||||
|  | ||||
|     <!-- <ImportDeclaration> --> | ||||
|     <!-- also matches import() and import.meta --> | ||||
|     <context id="import-declarations" style-ref="js:export-import-declaration"> | ||||
|       <start extended="true"> | ||||
|         \%[ import \%] (?! \%{js:import-function-keyword-suffix} ) | ||||
|       </start> | ||||
|       <start>\%{js:import-keyword}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
| @@ -404,6 +403,8 @@ | ||||
|  | ||||
|         <context id="_import-declaration-content"> | ||||
|           <include> | ||||
|             <context ref="js-expr:_choice-import-call-expression"/> | ||||
|             <context ref="js-expr:_choice-import-meta-expression"/> | ||||
|             <context ref="_choice-import-named"/> | ||||
|             <context ref="_choice-all-as-namespace"/> | ||||
|             <context ref="_choice-import-default"/> | ||||
|   | ||||
| @@ -8,7 +8,7 @@ | ||||
|  Copyright (C) 2005 Stef Walter (formerly Nate Nielsen) <stef@memberwebs.com> | ||||
|  Copyright (C) 2005-2007 Marco Barisione <barisione@gmail.com> | ||||
|  Copyright (C) 2005-2007 Emanuele Aina | ||||
|  Copyright (C) 2019 Jeffery To <jeffery.to@gmail.com> | ||||
|  Copyright (C) 2019-2020 Jeffery To <jeffery.to@gmail.com> | ||||
|  | ||||
|  GtkSourceView is free software; you can redistribute it and/or | ||||
|  modify it under the terms of the GNU Lesser General Public | ||||
| @@ -26,7 +26,7 @@ | ||||
| --> | ||||
| <language id="js-st" name="JavaScript Statements" version="2.0" _section="Script" hidden="true"> | ||||
|   <!-- from js:identifier-char --> | ||||
|   <keyword-char-class>[\p{L}\p{Nl}\x{1885}-\x{1886}\x{2118}\x{212E}\x{309B}-\x{309C}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{00B7}\x{0387}\x{1369}-\x{1371}\x{19DA}$\x{200C}\x{200D}]</keyword-char-class> | ||||
|   <keyword-char-class>(?!\x{2E2F})[\p{L}\p{Nl}\x{1885}-\x{1886}\x{2118}\x{212E}\x{309B}-\x{309C}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{00B7}\x{0387}\x{1369}-\x{1371}\x{19DA}$\x{200C}\x{200D}]</keyword-char-class> | ||||
|  | ||||
|   <definitions> | ||||
|  | ||||
| @@ -37,14 +37,10 @@ | ||||
|  | ||||
|     <!-- # Use strict directive --> | ||||
|  | ||||
|     <!-- apparently, back references are not supported --> | ||||
|     <!-- apparently, back references are not supported within the same | ||||
|          regex --> | ||||
|     <context id="_use-strict-directives" style-ref="js:directive"> | ||||
|       <start extended="true"> | ||||
|         (?: | ||||
|           " use [ ] strict " | | ||||
|           ' use [ ] strict ' | ||||
|         ) | ||||
|       </start> | ||||
|       <start>"use strict"|'use strict'</start> | ||||
|       <end>\%{js:statement-end}</end> | ||||
|     </context> <!-- /_use-strict-directives --> | ||||
|  | ||||
| @@ -121,7 +117,7 @@ | ||||
|  | ||||
|     <!-- <BreakStatement> --> | ||||
|     <context id="_break-statements" style-ref="js:break-statement"> | ||||
|       <start>\%[break\%]</start> | ||||
|       <start>\%{js:break-keyword}</start> | ||||
|       <end>\%{js:statement-end-or-end-of-line}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
| @@ -145,7 +141,7 @@ | ||||
|  | ||||
|     <!-- <ClassExpression> / <ClassDeclaration> --> | ||||
|     <context id="_class-declarations"> | ||||
|       <start>(?=\%{js:class-expression-keyword})</start> | ||||
|       <start>(?=\%{js:class-keyword})</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context ref="js:embedded-lang-hooks"/> | ||||
| @@ -169,7 +165,7 @@ | ||||
|  | ||||
|     <!-- <ContinueStatement> --> | ||||
|     <context id="_continue-statements" style-ref="js:continue-statement"> | ||||
|       <start>\%[continue\%]</start> | ||||
|       <start>\%{js:continue-keyword}</start> | ||||
|       <end>\%{js:statement-end-or-end-of-line}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
| @@ -193,7 +189,7 @@ | ||||
|  | ||||
|     <!-- <DebuggerStatement> --> | ||||
|     <context id="_debugger-statements" style-ref="js:debugger-statement"> | ||||
|       <start>\%[debugger\%]</start> | ||||
|       <start>\%{js:debugger-keyword}</start> | ||||
|       <end>\%{js:statement-end}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
| @@ -248,8 +244,10 @@ | ||||
|         <context id="_for-statement-modifier-content"> | ||||
|           <include> | ||||
|  | ||||
|             <!-- await: ES2018 --> | ||||
|             <context id="_choice-for-statement-modifier-keyword" style-ref="js:keyword" end-parent="true"> | ||||
|               <keyword>await</keyword> <!-- ES2018 --> | ||||
|               <start>(?=\%{js:await-keyword})</start> | ||||
|               <end>\%{js:await-keyword}</end> | ||||
|             </context> <!-- /_choice-for-statement-modifier-keyword --> | ||||
|  | ||||
|           </include> | ||||
| @@ -322,7 +320,7 @@ | ||||
|     </context> <!-- /_for-statement-test --> | ||||
|  | ||||
|     <context id="_for-statement-in" once-only="true"> | ||||
|       <start>\%[in\%]</start> | ||||
|       <start>\%{js:in-keyword}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
| @@ -339,7 +337,7 @@ | ||||
|     </context> <!-- /_for-statement-in --> | ||||
|  | ||||
|     <context id="_for-statement-of" once-only="true"> | ||||
|       <start>\%[of\%]</start> | ||||
|       <start>\%{js:of-keyword}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
| @@ -383,7 +381,7 @@ | ||||
|  | ||||
|     <!-- <IterationStatement> (part of) --> | ||||
|     <context id="_for-statements" style-ref="js:for-statement"> | ||||
|       <start>\%[for\%]</start> | ||||
|       <start>\%{js:for-keyword}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
| @@ -432,7 +430,7 @@ | ||||
|  | ||||
|     <!-- <IfStatement> (part of) --> | ||||
|     <context id="_if-statements" style-ref="js:if-statement"> | ||||
|       <start>\%[if\%]</start> | ||||
|       <start>\%{js:if-keyword}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
| @@ -450,7 +448,7 @@ | ||||
|  | ||||
|     <!-- <IfStatement> (part of) --> | ||||
|     <context id="_else-statements" style-ref="js:else-statement"> | ||||
|       <start>\%[else\%]</start> | ||||
|       <start>\%{js:else-keyword}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
| @@ -475,6 +473,7 @@ | ||||
|     --> | ||||
|     <context id="_label-statements" style-ref="js:label-statement"> | ||||
|       <start extended="true"> | ||||
|         (?<! \%{js:identifier-char} ) | ||||
|         (?= | ||||
|           \%{js:identifier} | ||||
|           \%{js:optional-whitespace-or-comments} | ||||
| @@ -509,7 +508,7 @@ | ||||
|  | ||||
|     <!-- <ReturnStatement> --> | ||||
|     <context id="_return-statements" style-ref="js:return-statement"> | ||||
|       <start>\%[return\%]</start> | ||||
|       <start>\%{js:return-keyword}</start> | ||||
|       <end>\%{js:statement-end-or-end-of-line}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
| @@ -536,7 +535,7 @@ | ||||
|     --> | ||||
|  | ||||
|     <context id="_case-clauses"> | ||||
|       <start>\%[case\%]</start> | ||||
|       <start>\%{js:case-keyword}</start> | ||||
|       <end>:</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
| @@ -553,7 +552,7 @@ | ||||
|     </context> <!-- /_case-clauses --> | ||||
|  | ||||
|     <context id="_default-clauses"> | ||||
|       <start>\%[default\%]</start> | ||||
|       <start>\%{js:default-keyword}</start> | ||||
|       <end>:</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
| @@ -593,7 +592,7 @@ | ||||
|  | ||||
|     <!-- <SwitchStatement> --> | ||||
|     <context id="_switch-statements" style-ref="js:switch-statement"> | ||||
|       <start>\%[switch\%]</start> | ||||
|       <start>\%{js:switch-keyword}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
| @@ -618,7 +617,7 @@ | ||||
|  | ||||
|     <!-- <ThrowStatement> --> | ||||
|     <context id="_throw-statements" style-ref="js:throw-statement"> | ||||
|       <start>\%[throw\%]</start> | ||||
|       <start>\%{js:throw-keyword}</start> | ||||
|       <end>\%{js:statement-end-or-end-of-line}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
| @@ -666,7 +665,7 @@ | ||||
|  | ||||
|     <!-- <TryStatement> --> | ||||
|     <context id="_try-statements" style-ref="js:try-catch-statement"> | ||||
|       <start>\%[try\%]</start> | ||||
|       <start>\%{js:try-keyword}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
| @@ -682,33 +681,34 @@ | ||||
|       </include> | ||||
|     </context> <!-- /_try-statements --> | ||||
|  | ||||
|     <context id="_catch-statement-exception" once-only="true"> | ||||
|     <!-- <CatchParameter> --> | ||||
|     <context id="_catch-statement-parameter" once-only="true"> | ||||
|       <start>\(</start> | ||||
|       <end>\)</end> | ||||
|       <include> | ||||
|         <context ref="js:embedded-lang-hooks"/> | ||||
|         <context ref="js:comments"/> | ||||
|  | ||||
|         <context id="_catch-statement-exception-content"> | ||||
|         <context id="_catch-statement-parameter-content"> | ||||
|           <include> | ||||
|             <context ref="js:identifier"/> | ||||
|             <context ref="js:ordered-binding"/> | ||||
|           </include> | ||||
|         </context> <!-- /_catch-statement-exception-content --> | ||||
|         </context> <!-- /_catch-statement-parameter-content --> | ||||
|  | ||||
|       </include> | ||||
|     </context> <!-- /_catch-statement-exception --> | ||||
|     </context> <!-- /_catch-statement-parameter --> | ||||
|  | ||||
|     <context id="_ordered-catch-statement-exception" once-only="true"> | ||||
|     <context id="_ordered-catch-statement-parameter" once-only="true"> | ||||
|       <start>\%{js:before-next-token}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context ref="_catch-statement-exception"/> | ||||
|         <context ref="_catch-statement-parameter"/> | ||||
|       </include> | ||||
|     </context> <!-- /_ordered-catch-statement-exception --> | ||||
|     </context> <!-- /_ordered-catch-statement-parameter --> | ||||
|  | ||||
|     <!-- <Catch> --> | ||||
|     <context id="_catch-statements" style-ref="js:try-catch-statement"> | ||||
|       <start>\%[catch\%]</start> | ||||
|       <start>\%{js:catch-keyword}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
| @@ -717,7 +717,7 @@ | ||||
|  | ||||
|         <context id="_catch-statement-content"> | ||||
|           <include> | ||||
|             <context ref="_ordered-catch-statement-exception"/> | ||||
|             <context ref="_ordered-catch-statement-parameter"/> | ||||
|             <context ref="_last-try-body"/> | ||||
|           </include> | ||||
|         </context> <!-- /_catch-statement-content --> | ||||
| @@ -727,7 +727,7 @@ | ||||
|  | ||||
|     <!-- <Finally> --> | ||||
|     <context id="_finally-statements" style-ref="js:try-catch-statement"> | ||||
|       <start>\%[finally\%]</start> | ||||
|       <start>\%{js:finally-keyword}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
| @@ -752,12 +752,12 @@ | ||||
|     --> | ||||
|  | ||||
|     <define-regex id="_variable-declaration-keyword" extended="true"> | ||||
|       (?: \%[ (?: const | let | var ) \%] ) | ||||
|       \%{js:const-keyword} | \%{js:let-keyword} | \%{js:var-keyword} | ||||
|     </define-regex> <!-- /_variable-declaration-keyword --> | ||||
|  | ||||
|     <context id="_variable-declaration-item-content"> | ||||
|       <include> | ||||
|         <context ref="js:ordered-assignment-target"/> | ||||
|         <context ref="js:ordered-binding"/> | ||||
|         <context ref="js:ordered-default-value-assignment"/> | ||||
|       </include> | ||||
|     </context> <!-- /_variable-declaration-item-content --> | ||||
| @@ -833,7 +833,7 @@ | ||||
|  | ||||
|     <!-- <IterationStatement> (part of) --> | ||||
|     <context id="_while-statements" style-ref="js:while-statement"> | ||||
|       <start>\%[while\%]</start> | ||||
|       <start>\%{js:while-keyword}</start> | ||||
|       <end>\%{js:statement-end}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
| @@ -851,7 +851,7 @@ | ||||
|  | ||||
|     <!-- <IterationStatement> (part of) --> | ||||
|     <context id="_do-statements" style-ref="js:while-statement"> | ||||
|       <start>\%[do\%]</start> | ||||
|       <start>\%{js:do-keyword}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
| @@ -872,7 +872,7 @@ | ||||
|  | ||||
|     <!-- <WithStatement> --> | ||||
|     <context id="_with-statements" style-ref="js:with-statement"> | ||||
|       <start>\%[with\%]</start> | ||||
|       <start>\%{js:with-keyword}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
|   | ||||
| @@ -8,7 +8,7 @@ | ||||
|  Copyright (C) 2005 Stef Walter (formerly Nate Nielsen) <stef@memberwebs.com> | ||||
|  Copyright (C) 2005-2007 Marco Barisione <barisione@gmail.com> | ||||
|  Copyright (C) 2005-2007 Emanuele Aina | ||||
|  Copyright (C) 2019 Jeffery To <jeffery.to@gmail.com> | ||||
|  Copyright (C) 2019-2020 Jeffery To <jeffery.to@gmail.com> | ||||
|  | ||||
|  GtkSourceView is free software; you can redistribute it and/or | ||||
|  modify it under the terms of the GNU Lesser General Public | ||||
| @@ -26,7 +26,7 @@ | ||||
| --> | ||||
| <language id="js-val" name="JavaScript Built-in Values" version="2.0" _section="Script" hidden="true"> | ||||
|   <!-- from js:identifier-char --> | ||||
|   <keyword-char-class>[\p{L}\p{Nl}\x{1885}-\x{1886}\x{2118}\x{212E}\x{309B}-\x{309C}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{00B7}\x{0387}\x{1369}-\x{1371}\x{19DA}$\x{200C}\x{200D}]</keyword-char-class> | ||||
|   <keyword-char-class>(?!\x{2E2F})[\p{L}\p{Nl}\x{1885}-\x{1886}\x{2118}\x{212E}\x{309B}-\x{309C}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{00B7}\x{0387}\x{1369}-\x{1371}\x{19DA}$\x{200C}\x{200D}]</keyword-char-class> | ||||
|  | ||||
|   <definitions> | ||||
|  | ||||
| @@ -51,6 +51,8 @@ | ||||
|  | ||||
|         <!-- 18.1 Value Properties of the Global Object --> | ||||
|         <context id="_values" style-ref="js:built-in-value"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>Infinity</keyword> | ||||
|           <keyword>NaN</keyword> | ||||
|           <keyword>undefined</keyword> | ||||
| @@ -58,6 +60,8 @@ | ||||
|  | ||||
|         <!-- 18.2 Function Properties of the Global Object --> | ||||
|         <context id="_functions" style-ref="js:built-in-function"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>decodeURIComponent</keyword> | ||||
|           <keyword>decodeURI</keyword> | ||||
|           <keyword>encodeURIComponent</keyword> | ||||
| @@ -70,6 +74,8 @@ | ||||
|         </context> <!-- /_functions --> | ||||
|  | ||||
|         <context id="_constructors" style-ref="js:built-in-constructor"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>ArrayBuffer</keyword> | ||||
|           <keyword>Array</keyword> | ||||
|           <keyword>BigInt</keyword> <!-- ES2020 --> | ||||
| @@ -107,51 +113,24 @@ | ||||
|         </context> <!-- /_constructors --> | ||||
|  | ||||
|         <context id="_objects" style-ref="js:built-in-object"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>Intl</keyword> | ||||
|           <keyword>JSON</keyword> | ||||
|           <keyword>Math</keyword> | ||||
|           <keyword>WebAssembly</keyword> | ||||
|         </context> <!-- /_objects --> | ||||
|  | ||||
|         <!-- globalThis: ES2020 --> | ||||
|         <context id="_object-keywords" style-ref="js:keyword"> | ||||
|           <keyword>arguments</keyword> | ||||
|           <keyword>globalThis</keyword> <!-- ES2020 --> | ||||
|           <keyword>super</keyword> | ||||
|           <keyword>this</keyword> | ||||
|           <match extended="true"> | ||||
|             \%{js:keyword-start} arguments \%{js:keyword-end} | | ||||
|             \%{js:keyword-start} globalThis \%{js:keyword-end} | | ||||
|             \%{js:super-keyword} | | ||||
|             \%{js:this-keyword} | ||||
|           </match> | ||||
|         </context> <!-- /_object-keywords --> | ||||
|  | ||||
|         <context id="_import-function-keyword"> | ||||
|           <start extended="true"> | ||||
|             \%[ import \%] (?= \%{js:import-function-keyword-suffix} ) | ||||
|           </start> | ||||
|           <end>(?=\()</end> | ||||
|           <include> | ||||
|             <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
|             <!-- no embedded-lang-hooks here --> | ||||
|             <context ref="js:comments"/> | ||||
|           </include> | ||||
|         </context> <!-- /_import-function-keyword --> | ||||
|  | ||||
|         <context id="_new-target-object-keyword"> | ||||
|           <start extended="true"> | ||||
|             \%[ new \%] (?= \%{js:new-target-object-keyword-suffix} ) | ||||
|           </start> | ||||
|           <end>\%[target\%]</end> | ||||
|           <include> | ||||
|             <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
|             <context sub-pattern="0" where="end" style-ref="js:keyword"/> | ||||
|             <!-- no embedded-lang-hooks here --> | ||||
|             <context ref="js:comments"/> | ||||
|  | ||||
|             <context id="_new-target-object-keyword-content"> | ||||
|               <include> | ||||
|                 <context ref="js:ordered-keyword-dot"/> | ||||
|               </include> | ||||
|             </context> <!-- /_new-target-object-keyword-content --> | ||||
|  | ||||
|           </include> | ||||
|         </context> <!-- /_new-target-object-keyword --> | ||||
|  | ||||
|       </include> | ||||
|     </context> <!-- /global-values --> | ||||
|  | ||||
| @@ -162,6 +141,8 @@ | ||||
|       <include> | ||||
|  | ||||
|         <context id="_intl-constructors" style-ref="js:built-in-constructor"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>Collator</keyword> | ||||
|           <keyword>DateTimeFormat</keyword> | ||||
|           <keyword>NumberFormat</keyword> | ||||
| @@ -169,6 +150,8 @@ | ||||
|         </context> <!-- /_intl-constructors --> | ||||
|  | ||||
|         <context id="_webassembly-constructors" style-ref="js:built-in-constructor"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>CompileError</keyword> | ||||
|           <keyword>Global</keyword> | ||||
|           <keyword>Instance</keyword> | ||||
| @@ -180,10 +163,14 @@ | ||||
|         </context> <!-- /_webassembly-constructors --> | ||||
|  | ||||
|         <context id="_array-properties" style-ref="js:built-in-property"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>length</keyword> | ||||
|         </context> <!-- /_array-properties --> | ||||
|  | ||||
|         <context id="_array-methods" style-ref="js:built-in-method"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>concat</keyword> | ||||
|           <keyword>copyWithin</keyword> | ||||
|           <keyword>entries</keyword> | ||||
| @@ -218,27 +205,37 @@ | ||||
|         </context> <!-- /_array-methods --> | ||||
|  | ||||
|         <context id="_arraybuffer-properties" style-ref="js:built-in-property"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>byteLength</keyword> | ||||
|         </context> <!-- /_arraybuffer-properties --> | ||||
|  | ||||
|         <context id="_arraybuffer-methods" style-ref="js:built-in-method"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>isView</keyword> | ||||
|           <keyword>slice</keyword> | ||||
|         </context> <!-- /_arraybuffer-methods --> | ||||
|  | ||||
|         <!-- ES2020 --> | ||||
|         <context id="_bigint-methods" style-ref="js:built-in-method"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>asIntN</keyword> | ||||
|           <keyword>asUintN</keyword> | ||||
|         </context> <!-- /_bigint-methods --> | ||||
|  | ||||
|         <context id="_dataview-properties" style-ref="js:built-in-property"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>buffer</keyword> | ||||
|           <keyword>byteLength</keyword> | ||||
|           <keyword>byteOffset</keyword> | ||||
|         </context> <!-- /_dataview-properties --> | ||||
|  | ||||
|         <context id="_dataview-methods" style-ref="js:built-in-method"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>getFloat32</keyword> | ||||
|           <keyword>getFloat64</keyword> | ||||
|           <keyword>getInt16</keyword> | ||||
| @@ -258,6 +255,8 @@ | ||||
|         </context> <!-- /_dataview-methods --> | ||||
|  | ||||
|         <context id="_date-methods" style-ref="js:built-in-method"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>getDate</keyword> | ||||
|           <keyword>getDay</keyword> | ||||
|           <keyword>getFullYear</keyword> | ||||
| @@ -304,28 +303,38 @@ | ||||
|         </context> <!-- /_date-methods --> | ||||
|  | ||||
|         <context id="_error-properties" style-ref="js:built-in-property"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>message</keyword> | ||||
|           <keyword>name</keyword> | ||||
|         </context> <!-- /_error-properties --> | ||||
|  | ||||
|         <context id="_function-properties" style-ref="js:built-in-property"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>length</keyword> | ||||
|           <keyword>name</keyword> | ||||
|         </context> <!-- /_function-properties --> | ||||
|  | ||||
|         <context id="_function-methods" style-ref="js:built-in-method"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>apply</keyword> | ||||
|           <keyword>bind</keyword> | ||||
|           <keyword>call</keyword> | ||||
|         </context> <!-- /_function-methods --> | ||||
|  | ||||
|         <context id="_generator-methods" style-ref="js:built-in-method"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>next</keyword> | ||||
|           <keyword>return</keyword> | ||||
|           <keyword>throw</keyword> | ||||
|         </context> <!-- /_generator-methods --> | ||||
|  | ||||
|         <context id="_intl-methods" style-ref="js:built-in-method"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>formatToParts</keyword> <!-- common to intl format object instances --> | ||||
|           <keyword>format</keyword> <!-- common to intl format object instances --> | ||||
|           <keyword>getCanonicalLocales</keyword> | ||||
| @@ -334,23 +343,33 @@ | ||||
|         </context> <!-- /_intl-methods --> | ||||
|  | ||||
|         <context id="_intl-collator-methods" style-ref="js:built-in-method"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>compare</keyword> | ||||
|         </context> <!-- /_intl-collator-methods --> | ||||
|  | ||||
|         <context id="_intl-pluralrules-methods" style-ref="js:built-in-method"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>select</keyword> | ||||
|         </context> <!-- /_intl-pluralrules-methods --> | ||||
|  | ||||
|         <context id="_json-methods" style-ref="js:built-in-method"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>parse</keyword> | ||||
|           <keyword>stringify</keyword> | ||||
|         </context> <!-- /_json-methods --> | ||||
|  | ||||
|         <context id="_map-properties" style-ref="js:built-in-property"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>size</keyword> | ||||
|         </context> <!-- /_map-properties --> | ||||
|  | ||||
|         <context id="_map-methods" style-ref="js:built-in-method"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>clear</keyword> | ||||
|           <keyword>delete</keyword> | ||||
|           <keyword>entries</keyword> | ||||
| @@ -363,6 +382,8 @@ | ||||
|         </context> <!-- /_map-methods --> | ||||
|  | ||||
|         <context id="_math-properties" style-ref="js:built-in-property"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>E</keyword> | ||||
|           <keyword>LN10</keyword> | ||||
|           <keyword>LN2</keyword> | ||||
| @@ -374,6 +395,8 @@ | ||||
|         </context> <!-- /_math-properties --> | ||||
|  | ||||
|         <context id="_math-methods" style-ref="js:built-in-method"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>abs</keyword> | ||||
|           <keyword>acosh</keyword> | ||||
|           <keyword>acos</keyword> | ||||
| @@ -412,6 +435,8 @@ | ||||
|         </context> <!-- /_math-methods --> | ||||
|  | ||||
|         <context id="_number-properties" style-ref="js:built-in-property"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>EPSILON</keyword> | ||||
|           <keyword>MAX_SAFE_INTEGER</keyword> | ||||
|           <keyword>MAX_VALUE</keyword> | ||||
| @@ -423,6 +448,8 @@ | ||||
|         </context> <!-- /_number-properties --> | ||||
|  | ||||
|         <context id="_number-methods" style-ref="js:built-in-method"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>isFinite</keyword> | ||||
|           <keyword>isInteger</keyword> | ||||
|           <keyword>isNaN</keyword> | ||||
| @@ -435,11 +462,15 @@ | ||||
|         </context> <!-- /_number-methods --> | ||||
|  | ||||
|         <context id="_object-properties" style-ref="js:built-in-property"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>constructor</keyword> | ||||
|           <keyword>prototype</keyword> | ||||
|         </context> <!-- /_object-properties --> | ||||
|  | ||||
|         <context id="_object-methods" style-ref="js:built-in-method"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>assign</keyword> | ||||
|           <keyword>create</keyword> | ||||
|           <keyword>defineProperties</keyword> | ||||
| @@ -470,6 +501,8 @@ | ||||
|         </context> <!-- /_object-methods --> | ||||
|  | ||||
|         <context id="_promise-methods" style-ref="js:built-in-method"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>allSettled</keyword> <!-- ES2020 --> | ||||
|           <keyword>all</keyword> | ||||
|           <keyword>catch</keyword> | ||||
| @@ -481,10 +514,14 @@ | ||||
|         </context> <!-- /_promise-methods --> | ||||
|  | ||||
|         <context id="_proxy-methods" style-ref="js:built-in-method"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>revocable</keyword> | ||||
|         </context> <!-- /_proxy-methods --> | ||||
|  | ||||
|         <context id="_reflect-methods" style-ref="js:built-in-method"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>apply</keyword> | ||||
|           <keyword>construct</keyword> | ||||
|           <keyword>defineProperty</keyword> | ||||
| @@ -501,6 +538,8 @@ | ||||
|         </context> <!-- /_reflect-methods --> | ||||
|  | ||||
|         <context id="_regexp-properties" style-ref="js:built-in-property"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>flags</keyword> | ||||
|           <keyword>global</keyword> | ||||
|           <keyword>ignoreCase</keyword> | ||||
| @@ -512,15 +551,21 @@ | ||||
|         </context> <!-- /_regexp-properties --> | ||||
|  | ||||
|         <context id="_regexp-methods" style-ref="js:built-in-method"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>exec</keyword> | ||||
|           <keyword>test</keyword> | ||||
|         </context> <!-- /_regexp-methods --> | ||||
|  | ||||
|         <context id="_set-properties" style-ref="js:built-in-property"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>size</keyword> | ||||
|         </context> <!-- /_set-properties --> | ||||
|  | ||||
|         <context id="_set-methods" style-ref="js:built-in-method"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>add</keyword> | ||||
|           <keyword>clear</keyword> | ||||
|           <keyword>delete</keyword> | ||||
| @@ -532,10 +577,14 @@ | ||||
|         </context> <!-- /_set-methods --> | ||||
|  | ||||
|         <context id="_string-properties" style-ref="js:built-in-property"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>length</keyword> | ||||
|         </context> <!-- /_string-properties --> | ||||
|  | ||||
|         <context id="_string-methods" style-ref="js:built-in-method"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>charAt</keyword> | ||||
|           <keyword>charCodeAt</keyword> | ||||
|           <keyword>codePointAt</keyword> | ||||
| @@ -554,6 +603,7 @@ | ||||
|           <keyword>padStart</keyword> <!-- ES2017 --> | ||||
|           <keyword>raw</keyword> | ||||
|           <keyword>repeat</keyword> | ||||
|           <keyword>replaceAll</keyword> <!-- ES2021 --> | ||||
|           <keyword>replace</keyword> | ||||
|           <keyword>search</keyword> | ||||
|           <keyword>slice</keyword> | ||||
| @@ -570,6 +620,8 @@ | ||||
|         </context> <!-- /_string-methods --> | ||||
|  | ||||
|         <context id="_symbol-properties" style-ref="js:built-in-property"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>asyncIterator</keyword> <!-- ES2018 --> | ||||
|           <keyword>description</keyword> <!-- ES2019 --> | ||||
|           <keyword>hasInstance</keyword> | ||||
| @@ -587,6 +639,8 @@ | ||||
|         </context> <!-- /_symbol-properties --> | ||||
|  | ||||
|         <context id="_symbol-methods" style-ref="js:built-in-method"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>for</keyword> | ||||
|           <keyword>keyFor</keyword> | ||||
|         </context> <!-- /_symbol-methods --> | ||||
| @@ -603,6 +657,8 @@ | ||||
|              * Uint8ClampedArray | ||||
|         --> | ||||
|         <context id="_typedarray-properties" style-ref="js:built-in-property"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>buffer</keyword> | ||||
|           <keyword>byteLength</keyword> | ||||
|           <keyword>byteOffset</keyword> | ||||
| @@ -612,6 +668,8 @@ | ||||
|         </context> <!-- /_typedarray-properties --> | ||||
|  | ||||
|         <context id="_typedarray-methods" style-ref="js:built-in-method"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>copyWithin</keyword> | ||||
|           <keyword>entries</keyword> | ||||
|           <keyword>every</keyword> | ||||
| @@ -639,6 +697,8 @@ | ||||
|         </context> <!-- /_typedarray-methods --> | ||||
|  | ||||
|         <context id="_weakmap-methods" style-ref="js:built-in-method"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>delete</keyword> | ||||
|           <keyword>get</keyword> | ||||
|           <keyword>has</keyword> | ||||
| @@ -646,12 +706,16 @@ | ||||
|         </context> <!-- /_weakmap-methods --> | ||||
|  | ||||
|         <context id="_weakset-methods" style-ref="js:built-in-method"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>add</keyword> | ||||
|           <keyword>delete</keyword> | ||||
|           <keyword>has</keyword> | ||||
|         </context> <!-- /_weakset-methods --> | ||||
|  | ||||
|         <context id="_webassembly-methods" style-ref="js:built-in-method"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>compileStreaming</keyword> | ||||
|           <keyword>compile</keyword> | ||||
|           <keyword>instantiateStreaming</keyword> | ||||
| @@ -660,32 +724,46 @@ | ||||
|         </context> <!-- /_webassembly-methods --> | ||||
|  | ||||
|         <context id="_webassembly-instance-properties" style-ref="js:built-in-property"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>exports</keyword> | ||||
|         </context> <!-- /_webassembly-instance-properties --> | ||||
|  | ||||
|         <context id="_webassembly-global-properties" style-ref="js:built-in-property"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>value</keyword> | ||||
|         </context> <!-- /_webassembly-global-properties --> | ||||
|  | ||||
|         <context id="_webassembly-module-methods" style-ref="js:built-in-method"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>customSections</keyword> | ||||
|           <keyword>exports</keyword> | ||||
|           <keyword>imports</keyword> | ||||
|         </context> <!-- /_webassembly-module-methods --> | ||||
|  | ||||
|         <context id="_webassembly-memory-properties" style-ref="js:built-in-property"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>buffer</keyword> | ||||
|         </context> <!-- /_webassembly-memory-properties --> | ||||
|  | ||||
|         <context id="_webassembly-memory-methods" style-ref="js:built-in-method"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>grow</keyword> | ||||
|         </context> <!-- /_webassembly-memory-methods --> | ||||
|  | ||||
|         <context id="_webassembly-table-properties" style-ref="js:built-in-property"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>length</keyword> | ||||
|         </context> <!-- /_webassembly-table-properties --> | ||||
|  | ||||
|         <context id="_webassembly-table-methods" style-ref="js:built-in-method"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>get</keyword> | ||||
|           <keyword>grow</keyword> | ||||
|           <keyword>set</keyword> | ||||
|   | ||||
| @@ -8,7 +8,7 @@ | ||||
|  Copyright (C) 2005 Stef Walter (formerly Nate Nielsen) <stef@memberwebs.com> | ||||
|  Copyright (C) 2005-2007 Marco Barisione <barisione@gmail.com> | ||||
|  Copyright (C) 2005-2007 Emanuele Aina | ||||
|  Copyright (C) 2019 Jeffery To <jeffery.to@gmail.com> | ||||
|  Copyright (C) 2019-2020 Jeffery To <jeffery.to@gmail.com> | ||||
|  | ||||
|  GtkSourceView is free software; you can redistribute it and/or | ||||
|  modify it under the terms of the GNU Lesser General Public | ||||
| @@ -27,7 +27,7 @@ | ||||
| <language id="js" name="JavaScript" version="2.0" _section="Script"> | ||||
|   <metadata> | ||||
|     <property name="mimetypes">application/javascript;application/x-javascript;text/x-javascript;text/javascript;text/x-js</property> | ||||
|     <property name="globs">*.js</property> | ||||
|     <property name="globs">*.js;*.mjs</property> | ||||
|     <property name="line-comment-start">//</property> | ||||
|     <property name="block-comment-start">/*</property> | ||||
|     <property name="block-comment-end">*/</property> | ||||
| @@ -75,8 +75,8 @@ | ||||
|     <style id="identifier"                    name="Identifier"/> | ||||
|     <style id="rest-syntax"                   name="Rest syntax"/> | ||||
|     <style id="spread-syntax"                 name="Spread syntax"/> | ||||
|     <style id="array-destructuring"           name="Array destructuring"/> | ||||
|     <style id="object-destructuring"          name="Object destructuring"/> | ||||
|     <style id="array-binding-pattern"         name="Array binding pattern"/> | ||||
|     <style id="object-binding-pattern"        name="Object binding pattern"/> | ||||
|  | ||||
|     <!-- Literals --> | ||||
|     <style id="array-literal"                 name="Array literal"/> | ||||
| @@ -120,7 +120,7 @@ | ||||
|   </styles> | ||||
|  | ||||
|   <!-- from identifier-char --> | ||||
|   <keyword-char-class>[\p{L}\p{Nl}\x{1885}-\x{1886}\x{2118}\x{212E}\x{309B}-\x{309C}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{00B7}\x{0387}\x{1369}-\x{1371}\x{19DA}$\x{200C}\x{200D}]</keyword-char-class> | ||||
|   <keyword-char-class>(?!\x{2E2F})[\p{L}\p{Nl}\x{1885}-\x{1886}\x{2118}\x{212E}\x{309B}-\x{309C}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{00B7}\x{0387}\x{1369}-\x{1371}\x{19DA}$\x{200C}\x{200D}]</keyword-char-class> | ||||
|  | ||||
|   <definitions> | ||||
|  | ||||
| @@ -134,7 +134,7 @@ | ||||
|          Supported level: ES2020 | ||||
|  | ||||
|          Supported ES2021 proposals: | ||||
|          * (none yet) | ||||
|          * String.prototype.replaceAll | ||||
|  | ||||
|          Features from Annex B of the spec are not highlighted to | ||||
|          discourage their use, except: | ||||
| @@ -191,12 +191,12 @@ | ||||
|  | ||||
|     <!-- <UnicodeEscapeSequence> --> | ||||
|     <define-regex id="unicode-escape" extended="true"> | ||||
|       (?: \\u (?: [0-9a-fA-F]{4} | \{ [0-9a-fA-F]{1,} \} ) ) | ||||
|       \\u (?: [0-9a-fA-F]{4} | { [0-9a-fA-F]{1,} } ) | ||||
|     </define-regex> <!-- /unicode-escape --> | ||||
|  | ||||
|     <!-- <IdentifierStart> --> | ||||
|     <define-regex id="identifier-start" extended="true"> | ||||
|       (?: \%{def:unicode-id-start} | [$_] | \%{unicode-escape} ) | ||||
|       \%{def:unicode-id-start} | [$_] | \%{unicode-escape} | ||||
|     </define-regex> <!-- /identifier-start --> | ||||
|  | ||||
|     <!-- for lookbehinds | ||||
| @@ -205,19 +205,31 @@ | ||||
|          U+200D Zero-width joiner <ZWJ> | ||||
|     --> | ||||
|     <define-regex id="identifier-char" extended="true"> | ||||
|       (?: \%{def:unicode-id-continue} | [$\x{200C}\x{200D}] ) | ||||
|       \%{def:unicode-id-continue} | [$\x{200C}\x{200D}] | ||||
|     </define-regex> <!-- /identifier-char --> | ||||
|  | ||||
|     <!-- <IdentifierPart> --> | ||||
|     <define-regex id="identifier-part" extended="true"> | ||||
|       (?: \%{identifier-char} | \%{unicode-escape} ) | ||||
|       \%{identifier-char} | \%{unicode-escape} | ||||
|     </define-regex> <!-- /identifier-part --> | ||||
|  | ||||
|     <!-- <IdentifierName> --> | ||||
|     <define-regex id="identifier" extended="true"> | ||||
|       (?: \%{identifier-start} \%{identifier-part}* ) | ||||
|       \%{identifier-start} \%{identifier-part}* | ||||
|     </define-regex> <!-- /identifier--> | ||||
|  | ||||
|     <define-regex id="identifier-container-start" extended="true"> | ||||
|       (?<! \%{identifier-char} ) (?= \%{identifier-start} ) | ||||
|     </define-regex> <!-- /identifier-container-start --> | ||||
|  | ||||
|     <define-regex id="keyword-start" extended="true"> | ||||
|       (?<! \%{identifier-char} ) | ||||
|     </define-regex> <!-- /keyword-start --> | ||||
|  | ||||
|     <define-regex id="keyword-end" extended="true"> | ||||
|       (?! \%{identifier-char} ) | ||||
|     </define-regex> <!-- /keyword-end --> | ||||
|  | ||||
|     <!-- <WhiteSpace> --> | ||||
|     <!-- does not include characters from <LineTerminator>, | ||||
|          to only allow space separators when we want match a | ||||
| @@ -253,11 +265,11 @@ | ||||
|     </define-regex> <!-- /before-next-token --> | ||||
|  | ||||
|     <define-regex id="statement-end" extended="true"> | ||||
|       (?: ; | \%{before-next-token} ) | ||||
|       ; | \%{before-next-token} | ||||
|     </define-regex> <!-- /statement-end --> | ||||
|  | ||||
|     <define-regex id="statement-end-or-end-of-line" extended="true"> | ||||
|       (?: \%{statement-end} | $ ) | ||||
|       \%{statement-end} | $ | ||||
|     </define-regex> <!-- /statement-end-or-end-of-line --> | ||||
|  | ||||
|     <!-- wherever this is used, the highlighting will be more brittle, | ||||
| @@ -268,6 +280,10 @@ | ||||
|  | ||||
|     <define-regex id="generator-modifier">\*</define-regex> | ||||
|  | ||||
|     <define-regex id="rest-syntax">\.\.\.</define-regex> | ||||
|  | ||||
|     <define-regex id="spread-syntax">\.\.\.</define-regex> | ||||
|  | ||||
|     <!-- "unknown id" errors can occur when using a regex defined in one | ||||
|           component file in another component file | ||||
|           https://gitlab.gnome.org/GNOME/gtksourceview/issues/67 | ||||
| @@ -275,39 +291,235 @@ | ||||
|           so we move the definitions of these regexes here | ||||
|     --> | ||||
|  | ||||
|     <define-regex id="import-function-keyword-suffix" extended="true"> | ||||
|       (?: | ||||
|         \%{optional-whitespace-or-comments} | ||||
|         \( | ||||
|       ) | ||||
|     </define-regex> <!-- /import-function-keyword-suffix --> | ||||
|     <define-regex id="number-start" extended="true"> | ||||
|       (?<! \%{identifier-char} | \. ) | ||||
|     </define-regex> <!-- /number-start --> | ||||
|  | ||||
|     <define-regex id="new-target-object-keyword-suffix" extended="true"> | ||||
|       (?: | ||||
|         \%{optional-whitespace-or-comments} | ||||
|         \. | ||||
|         \%{optional-whitespace-or-comments} | ||||
|         target \%] | ||||
|       ) | ||||
|     </define-regex> <!-- /new-target-object-keyword-suffix --> | ||||
|     <define-regex id="number-end" extended="true"> | ||||
|       (?! \%{identifier-part} | \. ) | ||||
|     </define-regex> <!-- /number-end --> | ||||
|  | ||||
|     <!-- async function (ES2017) | ||||
|     <!-- these regexes are keywords that appear as literals in the | ||||
|          grammar --> | ||||
|  | ||||
|     <define-regex id="as-keyword" extended="true"> | ||||
|       \%{keyword-start} as \%{keyword-end} | ||||
|     </define-regex> <!-- /as-keyword --> | ||||
|  | ||||
|     <define-regex id="async-keyword" extended="true"> | ||||
|       \%{keyword-start} async \%{keyword-end} | ||||
|     </define-regex> <!-- /async-keyword --> | ||||
|  | ||||
|     <define-regex id="await-keyword" extended="true"> | ||||
|       \%{keyword-start} await \%{keyword-end} | ||||
|     </define-regex> <!-- /await-keyword --> | ||||
|  | ||||
|     <define-regex id="break-keyword" extended="true"> | ||||
|       \%{keyword-start} break \%{keyword-end} | ||||
|     </define-regex> <!-- /break-keyword --> | ||||
|  | ||||
|     <define-regex id="case-keyword" extended="true"> | ||||
|       \%{keyword-start} case \%{keyword-end} | ||||
|     </define-regex> <!-- /case-keyword --> | ||||
|  | ||||
|     <define-regex id="catch-keyword" extended="true"> | ||||
|       \%{keyword-start} catch \%{keyword-end} | ||||
|     </define-regex> <!-- /catch-keyword --> | ||||
|  | ||||
|     <define-regex id="class-keyword" extended="true"> | ||||
|       \%{keyword-start} class \%{keyword-end} | ||||
|     </define-regex> <!-- /class-keyword --> | ||||
|  | ||||
|     <define-regex id="const-keyword" extended="true"> | ||||
|       \%{keyword-start} const \%{keyword-end} | ||||
|     </define-regex> <!-- /const-keyword --> | ||||
|  | ||||
|     <define-regex id="continue-keyword" extended="true"> | ||||
|       \%{keyword-start} continue \%{keyword-end} | ||||
|     </define-regex> <!-- /continue-keyword --> | ||||
|  | ||||
|     <define-regex id="debugger-keyword" extended="true"> | ||||
|       \%{keyword-start} debugger \%{keyword-end} | ||||
|     </define-regex> <!-- /debugger-keyword --> | ||||
|  | ||||
|     <define-regex id="default-keyword" extended="true"> | ||||
|       \%{keyword-start} default \%{keyword-end} | ||||
|     </define-regex> <!-- /default-keyword --> | ||||
|  | ||||
|     <define-regex id="delete-keyword" extended="true"> | ||||
|       \%{keyword-start} delete \%{keyword-end} | ||||
|     </define-regex> <!-- /delete-keyword --> | ||||
|  | ||||
|     <define-regex id="do-keyword" extended="true"> | ||||
|       \%{keyword-start} do \%{keyword-end} | ||||
|     </define-regex> <!-- /do-keyword --> | ||||
|  | ||||
|     <define-regex id="else-keyword" extended="true"> | ||||
|       \%{keyword-start} else \%{keyword-end} | ||||
|     </define-regex> <!-- /else-keyword --> | ||||
|  | ||||
|     <define-regex id="export-keyword" extended="true"> | ||||
|       \%{keyword-start} export \%{keyword-end} | ||||
|     </define-regex> <!-- /export-keyword --> | ||||
|  | ||||
|     <define-regex id="extends-keyword" extended="true"> | ||||
|       \%{keyword-start} extends \%{keyword-end} | ||||
|     </define-regex> <!-- /extends-keyword --> | ||||
|  | ||||
|     <define-regex id="false-keyword" extended="true"> | ||||
|       \%{keyword-start} false \%{keyword-end} | ||||
|     </define-regex> <!-- /false-keyword --> | ||||
|  | ||||
|     <define-regex id="finally-keyword" extended="true"> | ||||
|       \%{keyword-start} finally \%{keyword-end} | ||||
|     </define-regex> <!-- /finally-keyword --> | ||||
|  | ||||
|     <define-regex id="for-keyword" extended="true"> | ||||
|       \%{keyword-start} for \%{keyword-end} | ||||
|     </define-regex> <!-- /for-keyword --> | ||||
|  | ||||
|     <define-regex id="from-keyword" extended="true"> | ||||
|       \%{keyword-start} from \%{keyword-end} | ||||
|     </define-regex> <!-- /from-keyword --> | ||||
|  | ||||
|     <define-regex id="function-keyword" extended="true"> | ||||
|       \%{keyword-start} function \%{keyword-end} | ||||
|     </define-regex> <!-- /function-keyword --> | ||||
|  | ||||
|     <define-regex id="get-keyword" extended="true"> | ||||
|       \%{keyword-start} get \%{keyword-end} | ||||
|     </define-regex> <!-- /get-keyword --> | ||||
|  | ||||
|     <define-regex id="if-keyword" extended="true"> | ||||
|       \%{keyword-start} if \%{keyword-end} | ||||
|     </define-regex> <!-- /if-keyword --> | ||||
|  | ||||
|     <define-regex id="import-keyword" extended="true"> | ||||
|       \%{keyword-start} import \%{keyword-end} | ||||
|     </define-regex> <!-- /import-keyword --> | ||||
|  | ||||
|     <define-regex id="in-keyword" extended="true"> | ||||
|       \%{keyword-start} in \%{keyword-end} | ||||
|     </define-regex> <!-- /in-keyword --> | ||||
|  | ||||
|     <define-regex id="instanceof-keyword" extended="true"> | ||||
|       \%{keyword-start} instanceof \%{keyword-end} | ||||
|     </define-regex> <!-- /instanceof-keyword --> | ||||
|  | ||||
|     <define-regex id="let-keyword" extended="true"> | ||||
|       \%{keyword-start} let \%{keyword-end} | ||||
|     </define-regex> <!-- /let-keyword --> | ||||
|  | ||||
|     <define-regex id="meta-keyword" extended="true"> | ||||
|       \%{keyword-start} meta \%{keyword-end} | ||||
|     </define-regex> <!-- /meta-keyword --> | ||||
|  | ||||
|     <define-regex id="new-keyword" extended="true"> | ||||
|       \%{keyword-start} new \%{keyword-end} | ||||
|     </define-regex> <!-- /new-keyword --> | ||||
|  | ||||
|     <define-regex id="null-keyword" extended="true"> | ||||
|       \%{keyword-start} null \%{keyword-end} | ||||
|     </define-regex> <!-- /null-keyword --> | ||||
|  | ||||
|     <define-regex id="of-keyword" extended="true"> | ||||
|       \%{keyword-start} of \%{keyword-end} | ||||
|     </define-regex> <!-- /of-keyword --> | ||||
|  | ||||
|     <define-regex id="return-keyword" extended="true"> | ||||
|       \%{keyword-start} return \%{keyword-end} | ||||
|     </define-regex> <!-- /return-keyword --> | ||||
|  | ||||
|     <define-regex id="set-keyword" extended="true"> | ||||
|       \%{keyword-start} set \%{keyword-end} | ||||
|     </define-regex> <!-- /set-keyword --> | ||||
|  | ||||
|     <define-regex id="static-keyword" extended="true"> | ||||
|       \%{keyword-start} static \%{keyword-end} | ||||
|     </define-regex> <!-- /static-keyword --> | ||||
|  | ||||
|     <define-regex id="super-keyword" extended="true"> | ||||
|       \%{keyword-start} super \%{keyword-end} | ||||
|     </define-regex> <!-- /super-keyword --> | ||||
|  | ||||
|     <define-regex id="switch-keyword" extended="true"> | ||||
|       \%{keyword-start} switch \%{keyword-end} | ||||
|     </define-regex> <!-- /switch-keyword --> | ||||
|  | ||||
|     <define-regex id="target-keyword" extended="true"> | ||||
|       \%{keyword-start} target \%{keyword-end} | ||||
|     </define-regex> <!-- /target-keyword --> | ||||
|  | ||||
|     <define-regex id="this-keyword" extended="true"> | ||||
|       \%{keyword-start} this \%{keyword-end} | ||||
|     </define-regex> <!-- /this-keyword --> | ||||
|  | ||||
|     <define-regex id="throw-keyword" extended="true"> | ||||
|       \%{keyword-start} throw \%{keyword-end} | ||||
|     </define-regex> <!-- /throw-keyword --> | ||||
|  | ||||
|     <define-regex id="true-keyword" extended="true"> | ||||
|       \%{keyword-start} true \%{keyword-end} | ||||
|     </define-regex> <!-- /true-keyword --> | ||||
|  | ||||
|     <define-regex id="try-keyword" extended="true"> | ||||
|       \%{keyword-start} try \%{keyword-end} | ||||
|     </define-regex> <!-- /try-keyword --> | ||||
|  | ||||
|     <define-regex id="typeof-keyword" extended="true"> | ||||
|       \%{keyword-start} typeof \%{keyword-end} | ||||
|     </define-regex> <!-- /typeof-keyword --> | ||||
|  | ||||
|     <define-regex id="var-keyword" extended="true"> | ||||
|       \%{keyword-start} var \%{keyword-end} | ||||
|     </define-regex> <!-- /var-keyword --> | ||||
|  | ||||
|     <define-regex id="void-keyword" extended="true"> | ||||
|       \%{keyword-start} void \%{keyword-end} | ||||
|     </define-regex> <!-- /void-keyword --> | ||||
|  | ||||
|     <define-regex id="while-keyword" extended="true"> | ||||
|       \%{keyword-start} while \%{keyword-end} | ||||
|     </define-regex> <!-- /while-keyword --> | ||||
|  | ||||
|     <define-regex id="with-keyword" extended="true"> | ||||
|       \%{keyword-start} with \%{keyword-end} | ||||
|     </define-regex> <!-- /with-keyword --> | ||||
|  | ||||
|     <define-regex id="yield-keyword" extended="true"> | ||||
|       \%{keyword-start} yield \%{keyword-end} | ||||
|     </define-regex> <!-- /yield-keyword --> | ||||
|  | ||||
|     <!-- async function: ES2017 | ||||
|          no line terminator allowed between "async" and "function" --> | ||||
|     <define-regex id="function-expression-keyword" extended="true"> | ||||
|       (?: | ||||
|         (?: | ||||
|           \%[ async \%] | ||||
|           \%{optional-whitespace-or-comments} | ||||
|         )? | ||||
|         \%[ function \%] | ||||
|       ) | ||||
|       (?: \%{async-keyword} \%{optional-whitespace-or-comments} )? | ||||
|       \%{function-keyword} | ||||
|     </define-regex> <!-- /function-expression-keyword --> | ||||
|  | ||||
|     <define-regex id="class-expression-keyword" extended="true"> | ||||
|       (?: \%[ class \%] ) | ||||
|     </define-regex> <!-- /class-expression-keyword --> | ||||
|     <!-- async function: ES2017 | ||||
|          "async" cannot be followed by line terminator --> | ||||
|     <define-regex id="method-keyword" extended="true"> | ||||
|       # get property() / set property() | ||||
|       (?: \%{js:get-keyword} | \%{js:set-keyword} ) | ||||
|       (?= | ||||
|         \%{js:optional-whitespace-or-comments} | ||||
|         \%{js:identifier-start} | ||||
|       ) | | ||||
|  | ||||
|       # async method() / async * generator() | ||||
|       \%{js:async-keyword} | ||||
|       (?= | ||||
|         \%{js:optional-whitespace-or-comments} | ||||
|         (?: \%{js:identifier-start} | \%{js:generator-modifier} ) | ||||
|       ) | | ||||
|  | ||||
|       # * generator() | ||||
|       (?= \%{js:generator-modifier} ) | ||||
|     </define-regex> <!-- /method-keyword --> | ||||
|  | ||||
|     <!-- ## Embedded lang hooks | ||||
|  | ||||
|          a placeholder context where an embedding language (e.g. html) | ||||
|          can <replace> | ||||
|     --> | ||||
| @@ -323,11 +535,23 @@ | ||||
|       </include> | ||||
|     </context> <!-- /_comment-content --> | ||||
|  | ||||
|     <context id="_single-line-comment-content"> | ||||
|       <include> | ||||
|         <context ref="_comment-content"/> | ||||
|       </include> | ||||
|     </context> <!-- /_single-line-comment-content --> | ||||
|  | ||||
|     <context id="_multiline-comment-content"> | ||||
|       <include> | ||||
|         <context ref="_comment-content"/> | ||||
|       </include> | ||||
|     </context> <!-- /_multiline-comment-content --> | ||||
|  | ||||
|     <!-- line continuations are not allowed inside single-line comments --> | ||||
|     <context id="_single-line-comments" style-ref="comment" end-at-line-end="true" class-disabled="no-spell-check" class="comment"> | ||||
|       <start>//</start> | ||||
|       <include> | ||||
|         <context ref="_comment-content"/> | ||||
|         <context ref="_single-line-comment-content"/> | ||||
|       </include> | ||||
|     </context> <!-- /_single-line-comments --> | ||||
|  | ||||
| @@ -335,14 +559,14 @@ | ||||
|       <start>/\*</start> | ||||
|       <end>\*/</end> | ||||
|       <include> | ||||
|         <context ref="_comment-content"/> | ||||
|         <context ref="_multiline-comment-content"/> | ||||
|       </include> | ||||
|     </context> <!-- /_multiline-comments --> | ||||
|  | ||||
|     <context id="_single-line-comments-no-extend-parent" style-ref="comment" end-at-line-end="true" class-disabled="no-spell-check" class="comment" extend-parent="false"> | ||||
|       <start>//</start> | ||||
|       <include> | ||||
|         <context ref="_comment-content"/> | ||||
|         <context ref="_single-line-comment-content"/> | ||||
|       </include> | ||||
|     </context> <!-- /_single-line-comments-no-extend-parent --> | ||||
|  | ||||
| @@ -350,7 +574,7 @@ | ||||
|       <start>/\*</start> | ||||
|       <end>\*/</end> | ||||
|       <include> | ||||
|         <context ref="_comment-content"/> | ||||
|         <context ref="_multiline-comment-content"/> | ||||
|       </include> | ||||
|     </context> <!-- /_multiline-comments-no-extend-parent --> | ||||
|  | ||||
| @@ -371,7 +595,7 @@ | ||||
|  | ||||
|     <context id="_doc-comment-content"> | ||||
|       <include> | ||||
|         <context ref="_comment-content"/> | ||||
|         <context ref="_multiline-comment-content"/> | ||||
|         <context ref="jsdoc:jsdoc"/> | ||||
|       </include> | ||||
|     </context> <!-- /_doc-comment-content --> | ||||
| @@ -419,6 +643,8 @@ | ||||
|  | ||||
|         <!-- <Keyword> --> | ||||
|         <context id="_keywords" style-ref="reserved-word"> | ||||
|           <prefix>\%{keyword-start}</prefix> | ||||
|           <suffix>\%{keyword-end}</suffix> | ||||
|           <keyword>await</keyword> <!-- ES2017 --> | ||||
|           <keyword>break</keyword> | ||||
|           <keyword>case</keyword> | ||||
| @@ -459,12 +685,16 @@ | ||||
|              restrictions" | ||||
|              https://tc39.github.io/ecma262/#sec-keywords --> | ||||
|         <context id="_strict-mode-keywords" style-ref="reserved-word"> | ||||
|           <prefix>\%{keyword-start}</prefix> | ||||
|           <suffix>\%{keyword-end}</suffix> | ||||
|           <keyword>let</keyword> | ||||
|           <keyword>static</keyword> | ||||
|         </context> <!-- /_strict-mode-keywords --> | ||||
|  | ||||
|         <!-- <FutureReservedWord> --> | ||||
|         <context id="_future-reserved-words" style-ref="reserved-word"> | ||||
|           <prefix>\%{keyword-start}</prefix> | ||||
|           <suffix>\%{keyword-end}</suffix> | ||||
|           <keyword>enum</keyword> | ||||
|         </context> <!-- /_future-reserved-words --> | ||||
|  | ||||
| @@ -472,6 +702,8 @@ | ||||
|              restrictions" | ||||
|              https://tc39.github.io/ecma262/#sec-future-reserved-words --> | ||||
|         <context id="_strict-mode-future-reserved-words" style-ref="reserved-word"> | ||||
|           <prefix>\%{keyword-start}</prefix> | ||||
|           <suffix>\%{keyword-end}</suffix> | ||||
|           <keyword>implements</keyword> | ||||
|           <keyword>interface</keyword> | ||||
|           <keyword>package</keyword> | ||||
| @@ -496,7 +728,7 @@ | ||||
|     </context> <!-- /_identifier-name-content --> | ||||
|  | ||||
|     <context id="identifier-name" once-only="true"> | ||||
|       <start>(?=\%{identifier-start})</start> | ||||
|       <start>\%{identifier-container-start}</start> | ||||
|       <end>\%{def:always-match}</end> | ||||
|       <include> | ||||
|         <!-- no embedded-lang-hooks here --> | ||||
| @@ -508,7 +740,7 @@ | ||||
|     </context> <!-- /choice-identifier-name --> | ||||
|  | ||||
|     <context id="choice-identifier-name" end-parent="true"> | ||||
|       <start>(?=\%{identifier-start})</start> | ||||
|       <start>\%{identifier-container-start}</start> | ||||
|       <end>\%{def:always-match}</end> | ||||
|       <include> | ||||
|         <!-- no embedded-lang-hooks here --> | ||||
| @@ -527,7 +759,7 @@ | ||||
|     </context> <!-- /_identifier-content --> | ||||
|  | ||||
|     <context id="identifier" once-only="true"> | ||||
|       <start>(?=\%{identifier-start})</start> | ||||
|       <start>\%{identifier-container-start}</start> | ||||
|       <end>\%{def:always-match}</end> | ||||
|       <include> | ||||
|         <!-- no embedded-lang-hooks here --> | ||||
| @@ -539,7 +771,7 @@ | ||||
|     </context> <!-- /identifier --> | ||||
|  | ||||
|     <context id="choice-identifier" end-parent="true"> | ||||
|       <start>(?=\%{identifier-start})</start> | ||||
|       <start>\%{identifier-container-start}</start> | ||||
|       <end>\%{def:always-match}</end> | ||||
|       <include> | ||||
|         <!-- no embedded-lang-hooks here --> | ||||
| @@ -587,20 +819,8 @@ | ||||
|  | ||||
|     <!-- ## Misc syntax --> | ||||
|  | ||||
|     <context id="_keyword-dot" style-ref="keyword" once-only="true"> | ||||
|       <match>\.</match> | ||||
|     </context> <!-- /_keyword-dot --> | ||||
|  | ||||
|     <context id="ordered-keyword-dot" once-only="true"> | ||||
|       <start>\%{before-next-token}</start> | ||||
|       <end>\%{before-next-token}</end> | ||||
|       <include> | ||||
|         <context ref="_keyword-dot"/> | ||||
|       </include> | ||||
|     </context> <!-- /ordered-keyword-dot --> | ||||
|  | ||||
|     <context id="_rest-syntax" style-ref="rest-syntax" once-only="true"> | ||||
|       <match>\.\.\.</match> | ||||
|       <match>\%{rest-syntax}</match> | ||||
|     </context> <!-- /_rest-syntax --> | ||||
|  | ||||
|     <context id="ordered-rest-syntax" once-only="true"> | ||||
| @@ -612,7 +832,7 @@ | ||||
|     </context> <!-- /ordered-rest-syntax --> | ||||
|  | ||||
|     <context id="_spread-syntax" style-ref="spread-syntax" once-only="true"> | ||||
|       <match>\.\.\.</match> | ||||
|       <match>\%{spread-syntax}</match> | ||||
|     </context> <!-- /_spread-syntax --> | ||||
|  | ||||
|     <context id="ordered-spread-syntax" once-only="true"> | ||||
| @@ -636,170 +856,171 @@ | ||||
|     </context> <!-- /ordered-generator-modifier --> | ||||
|  | ||||
|  | ||||
|     <!-- # Assignment target --> | ||||
|     <!-- # Binding | ||||
|  | ||||
|     <!-- ## Array destructuring | ||||
|          Patterns for where variable names are bound/created: | ||||
|          * Variable declarations | ||||
|          * Function parameters | ||||
|  | ||||
|          [ a, b, ...rest ] = [ 1, 2, 3, 4 ] | ||||
|          [ a = 1, b = 2, c = 3 ] = [ 11, 12 ] | ||||
|          This is not used in assignment expressions; array/object | ||||
|          literals will match for array/object destructuring. | ||||
|     --> | ||||
|  | ||||
|     <context id="_array-destructuring-element-content"> | ||||
|     <!-- ## Array binding pattern (destructuring) | ||||
|  | ||||
|          var [ a, b, ...rest ] = [ 1, 2, 3, 4 ]; | ||||
|          function fn([ a = 1, b = 2, c = 3 ]) { ... } | ||||
|     --> | ||||
|  | ||||
|     <context id="_array-binding-pattern-element-content"> | ||||
|       <include> | ||||
|         <context ref="ordered-rest-syntax"/> | ||||
|         <context ref="ordered-assignment-target"/> | ||||
|         <context ref="ordered-binding"/> | ||||
|         <context ref="ordered-default-value-assignment"/> | ||||
|       </include> | ||||
|     </context> <!-- /_array-destructuring-element-content --> | ||||
|     </context> <!-- /_array-binding-pattern-element-content --> | ||||
|  | ||||
|     <!-- <ArrayBindingPattern> --> | ||||
|     <context id="_choice-array-destructuring" style-ref="array-destructuring" end-parent="true"> | ||||
|     <context id="_choice-array-binding-pattern" style-ref="array-binding-pattern" end-parent="true"> | ||||
|       <start>\[</start> | ||||
|       <end>]</end> | ||||
|       <include> | ||||
|         <context ref="embedded-lang-hooks"/> | ||||
|         <context ref="comments"/> | ||||
|  | ||||
|         <context id="_array-destructuring-content"> | ||||
|         <context id="_array-binding-pattern-content"> | ||||
|           <include> | ||||
|  | ||||
|             <context id="_array-destructuring-first-element" once-only="true"> | ||||
|             <context id="_array-binding-pattern-first-element" once-only="true"> | ||||
|               <start>\%{before-next-token}</start> | ||||
|               <end>\%{before-next-token}</end> | ||||
|               <include> | ||||
|                 <context ref="embedded-lang-hooks"/> | ||||
|                 <context ref="comments"/> | ||||
|                 <context ref="_array-destructuring-element-content"/> | ||||
|                 <context ref="_array-binding-pattern-element-content"/> | ||||
|               </include> | ||||
|             </context> <!-- /_array-destructuring-first-element --> | ||||
|             </context> <!-- /_array-binding-pattern-first-element --> | ||||
|  | ||||
|             <context id="_array-destructuring-elements"> | ||||
|             <context id="_array-binding-pattern-elements"> | ||||
|               <start>,</start> | ||||
|               <end>\%{before-next-token}</end> | ||||
|               <include> | ||||
|                 <context ref="embedded-lang-hooks"/> | ||||
|                 <context ref="comments"/> | ||||
|                 <context ref="_array-destructuring-element-content"/> | ||||
|                 <context ref="_array-binding-pattern-element-content"/> | ||||
|               </include> | ||||
|             </context> <!-- /_array-destructuring-elements --> | ||||
|             </context> <!-- /_array-binding-pattern-elements --> | ||||
|  | ||||
|           </include> | ||||
|         </context> <!-- /_array-destructuring-content --> | ||||
|         </context> <!-- /_array-binding-pattern-content --> | ||||
|  | ||||
|       </include> | ||||
|     </context> <!-- /_choice-array-destructuring --> | ||||
|     </context> <!-- /_choice-array-binding-pattern --> | ||||
|  | ||||
|     <!-- ## Object destructuring | ||||
|     <!-- ## Object binding pattern (destructuring) | ||||
|  | ||||
|          { a, y: b, ...rest } = { a: 1, y: 2, i: 3, y: 4 } | ||||
|          { a = 1, y: b = 2, c = 3 } = { a: 11, y: 12 } | ||||
|          var { a, y: b, ...rest } = { a: 1, y: 2, i: 3, y: 4 }; | ||||
|          function fn({ a = 1, y: b = 2, c = 3 }) { ... } | ||||
|     --> | ||||
|  | ||||
|     <context id="_object-destructuring-assignment-target" once-only="true"> | ||||
|     <context id="_object-binding-pattern-inner-binding" once-only="true"> | ||||
|       <start>:</start> | ||||
|       <end>\%{before-next-token}</end> | ||||
|       <include> | ||||
|         <context ref="embedded-lang-hooks"/> | ||||
|         <context ref="comments"/> | ||||
|  | ||||
|         <context id="_object-destructuring-assignment-target-content"> | ||||
|         <context id="_object-binding-pattern-inner-binding-content"> | ||||
|           <include> | ||||
|             <context ref="ordered-assignment-target"/> | ||||
|             <context ref="ordered-binding"/> | ||||
|           </include> | ||||
|         </context> <!-- /_object-destructuring-assignment-target-content --> | ||||
|         </context> <!-- /_object-binding-pattern-inner-binding-content --> | ||||
|  | ||||
|       </include> | ||||
|     </context> <!-- /_object-destructuring-assignment-target --> | ||||
|     </context> <!-- /_object-binding-pattern-inner-binding --> | ||||
|  | ||||
|     <context id="_ordered-object-destructuring-assignment-target" once-only="true"> | ||||
|     <context id="_ordered-object-binding-pattern-inner-binding" once-only="true"> | ||||
|       <start>\%{before-next-token}</start> | ||||
|       <end>\%{before-next-token}</end> | ||||
|       <include> | ||||
|         <context ref="_object-destructuring-assignment-target"/> | ||||
|         <context ref="_object-binding-pattern-inner-binding"/> | ||||
|       </include> | ||||
|     </context> <!-- /_ordered-object-destructuring-assignment-target --> | ||||
|     </context> <!-- /_ordered-object-binding-pattern-inner-binding --> | ||||
|  | ||||
|     <context id="_object-destructuring-property-content"> | ||||
|     <context id="_object-binding-pattern-property-content"> | ||||
|       <include> | ||||
|         <context ref="ordered-rest-syntax"/> <!-- ES2018 --> | ||||
|         <context ref="js-lit:ordered-property-name"/> | ||||
|         <context ref="_ordered-object-destructuring-assignment-target"/> | ||||
|         <context ref="_ordered-object-binding-pattern-inner-binding"/> | ||||
|         <context ref="ordered-default-value-assignment"/> | ||||
|       </include> | ||||
|     </context> <!-- /_object-destructuring-property-content --> | ||||
|     </context> <!-- /_object-binding-pattern-property-content --> | ||||
|  | ||||
|     <!-- <ObjectBindingPattern> --> | ||||
|     <context id="_choice-object-destructuring" style-ref="object-destructuring" end-parent="true"> | ||||
|     <context id="_choice-object-binding-pattern" style-ref="object-binding-pattern" end-parent="true"> | ||||
|       <start>{</start> | ||||
|       <end>}</end> | ||||
|       <include> | ||||
|         <context ref="embedded-lang-hooks"/> | ||||
|         <context ref="comments"/> | ||||
|  | ||||
|         <context id="_object-destructuring-content"> | ||||
|         <context id="_object-binding-pattern-content"> | ||||
|           <include> | ||||
|  | ||||
|             <context id="_object-destructuring-first-property" once-only="true"> | ||||
|             <context id="_object-binding-pattern-first-property" once-only="true"> | ||||
|               <start>\%{before-next-token}</start> | ||||
|               <end>\%{before-next-token}</end> | ||||
|               <include> | ||||
|                 <context ref="embedded-lang-hooks"/> | ||||
|                 <context ref="comments"/> | ||||
|                 <context ref="_object-destructuring-property-content"/> | ||||
|                 <context ref="_object-binding-pattern-property-content"/> | ||||
|               </include> | ||||
|             </context> <!-- /_object-destructuring-properties --> | ||||
|             </context> <!-- /_object-binding-pattern-properties --> | ||||
|  | ||||
|             <context id="_object-destructuring-properties"> | ||||
|             <context id="_object-binding-pattern-properties"> | ||||
|               <start>,</start> | ||||
|               <end>\%{before-next-token}</end> | ||||
|               <include> | ||||
|                 <context ref="embedded-lang-hooks"/> | ||||
|                 <context ref="comments"/> | ||||
|                 <context ref="_object-destructuring-property-content"/> | ||||
|                 <context ref="_object-binding-pattern-property-content"/> | ||||
|               </include> | ||||
|             </context> <!-- /_object-destructuring-properties --> | ||||
|             </context> <!-- /_object-binding-pattern-properties --> | ||||
|  | ||||
|           </include> | ||||
|         </context> <!-- /_object-destructuring-content --> | ||||
|         </context> <!-- /_object-binding-pattern-content --> | ||||
|  | ||||
|       </include> | ||||
|     </context> <!-- /_choice-object-destructuring --> | ||||
|     </context> <!-- /_choice-object-binding-pattern --> | ||||
|  | ||||
|     <!-- ## Assignment target | ||||
|  | ||||
|          Things that can appear on the left side of an equals sign | ||||
|          (identifier or array/object destructuring assignment), in all | ||||
|          places (function parameters, variable declaration) *except* in | ||||
|          assignment expressions (array/object literals will match for | ||||
|          array/object destructuring) | ||||
|     --> | ||||
|     <!-- ## Binding --> | ||||
|  | ||||
|     <!-- <VariableDeclaration> / <LexicalBinding> --> | ||||
|     <context id="_assignment-target" once-only="true"> | ||||
|     <context id="_binding" once-only="true"> | ||||
|       <start>\%{before-next-token}</start> | ||||
|       <end>\%{before-next-token}</end> | ||||
|       <include> | ||||
|         <context ref="embedded-lang-hooks"/> | ||||
|         <context ref="comments"/> | ||||
|  | ||||
|         <context id="_assignment-target-content"> | ||||
|         <context id="_binding-content"> | ||||
|           <include> | ||||
|             <context ref="_choice-array-destructuring"/> | ||||
|             <context ref="_choice-object-destructuring"/> | ||||
|             <context ref="_choice-array-binding-pattern"/> | ||||
|             <context ref="_choice-object-binding-pattern"/> | ||||
|             <context ref="choice-identifier"/> | ||||
|           </include> | ||||
|         </context> <!-- /_assignment-target-content --> | ||||
|         </context> <!-- /_binding-content --> | ||||
|  | ||||
|       </include> | ||||
|     </context> <!-- /_assignment-target --> | ||||
|     </context> <!-- /_binding --> | ||||
|  | ||||
|     <context id="ordered-assignment-target" once-only="true"> | ||||
|     <context id="ordered-binding" once-only="true"> | ||||
|       <start>\%{before-next-token}</start> | ||||
|       <end>\%{before-next-token}</end> | ||||
|       <include> | ||||
|         <context ref="_assignment-target"/> | ||||
|         <context ref="_binding"/> | ||||
|       </include> | ||||
|     </context> <!-- /ordered-assignment-target --> | ||||
|     </context> <!-- /ordered-binding --> | ||||
|  | ||||
|  | ||||
|     <!-- Approximate code order for component files: | ||||
|   | ||||
| @@ -4,7 +4,7 @@ | ||||
|  This file is part of GtkSourceView | ||||
|  | ||||
|  Author: Jeffery To <jeffery.to@gmail.com> | ||||
|  Copyright (C) 2019 Jeffery To <jeffery.to@gmail.com> | ||||
|  Copyright (C) 2019-2020 Jeffery To <jeffery.to@gmail.com> | ||||
|  | ||||
|  GtkSourceView is free software; you can redistribute it and/or | ||||
|  modify it under the terms of the GNU Lesser General Public | ||||
| @@ -35,7 +35,7 @@ | ||||
|   </styles> | ||||
|  | ||||
|   <!-- from js:identifier-char --> | ||||
|   <keyword-char-class>[\p{L}\p{Nl}\x{1885}-\x{1886}\x{2118}\x{212E}\x{309B}-\x{309C}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{00B7}\x{0387}\x{1369}-\x{1371}\x{19DA}$\x{200C}\x{200D}]</keyword-char-class> | ||||
|   <keyword-char-class>(?!\x{2E2F})[\p{L}\p{Nl}\x{1885}-\x{1886}\x{2118}\x{212E}\x{309B}-\x{309C}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{00B7}\x{0387}\x{1369}-\x{1371}\x{19DA}$\x{200C}\x{200D}]</keyword-char-class> | ||||
|  | ||||
|   <definitions> | ||||
|  | ||||
| @@ -57,8 +57,8 @@ | ||||
|     </context> | ||||
|  | ||||
|     <context id="inline-tag" style-ref="inline-tag" end-at-line-end="true"> | ||||
|       <start>\{@</start> | ||||
|       <end>\}</end> | ||||
|       <start>{@</start> | ||||
|       <end>}</end> | ||||
|       <include> | ||||
|         <context ref="embedded-lang-hooks"/> | ||||
|         <context ref="escape"/> | ||||
| @@ -67,8 +67,8 @@ | ||||
|     </context> | ||||
|  | ||||
|     <context id="type" style-ref="type" end-at-line-end="true"> | ||||
|       <start>\{</start> | ||||
|       <end>\}</end> | ||||
|       <start>{</start> | ||||
|       <end>}</end> | ||||
|       <include> | ||||
|         <context ref="embedded-lang-hooks"/> | ||||
|         <context ref="escape"/> | ||||
| @@ -94,7 +94,7 @@ | ||||
|           tutorial | | ||||
|           variation | ||||
|         ) | ||||
|         \%] | ||||
|         \%{js:keyword-end} | ||||
|       </start> | ||||
|       <end>(?=\S)</end> | ||||
|       <include> | ||||
| @@ -113,7 +113,7 @@ | ||||
|           fires | | ||||
|           listens | ||||
|         ) | ||||
|         \%] | ||||
|         \%{js:keyword-end} | ||||
|       </start> | ||||
|       <end>(?=\S)</end> | ||||
|       <include> | ||||
| @@ -130,7 +130,7 @@ | ||||
|           access | | ||||
|           kind | ||||
|         ) | ||||
|         \%] | ||||
|         \%{js:keyword-end} | ||||
|       </start> | ||||
|       <end>(?=\S)</end> | ||||
|       <include> | ||||
| @@ -168,7 +168,7 @@ | ||||
|             typeParam |  # tsdoc | ||||
|             this | ||||
|           ) | ||||
|           \%] | ||||
|           \%{js:keyword-end} | ||||
|         ) | ||||
|       </start> | ||||
|       <end>(?=\S)</end> | ||||
| @@ -198,7 +198,7 @@ | ||||
|           typedef | | ||||
|           var | ||||
|         ) | ||||
|         \%] | ||||
|         \%{js:keyword-end} | ||||
|       </start> | ||||
|       <end>(?=\S)</end> | ||||
|       <include> | ||||
| @@ -210,7 +210,9 @@ | ||||
|     </context> | ||||
|  | ||||
|     <context id="borrows-block-tag" end-at-line-end="true"> | ||||
|       <start>@borrows\%]</start> | ||||
|       <start extended="true"> | ||||
|         @borrows \%{js:keyword-end} | ||||
|       </start> | ||||
|       <end>(?=\S)</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="block-tag"/> | ||||
| @@ -221,7 +223,9 @@ | ||||
|         </context> | ||||
|  | ||||
|         <context end-parent="true"> | ||||
|           <start>\%[as\%]</start> | ||||
|           <start extended="true"> | ||||
|             \%{js:keyword-start} as \%{js:keyword-end} | ||||
|           </start> | ||||
|           <end>(?=\S)</end> | ||||
|           <include> | ||||
|             <context ref="argument" style-ref="namepath"/> | ||||
| @@ -232,7 +236,9 @@ | ||||
|     </context> | ||||
|  | ||||
|     <context id="note-block-tag" style-ref="block-tag"> | ||||
|       <match>@todo\%]</match> | ||||
|       <match extended="true"> | ||||
|         @todo \%{js:keyword-end} | ||||
|       </match> | ||||
|       <include> | ||||
|         <context sub-pattern="0" style-ref="note"/> | ||||
|       </include> | ||||
|   | ||||
| @@ -4,7 +4,7 @@ | ||||
|  This file is part of GtkSourceView | ||||
|  | ||||
|  Author: Jeffery To <jeffery.to@gmail.com> | ||||
|  Copyright (C) 2019 Jeffery To <jeffery.to@gmail.com> | ||||
|  Copyright (C) 2019-2020 Jeffery To <jeffery.to@gmail.com> | ||||
|  | ||||
|  GtkSourceView is free software; you can redistribute it and/or | ||||
|  modify it under the terms of the GNU Lesser General Public | ||||
| @@ -37,7 +37,7 @@ | ||||
|   </styles> | ||||
|  | ||||
|   <!-- from js:identifier-char --> | ||||
|   <keyword-char-class>[\p{L}\p{Nl}\x{1885}-\x{1886}\x{2118}\x{212E}\x{309B}-\x{309C}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{00B7}\x{0387}\x{1369}-\x{1371}\x{19DA}$\x{200C}\x{200D}]</keyword-char-class> | ||||
|   <keyword-char-class>(?!\x{2E2F})[\p{L}\p{Nl}\x{1885}-\x{1886}\x{2118}\x{212E}\x{309B}-\x{309C}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{00B7}\x{0387}\x{1369}-\x{1371}\x{19DA}$\x{200C}\x{200D}]</keyword-char-class> | ||||
|  | ||||
|   <definitions> | ||||
|  | ||||
| @@ -67,13 +67,17 @@ | ||||
|       </include> | ||||
|     </context> <!-- /main-lang --> | ||||
|  | ||||
|     <define-regex id="_start-tag-start">(?:<(?!/))</define-regex> | ||||
|     <define-regex id="_start-tag-start"><(?!/)</define-regex> | ||||
|  | ||||
|  | ||||
|     <!-- # Names --> | ||||
|  | ||||
|     <define-regex id="_identifier-char" extended="true"> | ||||
|       \%{js:identifier-char} | - | ||||
|     </define-regex> <!-- /_identifier-char --> | ||||
|  | ||||
|     <define-regex id="_identifier-part" extended="true"> | ||||
|       (?: \%{js:identifier-part} | - ) | ||||
|       \%{_identifier-char} | \%{js:unicode-escape} | ||||
|     </define-regex> <!-- /_identifier-part --> | ||||
|  | ||||
|     <!-- <JSXIdentifier> --> | ||||
| @@ -81,32 +85,36 @@ | ||||
|       \%{js:identifier-start} \%{_identifier-part}* | ||||
|     </define-regex> <!-- /_identifier --> | ||||
|  | ||||
|     <context id="_identifier" once-only="true"> | ||||
|       <match>\%{_identifier}</match> | ||||
|     </context> <!-- /_identifier --> | ||||
|     <define-regex id="_identifier-container-start" extended="true"> | ||||
|       (?<! \%{_identifier-char} ) (?= \%{js:identifier-start} ) | ||||
|     </define-regex> <!-- /_identifier-container-start --> | ||||
|  | ||||
|     <context id="_choice-identifier" end-parent="true"> | ||||
|       <start>(?=\%{js:identifier-start})</start> | ||||
|       <start>\%{_identifier-container-start}</start> | ||||
|       <end>\%{_identifier}</end> | ||||
|     </context> <!-- /_choice-identifier --> | ||||
|  | ||||
|     <!-- <JSXNamespacedName> --> | ||||
|     <define-regex id="_namespaced-name" extended="true"> | ||||
|       (?: \%{_identifier} : \%{_identifier} ) | ||||
|       \%{_identifier} : \%{_identifier} | ||||
|     </define-regex> <!-- /_namespaced-name --> | ||||
|  | ||||
|     <context id="_choice-namespaced-name" end-parent="true"> | ||||
|       <start>(?=\%{_namespaced-name})</start> | ||||
|       <start extended="true"> | ||||
|         (?<! \%{_identifier-char} ) (?= \%{_namespaced-name} ) | ||||
|       </start> | ||||
|       <end>\%{_namespaced-name}</end> | ||||
|     </context> <!-- /_choice-namespaced-name --> | ||||
|  | ||||
|     <!-- <JSXMemberExpression> --> | ||||
|     <define-regex id="_member-expression" extended="true"> | ||||
|       (?: \%{_identifier} (?: \. \%{_identifier} )+ ) | ||||
|       \%{_identifier} (?: \. \%{_identifier} )+ | ||||
|     </define-regex> <!-- /_member-expression --> | ||||
|  | ||||
|     <context id="_choice-member-expression" end-parent="true"> | ||||
|       <start>(?=\%{_member-expression})</start> | ||||
|       <start extended="true"> | ||||
|         (?<! \%{_identifier-char} ) (?= \%{_member-expression} ) | ||||
|       </start> | ||||
|       <end>\%{_member-expression}</end> | ||||
|     </context> <!-- /_choice-member-expression --> | ||||
|  | ||||
| @@ -115,7 +123,7 @@ | ||||
|  | ||||
|     <!-- <JSXElementName> --> | ||||
|     <context id="_element-name" style-ref="xml:element-name" once-only="true"> | ||||
|       <start>(?=\%{js:identifier-start})</start> | ||||
|       <start>\%{_identifier-container-start}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context ref="js:comments"/> | ||||
| @@ -165,7 +173,7 @@ | ||||
|  | ||||
|     <!-- <JSXAttributeName> --> | ||||
|     <context id="_attribute-names" style-ref="xml:attribute-name"> | ||||
|       <start>(?=\%{js:identifier-start})</start> | ||||
|       <start>\%{_identifier-container-start}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context ref="js:comments"/> | ||||
| @@ -243,38 +251,10 @@ | ||||
|  | ||||
|     <!-- # Element / fragment --> | ||||
|  | ||||
|     <context id="_element-content"> | ||||
|     <context id="_start-tag-tail-non-empty-element-content"> | ||||
|       <include> | ||||
|  | ||||
|         <!-- ## Start tag --> | ||||
|  | ||||
|         <!-- <JSXOpeningElement> / <JSXSelfClosingElement> --> | ||||
|         <context id="_start-tag-head" style-ref="xml:tag" once-only="true" class="no-spell-check"> | ||||
|           <start>\%{_start-tag-start}</start> | ||||
|           <end>(?=/?>)</end> | ||||
|           <include> | ||||
|             <context sub-pattern="0" where="start" style-ref="xml:element-name"/> | ||||
|             <context ref="js:comments"/> | ||||
|  | ||||
|             <context id="_start-tag-head-content"> | ||||
|               <include> | ||||
|                 <context ref="_ordered-element-name"/> | ||||
|                 <context ref="_spread-attributes"/> | ||||
|                 <context ref="_attribute-names"/> | ||||
|                 <context ref="_attribute-initializers"/> | ||||
|               </include> | ||||
|             </context> <!-- /_start-tag-head-content --> | ||||
|  | ||||
|           </include> | ||||
|         </context> <!-- /_start-tag-head --> | ||||
|  | ||||
|         <context id="_start-tag-tail-empty-element-end-parent" style-ref="xml:tag" end-parent="true" class="no-spell-check"> | ||||
|           <start>(?=/>)</start> | ||||
|           <end>/></end> | ||||
|           <include> | ||||
|             <context sub-pattern="0" where="end" style-ref="xml:element-name"/> | ||||
|           </include> | ||||
|         </context> <!-- /_start-tag-tail-empty-element-end-parent --> | ||||
|         <!-- ## Start tag tail --> | ||||
|  | ||||
|         <context id="_start-tag-tail" style-ref="xml:tag" once-only="true" class="no-spell-check"> | ||||
|           <match>></match> | ||||
| @@ -308,8 +288,7 @@ | ||||
|         <context id="_elements" style-ref="element" class-disabled="no-spell-check"> | ||||
|           <start>(?=\%{_start-tag-start})</start> | ||||
|           <include> | ||||
|             <!-- no comments here - comments appear to be parsed as regular | ||||
|                  text --> | ||||
|             <!-- no comments here - comments parsed as regular text --> | ||||
|             <context ref="_element-content"/> | ||||
|           </include> | ||||
|         </context> <!-- /_elements --> | ||||
| @@ -340,6 +319,59 @@ | ||||
|              appear to be parsed --> | ||||
|         <context ref="xml:entity"/> | ||||
|         <context ref="xml:character-reference"/> | ||||
|  | ||||
|         <!-- ## Invalid characters --> | ||||
|  | ||||
|         <!-- the spec does not allow these characters: { < > } | ||||
|              but we will only highlight > and } as errors --> | ||||
|         <context id="_invalid-characters" style-ref="xml:error"> | ||||
|           <match>[>}]</match> | ||||
|         </context> <!-- /_invalid-characters --> | ||||
|  | ||||
|       </include> | ||||
|     </context> <!-- /_start-tag-tail-non-empty-element-content --> | ||||
|  | ||||
|     <context id="_element-content"> | ||||
|       <include> | ||||
|  | ||||
|         <!-- ## Start tag --> | ||||
|  | ||||
|         <!-- <JSXOpeningElement> / <JSXSelfClosingElement> --> | ||||
|         <context id="_start-tag-head" style-ref="xml:tag" once-only="true" class="no-spell-check"> | ||||
|           <start>\%{_start-tag-start}</start> | ||||
|           <end>(?=/?>)</end> | ||||
|           <include> | ||||
|             <context sub-pattern="0" where="start" style-ref="xml:element-name"/> | ||||
|             <context ref="js:comments"/> | ||||
|  | ||||
|             <context id="_start-tag-head-content"> | ||||
|               <include> | ||||
|                 <context ref="_ordered-element-name"/> | ||||
|                 <context ref="_spread-attributes"/> | ||||
|                 <context ref="_attribute-names"/> | ||||
|                 <context ref="_attribute-initializers"/> | ||||
|               </include> | ||||
|             </context> <!-- /_start-tag-head-content --> | ||||
|  | ||||
|           </include> | ||||
|         </context> <!-- /_start-tag-head --> | ||||
|  | ||||
|         <context id="_choice-start-tag-tail-empty-element" style-ref="xml:tag" end-parent="true" class="no-spell-check"> | ||||
|           <start>(?=/>)</start> | ||||
|           <end>/></end> | ||||
|           <include> | ||||
|             <context sub-pattern="0" where="end" style-ref="xml:element-name"/> | ||||
|           </include> | ||||
|         </context> <!-- /_choice-start-tag-tail-empty-element --> | ||||
|  | ||||
|         <context id="_choice-start-tag-tail-non-empty-element" end-parent="true"> | ||||
|           <start>(?=>)</start> | ||||
|           <include> | ||||
|             <!-- no comments here - comments parsed as regular text --> | ||||
|             <context ref="_start-tag-tail-non-empty-element-content"/> | ||||
|           </include> | ||||
|         </context> <!-- /_choice-start-tag-tail-non-empty-element --> | ||||
|  | ||||
|       </include> | ||||
|     </context> <!-- /_element-content --> | ||||
|  | ||||
| @@ -347,8 +379,7 @@ | ||||
|     <context id="choice-element" style-ref="element" end-parent="true" class-disabled="no-spell-check"> | ||||
|       <start>(?=\%{_start-tag-start})</start> | ||||
|       <include> | ||||
|         <!-- no comments here - comments appear to be parsed as regular | ||||
|              text --> | ||||
|         <!-- no comments here - comments parsed as regular text --> | ||||
|         <context ref="_element-content"/> | ||||
|       </include> | ||||
|     </context> <!-- /choice-element --> | ||||
|   | ||||
| @@ -34,6 +34,9 @@ | ||||
|     <style id="inline-math"        name="Inline Math Mode"     map-to="latex:display-math"/> | ||||
|     <style id="math"               name="Math Mode"            map-to="latex:display-math"/> | ||||
|     <style id="math-boundary"      name="Math Boundary"        map-to="latex:display-math"/> | ||||
|     <style id="class-name"         name="Document class name"  map-to="def:text"/> | ||||
|     <style id="pkg-name"           name="Package name"         map-to="def:text"/> | ||||
|     <style id="env-name"           name="Environment name"     map-to="def:text"/> | ||||
|     <style id="include"            name="Include"              map-to="def:keyword"/> | ||||
|     <style id="common-commands"    name="Command"              map-to="def:keyword"/> | ||||
|     <style id="command"            name="Command"              map-to="def:keyword"/> | ||||
| @@ -355,23 +358,26 @@ | ||||
|     <context id="specific-commands"> | ||||
|       <include> | ||||
|         <context id="documentclass" class="no-spell-check"> | ||||
|           <match>(\\documentclass)(\[.*\])?(\{.*\})?</match> | ||||
|           <match>(\\documentclass)(\[.*\])?(\{(.*)\})?</match> | ||||
|           <include> | ||||
|             <context sub-pattern="1" style-ref="common-commands"/> | ||||
|             <context sub-pattern="4" style-ref="class-name"/> | ||||
|           </include> | ||||
|         </context> | ||||
|  | ||||
|         <context id="include" class="no-spell-check"> | ||||
|           <match>(\\(input|include|includeonly|usepackage))\b(\[.*\])?(\{.*\})?</match> | ||||
|           <match>(\\(input|include|includeonly|usepackage))\b(\[.*\])?(\{(.*)\})?</match> | ||||
|           <include> | ||||
|             <context sub-pattern="1" style-ref="include"/> | ||||
|             <context sub-pattern="5" style-ref="pkg-name"/> | ||||
|           </include> | ||||
|         </context> | ||||
|  | ||||
|         <context id="begin-end-command" class="no-spell-check"> | ||||
|           <match>(\\(begin|end))\{.*\}</match> | ||||
|           <match>(\\(begin|end))\{(.*?)\}</match> | ||||
|           <include> | ||||
|             <context sub-pattern="1" style-ref="common-commands"/> | ||||
|             <context sub-pattern="3" style-ref="env-name"/> | ||||
|           </include> | ||||
|         </context> | ||||
|       </include> | ||||
| @@ -597,7 +603,7 @@ | ||||
|     </context> | ||||
|  | ||||
|     <context id="math-env" style-ref="math" style-inside="true" class="no-spell-check"> | ||||
|       <start>(\\begin)\{(math|displaymath|equation\*?|align\*?|eqnarray\*?)\}</start> | ||||
|       <start>(\\begin)\{(math|displaymath|equation\*?|align\*?|eqnarray\*?|multline\*?|gather\*?)\}</start> | ||||
|       <end>(\\end)\{\%{2@start}\}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="1" where="start" style-ref="common-commands"/> | ||||
|   | ||||
| @@ -4,7 +4,7 @@ | ||||
|  This file is part of GtkSourceView | ||||
|  | ||||
|  Author: Jeffery To <jeffery.to@gmail.com> | ||||
|  Copyright (C) 2018-2019 Jeffery To <jeffery.to@gmail.com> | ||||
|  Copyright (C) 2018-2020 Jeffery To <jeffery.to@gmail.com> | ||||
|  | ||||
|  GtkSourceView is free software; you can redistribute it and/or | ||||
|  modify it under the terms of the GNU Lesser General Public | ||||
| @@ -55,14 +55,15 @@ | ||||
|  | ||||
|   <default-regex-options case-sensitive="false"/> | ||||
|  | ||||
|   <keyword-char-class>[a-z0-9_\x{80}-\x{10ffff}\\-]</keyword-char-class> | ||||
|   <!-- from css:keyword-code-point --> | ||||
|   <keyword-char-class>[^\x{0}-\x{2C}\x{2E}\x{2F}\x{3A}-\x{40}\x{5B}\x{5D}\x{5E}\x{60}\x{7B}-\x{7F}]</keyword-char-class> | ||||
|  | ||||
|   <definitions> | ||||
|  | ||||
|     <!-- global --> | ||||
|  | ||||
|     <define-regex id="identifier">[\w-]+</define-regex> | ||||
|     <define-regex id="statement-end" extended="true">;|(?=})</define-regex> | ||||
|     <define-regex id="statement-end">;|(?=})</define-regex> | ||||
|  | ||||
|     <context id="embedded-lang-hook"/> | ||||
|  | ||||
| @@ -120,7 +121,9 @@ | ||||
|     </context> | ||||
|  | ||||
|     <context id="arguments-variable" style-ref="built-in-variable"> | ||||
|       <match>@arguments\%]</match> | ||||
|       <match extended="true"> | ||||
|         @arguments \%{css:keyword-end} | ||||
|       </match> | ||||
|     </context> | ||||
|  | ||||
|     <context id="arguments-variable-interpolation" style-ref="built-in-variable"> | ||||
| @@ -152,12 +155,10 @@ | ||||
|          also not sure what are Less' rules regarding hyphen vs subtraction --> | ||||
|     <context id="arithmetic-operator" style-ref="operator-symbol"> | ||||
|       <match extended="true"> | ||||
|         ( | ||||
|           [+*/] | | ||||
|           (?<! \%{css:single-identifier-char} ) | ||||
|           - | ||||
|           (?! \%{css:single-identifier-char} ) | ||||
|         ) | ||||
|         [+*/] | | ||||
|         (?<! \%{css:keyword-code-point} ) | ||||
|         - | ||||
|         (?! \%{css:keyword-code-point} ) | ||||
|       </match> | ||||
|     </context> | ||||
|  | ||||
| @@ -165,6 +166,8 @@ | ||||
|     <!-- Less data types --> | ||||
|  | ||||
|     <context id="boolean" style-ref="boolean"> | ||||
|       <prefix>\%{css:keyword-start}</prefix> | ||||
|       <suffix>\%{css:keyword-end}</suffix> | ||||
|       <keyword>true</keyword> | ||||
|     </context> | ||||
|  | ||||
| @@ -279,7 +282,9 @@ | ||||
|     <!-- functions --> | ||||
|  | ||||
|     <context id="less-url"> | ||||
|       <start>url\(</start> | ||||
|       <start extended="true"> | ||||
|         \%{css:keyword-start} url \( | ||||
|       </start> | ||||
|       <end>\)</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="css:function"/> | ||||
| @@ -495,17 +500,17 @@ | ||||
|           ) | ||||
|         ) | ||||
|  | ||||
|         ( | ||||
|         (?: | ||||
|           \+_?: |  # property merge | ||||
|           : | ||||
|           (?: | ||||
|             (?!                                 # not the start of a | ||||
|               \%{css:single-identifier-char} |  #   pseudo-class | ||||
|               [:\\] |                           #   pseudo-element, escape | ||||
|               @{ |                              #   variable interpolation | ||||
|               /\*                               #   comment | ||||
|             ) |                                 # or | ||||
|             (?=                                 # ends like a normal declaration | ||||
|             (?!                              # not the start of a | ||||
|               \%{css:keyword-code-point} |   #   pseudo-class | ||||
|               [:\\] |                        #   pseudo-element, escape | ||||
|               @{ |                           #   variable interpolation | ||||
|               /\*                            #   comment | ||||
|             ) |                              # or | ||||
|             (?=                              # ends like a normal declaration | ||||
|               (?: | ||||
|                 (?> | ||||
|                   (?: | ||||
| @@ -521,7 +526,7 @@ | ||||
|                 (?&double_quote_string) | | ||||
|                 (?&single_quote_string) | ||||
|               )* | ||||
|               \%{css:declaration-value-end}     #   with a semicolon or at the end of a block | ||||
|               \%{css:declaration-value-end}  #   with a semicolon or at the end of a block | ||||
|             ) | ||||
|           ) | ||||
|         ) | ||||
| @@ -540,6 +545,7 @@ | ||||
|         <context ref="css:at-rule"/> <!-- because Less variables look like at-rules --> | ||||
|         <context ref="detached-ruleset-call"/> | ||||
|         <context ref="standalone-plugin-function-call"/> | ||||
|         <context ref="inside-ruleset-extend"/> | ||||
|         <context ref="css:style-block-content" original="true"/> | ||||
|         <context ref="css:selector"/> | ||||
|         <context ref="css:style-block"/> | ||||
| @@ -587,7 +593,9 @@ | ||||
|     </context> | ||||
|  | ||||
|     <context id="at-plugin"> | ||||
|       <start>@plugin\%]</start> | ||||
|       <start extended="true"> | ||||
|         @plugin \%{css:keyword-end} | ||||
|       </start> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="css:at-rule"/> | ||||
|         <context ref="css:embedded-lang-hook"/> | ||||
| @@ -602,7 +610,9 @@ | ||||
|     </context> | ||||
|  | ||||
|     <context id="standalone-plugin-function-call"> | ||||
|       <start>(?=\%{identifier}\()</start> | ||||
|       <start extended="true"> | ||||
|         \%{css:keyword-start} (?= \%{identifier} \( ) | ||||
|       </start> | ||||
|       <end>\%{statement-end}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="end" style-ref="css:delimiter"/> | ||||
| @@ -616,7 +626,9 @@ | ||||
|     <!-- at-rules --> | ||||
|  | ||||
|     <context id="less-at-charset"> | ||||
|       <start case-sensitive="true">@charset\%]</start> | ||||
|       <start case-sensitive="true" extended="true"> | ||||
|         @charset \%{css:keyword-end} | ||||
|       </start> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="css:at-rule"/> | ||||
|         <context ref="css:embedded-lang-hook"/> | ||||
| @@ -653,6 +665,8 @@ | ||||
|     --> | ||||
|  | ||||
|     <context id="less-at-import-options-keyword" style-ref="css:keyword"> | ||||
|       <prefix>\%{css:keyword-start}</prefix> | ||||
|       <suffix>\%{css:keyword-end}</suffix> | ||||
|       <keyword>css</keyword> | ||||
|       <keyword>inline</keyword> | ||||
|       <keyword>less</keyword> | ||||
| @@ -676,7 +690,9 @@ | ||||
|     </context> | ||||
|  | ||||
|     <context id="less-at-import"> | ||||
|       <start>@import\%]</start> | ||||
|       <start extended="true"> | ||||
|         @import \%{css:keyword-end} | ||||
|       </start> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="css:at-rule"/> | ||||
|         <context ref="css:embedded-lang-hook"/> | ||||
| @@ -744,13 +760,15 @@ | ||||
|     <!-- guards --> | ||||
|  | ||||
|     <context id="guard-logical-operator" style-ref="guard-operator"> | ||||
|       <prefix>\%{css:keyword-start}</prefix> | ||||
|       <suffix>\%{css:keyword-end}</suffix> | ||||
|       <keyword>and</keyword> | ||||
|       <keyword>not</keyword> | ||||
|       <keyword>or</keyword> | ||||
|     </context> | ||||
|  | ||||
|     <context id="guard-comparison-operator" style-ref="operator-symbol"> | ||||
|       <match>(>=?|=<?|<)</match> | ||||
|       <match>>=?|=<?|<</match> | ||||
|     </context> | ||||
|  | ||||
|     <context id="guard-test"> | ||||
| @@ -767,7 +785,9 @@ | ||||
|     </context> | ||||
|  | ||||
|     <context id="guard"> | ||||
|       <start>\%[when\%]</start> | ||||
|       <start extended="true"> | ||||
|         \%{css:keyword-start} when \%{css:keyword-end} | ||||
|       </start> | ||||
|       <end>(?={)</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="guard-operator"/> | ||||
| @@ -782,6 +802,9 @@ | ||||
|  | ||||
|     <!-- Less selectors --> | ||||
|  | ||||
|     <!-- Less does not appear to allow comments between the colon(s) and | ||||
|          pseudo-element/class name --> | ||||
|  | ||||
|     <context id="parent-combinator"> | ||||
|       <match>(&)(\%{css:identifier-chars}?)</match> | ||||
|       <include> | ||||
| @@ -795,11 +818,15 @@ | ||||
|     </context> | ||||
|  | ||||
|     <context id="extend-pseudo-class-keyword" once-only="true" style-ref="css:keyword"> | ||||
|       <prefix>\%{css:keyword-start}</prefix> | ||||
|       <suffix>\%{css:keyword-end}</suffix> | ||||
|       <keyword>all</keyword> | ||||
|     </context> | ||||
|  | ||||
|     <context id="extend-pseudo-class" end-parent="true"> | ||||
|       <start>\%[extend\(</start> | ||||
|       <start extended="true"> | ||||
|         \%{css:keyword-start} extend \( | ||||
|       </start> | ||||
|       <end>\)</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="css:pseudo-class"/> | ||||
| @@ -811,6 +838,17 @@ | ||||
|       </include> | ||||
|     </context> | ||||
|  | ||||
|     <context id="inside-ruleset-extend"> | ||||
|       <start>(?=&:extend\()</start> | ||||
|       <end>\%{statement-end}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="end" style-ref="css:delimiter"/> | ||||
|         <context ref="css:embedded-lang-hook"/> | ||||
|         <context ref="css:comment"/> | ||||
|         <context ref="css:selector"/> | ||||
|       </include> | ||||
|     </context> | ||||
|  | ||||
|  | ||||
|     <!-- selectors --> | ||||
|  | ||||
|   | ||||
| @@ -79,6 +79,7 @@ | ||||
|       <keyword>add_project_arguments</keyword> | ||||
|       <keyword>add_project_link_arguments</keyword> | ||||
|       <keyword>add_test_setup</keyword> | ||||
|       <keyword>alias_target</keyword> | ||||
|       <keyword>assert</keyword> | ||||
|       <keyword>benchmark</keyword> | ||||
|       <keyword>both_libraries</keyword> | ||||
| @@ -104,12 +105,14 @@ | ||||
|       <keyword>install_headers</keyword> | ||||
|       <keyword>install_man</keyword> | ||||
|       <keyword>install_subdir</keyword> | ||||
|       <keyword>is_disabler</keyword> | ||||
|       <keyword>is_variable</keyword> | ||||
|       <keyword>jar</keyword> | ||||
|       <keyword>join_paths</keyword> | ||||
|       <keyword>library</keyword> | ||||
|       <keyword>message</keyword> | ||||
|       <keyword>warning</keyword> | ||||
|       <keyword>summary</keyword> | ||||
|       <keyword>project</keyword> | ||||
|       <keyword>run_command</keyword> | ||||
|       <keyword>run_target</keyword> | ||||
| @@ -117,8 +120,8 @@ | ||||
|       <keyword>shared_library</keyword> | ||||
|       <keyword>shared_module</keyword> | ||||
|       <keyword>static_library</keyword> | ||||
|       <keyword>subdir_done</keyword> | ||||
|       <keyword>subdir</keyword> | ||||
|       <keyword>subdir_done</keyword> | ||||
|       <keyword>subproject</keyword> | ||||
|       <keyword>test</keyword> | ||||
|       <keyword>vcs_tag</keyword> | ||||
|   | ||||
| @@ -7,7 +7,7 @@ | ||||
|  Author: Patryk Zawadzki <patrys@pld-linux.org> | ||||
|  Copyright (C) 2007 Yevgen Muntyan <muntyan@math.tamu.edu> | ||||
|  Copyright (C) 2010 Patryk Zawadzki <patrys@pld-linux.org> | ||||
|  Copyright (C) 2019 Jeffery To <jeffery.to@gmail.com> | ||||
|  Copyright (C) 2019-2020 Jeffery To <jeffery.to@gmail.com> | ||||
|  | ||||
|  GtkSourceView is free software; you can redistribute it and/or | ||||
|  modify it under the terms of the GNU Lesser General Public | ||||
| @@ -37,7 +37,7 @@ | ||||
|   </styles> | ||||
|  | ||||
|   <!-- from js:identifier-char --> | ||||
|   <keyword-char-class>[\p{L}\p{Nl}\x{1885}-\x{1886}\x{2118}\x{212E}\x{309B}-\x{309C}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{00B7}\x{0387}\x{1369}-\x{1371}\x{19DA}$\x{200C}\x{200D}]</keyword-char-class> | ||||
|   <keyword-char-class>(?!\x{2E2F})[\p{L}\p{Nl}\x{1885}-\x{1886}\x{2118}\x{212E}\x{309B}-\x{309C}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{00B7}\x{0387}\x{1369}-\x{1371}\x{19DA}$\x{200C}\x{200D}]</keyword-char-class> | ||||
|  | ||||
|   <definitions> | ||||
|  | ||||
| @@ -84,7 +84,7 @@ | ||||
|           undef | | ||||
|           warning | ||||
|         ) | ||||
|         \%] | ||||
|         \%{js:keyword-end} | ||||
|       </start> | ||||
|       <include> | ||||
|         <context ref="def:line-continue"/> | ||||
| @@ -94,6 +94,8 @@ | ||||
|     <!-- ## Objective-J types --> | ||||
|  | ||||
|     <context id="_common-types" style-ref="type"> | ||||
|       <prefix>\%{js:keyword-start}</prefix> | ||||
|       <suffix>\%{js:keyword-end}</suffix> | ||||
|       <keyword>BOOL</keyword> | ||||
|       <keyword>byte</keyword> | ||||
|       <keyword>char</keyword> | ||||
| @@ -112,11 +114,14 @@ | ||||
|       <include> | ||||
|  | ||||
|         <context id="_variable-only-type-keywords" style-ref="type"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>IBOutlet</keyword> | ||||
|         </context> <!-- /_variable-only-type-keywords --> | ||||
|  | ||||
|         <context id="_variable-only-at-type-keywords" style-ref="type"> | ||||
|           <prefix>@</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>outlet</keyword> | ||||
|         </context> <!-- /_variable-only-at-type-keywords --> | ||||
|  | ||||
| @@ -127,12 +132,15 @@ | ||||
|       <include> | ||||
|  | ||||
|         <context id="_method-return-only-type-keywords" style-ref="type"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>IBAction</keyword> | ||||
|           <keyword>void</keyword> | ||||
|         </context> <!-- /_method-return-only-type-keywords --> | ||||
|  | ||||
|         <context id="_method-return-only-at-type-keywords" style-ref="type"> | ||||
|           <prefix>@</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>action</keyword> | ||||
|         </context> <!-- /_method-return-only-at-type-keywords --> | ||||
|  | ||||
| @@ -143,7 +151,9 @@ | ||||
|     <!-- # @class statement --> | ||||
|  | ||||
|     <context id="at-class-statements"> | ||||
|       <start>@class\%]</start> | ||||
|       <start extended="true"> | ||||
|         @class \%{js:keyword-end} | ||||
|       </start> | ||||
|       <end>\%{js:identifier}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
| @@ -157,7 +167,9 @@ | ||||
|     <!-- # @global statement --> | ||||
|  | ||||
|     <context id="at-global-statements"> | ||||
|       <start>@global\%]</start> | ||||
|       <start extended="true"> | ||||
|         @global \%{js:keyword-end} | ||||
|       </start> | ||||
|       <end>\%{js:identifier}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
| @@ -183,6 +195,8 @@ | ||||
|           <include> | ||||
|  | ||||
|             <context id="_at-implementation-variable-declaration-accessor-modifier-keywords" style-ref="js:keyword"> | ||||
|               <prefix>\%{js:keyword-start}</prefix> | ||||
|               <suffix>\%{js:keyword-end}</suffix> | ||||
|               <keyword>copy</keyword> | ||||
|               <keyword>getter</keyword> | ||||
|               <keyword>property</keyword> | ||||
| @@ -198,7 +212,9 @@ | ||||
|     </context> <!-- /_at-implementation-variable-declaration-accessor-modifiers-end-parent --> | ||||
|  | ||||
|     <context id="_at-implementation-variable-declaration-accessors"> | ||||
|       <start>@accessors\%]</start> | ||||
|       <start extended="true"> | ||||
|         @accessors \%{js:keyword-end} | ||||
|       </start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
| @@ -264,8 +280,12 @@ | ||||
|     <!-- ## @implementation declaration --> | ||||
|  | ||||
|     <context id="at-implementation-declarations"> | ||||
|       <start>@implementation\%]</start> | ||||
|       <end>@end\%]</end> | ||||
|       <start extended="true"> | ||||
|         @implementation \%{js:keyword-end} | ||||
|       </start> | ||||
|       <end extended="true"> | ||||
|         @end \%{js:keyword-end} | ||||
|       </end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
|         <context sub-pattern="0" where="end" style-ref="js:keyword"/> | ||||
| @@ -286,7 +306,9 @@ | ||||
|     <!-- # @import statement --> | ||||
|  | ||||
|     <context id="at-import-statements" style-ref="js:directive"> | ||||
|       <start>@import\%]</start> | ||||
|       <start extended="true"> | ||||
|         @import \%{js:keyword-end} | ||||
|       </start> | ||||
|       <include> | ||||
|         <context ref="js:embedded-lang-hooks"/> | ||||
|         <context ref="js:comments"/> | ||||
| @@ -310,8 +332,12 @@ | ||||
|     <!-- # @protocol declaration --> | ||||
|  | ||||
|     <context id="at-protocol-declarations"> | ||||
|       <start>@protocol\%]</start> | ||||
|       <end>@end\%]</end> | ||||
|       <start extended="true"> | ||||
|         @protocol \%{js:keyword-end} | ||||
|       </start> | ||||
|       <end extended="true"> | ||||
|         @end \%{js:keyword-end} | ||||
|       </end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
|         <context sub-pattern="0" where="end" style-ref="js:keyword"/> | ||||
| @@ -323,6 +349,7 @@ | ||||
|  | ||||
|             <context id="_at-protocol-at-keywords" style-ref="js:keyword"> | ||||
|               <prefix>@</prefix> | ||||
|               <suffix>\%{js:keyword-end}</suffix> | ||||
|               <keyword>optional</keyword> | ||||
|               <keyword>required</keyword> | ||||
|             </context> <!-- /_at-protocol-at-keywords --> | ||||
| @@ -343,7 +370,9 @@ | ||||
|     <!-- # @typedef statements --> | ||||
|  | ||||
|     <context id="at-typedef-statements"> | ||||
|       <start>@typedef\%]</start> | ||||
|       <start extended="true"> | ||||
|         @typedef \%{js:keyword-end} | ||||
|       </start> | ||||
|       <end>\%{js:identifier}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
| @@ -400,7 +429,7 @@ | ||||
|     <!-- ## Literals --> | ||||
|  | ||||
|     <define-regex id="_at-function-keyword" extended="true"> | ||||
|       (?: @ (?: deref | ref ) \%] ) | ||||
|       @ (?: deref | ref ) \%{js:keyword-end} | ||||
|     </define-regex> <!-- /_at-function-keyword --> | ||||
|  | ||||
|     <context id="_choice-at-function-keyword" style-ref="js:keyword" end-parent="true"> | ||||
| @@ -409,7 +438,9 @@ | ||||
|     </context> <!-- /_choice-at-function-keyword --> | ||||
|  | ||||
|     <context id="_choice-at-selector-literal" end-parent="true"> | ||||
|       <start>@selector\%]</start> | ||||
|       <start extended="true"> | ||||
|         @selector \%{js:keyword-end} | ||||
|       </start> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
|         <context ref="js:embedded-lang-hooks"/> | ||||
| @@ -460,7 +491,7 @@ | ||||
|         <context ref="js-lit:_array-literal-content" original="true"/> | ||||
|         <context ref="_message-parameter-data"/> | ||||
|       </include> | ||||
|     </context> | ||||
|     </context> <!-- /_array-literal-content --> | ||||
|  | ||||
|     <replace id="js-lit:_array-literal-content" ref="_array-literal-content"/> | ||||
|  | ||||
| @@ -482,17 +513,23 @@ | ||||
|       <include> | ||||
|  | ||||
|         <context id="_boolean-constants" style-ref="js:boolean"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>NO</keyword> | ||||
|           <keyword>YES</keyword> | ||||
|         </context> | ||||
|         </context> <!-- /_boolean-constants --> | ||||
|  | ||||
|         <context id="_null-constants" style-ref="js:null-value"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>nil</keyword> | ||||
|           <keyword>Nil</keyword> | ||||
|           <keyword>NULL</keyword> | ||||
|         </context> | ||||
|         </context> <!-- /_null-constants --> | ||||
|  | ||||
|         <context id="_math-constants" style-ref="js:built-in-value"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>E</keyword> | ||||
|           <keyword>LOG10E</keyword> | ||||
|           <keyword>LOG2E</keyword> | ||||
| @@ -503,9 +540,11 @@ | ||||
|           <keyword>PI_2</keyword> | ||||
|           <keyword>SQRT1_2</keyword> | ||||
|           <keyword>SQRT2</keyword> | ||||
|         </context> | ||||
|         </context> <!-- /_math-constants --> | ||||
|  | ||||
|         <context id="_math-functions" style-ref="js:built-in-function"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>ABS</keyword> | ||||
|           <keyword>ACOS</keyword> | ||||
|           <keyword>ASIN</keyword> | ||||
| @@ -524,13 +563,15 @@ | ||||
|           <keyword>SIN</keyword> | ||||
|           <keyword>SQRT</keyword> | ||||
|           <keyword>TAN</keyword> | ||||
|         </context> | ||||
|         </context> <!-- /_math-functions --> | ||||
|  | ||||
|         <!-- "super" is already highlighted by default --> | ||||
|         <context id="_object-keywords" style-ref="js:keyword"> | ||||
|           <prefix>\%{js:keyword-start}</prefix> | ||||
|           <suffix>\%{js:keyword-end}</suffix> | ||||
|           <keyword>_cmd</keyword> | ||||
|           <keyword>self</keyword> | ||||
|         </context> | ||||
|         </context> <!-- /_object-keywords --> | ||||
|  | ||||
|         <context ref="js-val:global-values" original="true"/> | ||||
|       </include> | ||||
|   | ||||
| @@ -267,6 +267,10 @@ | ||||
|       <keyword>print_r</keyword> | ||||
|       <keyword>serialize</keyword> | ||||
|       <keyword>settype</keyword> | ||||
|       <keyword>str_contains</keyword> | ||||
|       <keyword>str_replace</keyword> | ||||
|       <keyword>strip_tags</keyword> | ||||
|       <keyword>strpos</keyword> | ||||
|       <keyword>strval</keyword> | ||||
|       <keyword>unserialize</keyword> | ||||
|       <keyword>var_dump</keyword> | ||||
|   | ||||
| @@ -51,10 +51,10 @@ | ||||
|  | ||||
|   <definitions> | ||||
|     <!-- https://docs.python.org/3/reference/lexical_analysis.html#identifiers | ||||
|          Underscore ('LOW LINE' U+005F) is a member of \p{Pc}, and so included in def:unicode-id-continue | ||||
|          Underscore (U+005F LOW LINE) is a member of \p{Pc}, and so included in def:unicode-xid-continue | ||||
|     --> | ||||
|     <define-regex id="identifier" extended="true"> | ||||
|       (?> (?: _ | \%{def:unicode-id-start} ) \%{def:unicode-id-continue}* ) | ||||
|       (?> (?: _ | \%{def:unicode-xid-start} ) \%{def:unicode-xid-continue}* ) | ||||
|     </define-regex> | ||||
|     <define-regex id="number">[1-9][0-9]*</define-regex> | ||||
|  | ||||
|   | ||||
| @@ -602,7 +602,7 @@ | ||||
|         </context> | ||||
|  | ||||
|         <context style-ref="string" style-inside="true"> | ||||
|           <start>[%][QWx]?([^[:alnum:]{<[(])</start> | ||||
|           <start>[%][QWx]?([^[:alnum:]{}<>[]()])</start> | ||||
|           <end>\%{1@start}</end> | ||||
|           <include> | ||||
|             <context where="start" sub-pattern="0" style-ref="literal"/> | ||||
|   | ||||
| @@ -4,7 +4,7 @@ | ||||
|  This file is part of GtkSourceView | ||||
|  | ||||
|  Author: Jeffery To <jeffery.to@gmail.com> | ||||
|  Copyright (C) 2018-2019 Jeffery To <jeffery.to@gmail.com> | ||||
|  Copyright (C) 2018-2020 Jeffery To <jeffery.to@gmail.com> | ||||
|  | ||||
|  GtkSourceView is free software; you can redistribute it and/or | ||||
|  modify it under the terms of the GNU Lesser General Public | ||||
| @@ -58,7 +58,8 @@ | ||||
|  | ||||
|   <default-regex-options case-sensitive="false"/> | ||||
|  | ||||
|   <keyword-char-class>[a-z0-9_\x{80}-\x{10ffff}\\-]</keyword-char-class> | ||||
|   <!-- from css:keyword-code-point --> | ||||
|   <keyword-char-class>[^\x{0}-\x{2C}\x{2E}\x{2F}\x{3A}-\x{40}\x{5B}\x{5D}\x{5E}\x{60}\x{7B}-\x{7F}]</keyword-char-class> | ||||
|  | ||||
|   <definitions> | ||||
|  | ||||
| @@ -133,12 +134,10 @@ | ||||
|          a division operation --> | ||||
|     <context id="arithmetic-operator" style-ref="operator-symbol"> | ||||
|       <match extended="true"> | ||||
|         ( | ||||
|           [+*%] | | ||||
|           (?<! \%{css:single-identifier-char} ) | ||||
|           - | ||||
|           (?! \%{css:single-identifier-char} ) | ||||
|         ) | ||||
|         [+*%] | | ||||
|         (?<! \%{css:keyword-code-point} ) | ||||
|         - | ||||
|         (?! \%{css:keyword-code-point} ) | ||||
|       </match> | ||||
|     </context> | ||||
|  | ||||
| @@ -147,10 +146,12 @@ | ||||
|     </context> | ||||
|  | ||||
|     <context id="comparison-operator" style-ref="operator-symbol"> | ||||
|       <match>(<=?|>=?|[=!]=)</match> | ||||
|       <match><=?|>=?|[=!]=</match> | ||||
|     </context> | ||||
|  | ||||
|     <context id="logical-operator" style-ref="logical-operator"> | ||||
|       <prefix>\%{css:keyword-start}</prefix> | ||||
|       <suffix>\%{css:keyword-end}</suffix> | ||||
|       <keyword>and</keyword> | ||||
|       <keyword>not</keyword> | ||||
|       <keyword>or</keyword> | ||||
| @@ -160,11 +161,15 @@ | ||||
|     <!-- Sass data types --> | ||||
|  | ||||
|     <context id="boolean" style-ref="boolean"> | ||||
|       <prefix>\%{css:keyword-start}</prefix> | ||||
|       <suffix>\%{css:keyword-end}</suffix> | ||||
|       <keyword>false</keyword> | ||||
|       <keyword>true</keyword> | ||||
|     </context> | ||||
|  | ||||
|     <context id="null" style-ref="null"> | ||||
|       <prefix>\%{css:keyword-start}</prefix> | ||||
|       <suffix>\%{css:keyword-end}</suffix> | ||||
|       <keyword>null</keyword> | ||||
|     </context> | ||||
|  | ||||
| @@ -246,7 +251,9 @@ | ||||
|     </context> | ||||
|  | ||||
|     <context id="scss-url"> | ||||
|       <start>url\(</start> | ||||
|       <start extended="true"> | ||||
|         \%{css:keyword-start} url \( | ||||
|       </start> | ||||
|       <end>\)</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="css:function"/> | ||||
| @@ -344,11 +351,15 @@ | ||||
|     <!-- Sass modifiers --> | ||||
|  | ||||
|     <context id="variable-assignment-modifiers" style-ref="css:modifier"> | ||||
|       <prefix>\%{css:keyword-start}</prefix> | ||||
|       <suffix>\%{css:keyword-end}</suffix> | ||||
|       <keyword>default</keyword> | ||||
|       <keyword>global</keyword> | ||||
|     </context> | ||||
|  | ||||
|     <context id="at-extend-modifiers" style-ref="css:modifier"> | ||||
|       <prefix>\%{css:keyword-start}</prefix> | ||||
|       <suffix>\%{css:keyword-end}</suffix> | ||||
|       <keyword>optional</keyword> | ||||
|     </context> | ||||
|  | ||||
| @@ -522,13 +533,13 @@ | ||||
|  | ||||
|         : | ||||
|         (?: | ||||
|           (?!                                 # not the start of a | ||||
|             \%{css:single-identifier-char} |  #   pseudo-class | ||||
|             [:\\] |                           #   pseudo-element, escape | ||||
|             \#{ |                             #   interpolation | ||||
|             /\*                               #   comment | ||||
|           ) |                                 # or | ||||
|           (?=                                 # ends like a normal declaration | ||||
|           (?!                              # not the start of a | ||||
|             \%{css:keyword-code-point} |   #   pseudo-class | ||||
|             [:\\] |                        #   pseudo-element, escape | ||||
|             \#{ |                          #   interpolation | ||||
|             /\*                            #   comment | ||||
|           ) |                              # or | ||||
|           (?=                              # ends like a normal declaration | ||||
|             (?> | ||||
|               (?: | ||||
|                 (?> | ||||
| @@ -549,7 +560,7 @@ | ||||
|                 (?&single_quote_string) | ||||
|               )* | ||||
|             ) | ||||
|             \%{css:declaration-value-end}     #   with a semicolon or at the end of a block | ||||
|             \%{css:declaration-value-end}  #   with a semicolon or at the end of a block | ||||
|           ) | ||||
|         ) | ||||
|       </start> | ||||
| @@ -614,7 +625,9 @@ | ||||
|     --> | ||||
|  | ||||
|     <context id="at-extend"> | ||||
|       <start>@extend\%]</start> | ||||
|       <start extended="true"> | ||||
|         @extend \%{css:keyword-end} | ||||
|       </start> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="css:at-rule"/> | ||||
|         <context ref="css:embedded-lang-hook"/> | ||||
| @@ -630,11 +643,15 @@ | ||||
|     --> | ||||
|  | ||||
|     <context id="at-at-root-query-type" style-ref="css:property-name"> | ||||
|       <prefix>\%{css:keyword-start}</prefix> | ||||
|       <suffix>\%{css:keyword-end}</suffix> | ||||
|       <keyword>without</keyword> | ||||
|       <keyword>with</keyword> | ||||
|     </context> | ||||
|  | ||||
|     <context id="at-at-root-query-directive" style-ref="css:keyword"> | ||||
|       <prefix>\%{css:keyword-start}</prefix> | ||||
|       <suffix>\%{css:keyword-end}</suffix> | ||||
|       <keyword>all</keyword> | ||||
|       <keyword>media</keyword> | ||||
|       <keyword>rule</keyword> | ||||
| @@ -670,7 +687,9 @@ | ||||
|     </context> | ||||
|  | ||||
|     <context id="at-at-root"> | ||||
|       <start>@at-root\%]</start> | ||||
|       <start extended="true"> | ||||
|         @at-root \%{css:keyword-end} | ||||
|       </start> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="css:at-rule"/> | ||||
|         <context ref="css:embedded-lang-hook"/> | ||||
| @@ -688,7 +707,9 @@ | ||||
|     --> | ||||
|  | ||||
|     <context id="at-debug-warn-error"> | ||||
|       <start>@(debug|warn|error)\%]</start> | ||||
|       <start extended="true"> | ||||
|         @ (?: debug | warn | error ) \%{css:keyword-end} | ||||
|       </start> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="css:at-rule"/> | ||||
|         <context ref="css:embedded-lang-hook"/> | ||||
| @@ -705,7 +726,9 @@ | ||||
|     --> | ||||
|  | ||||
|     <context id="at-if-else-if"> | ||||
|       <start>@(if|else\s+if)\%]</start> | ||||
|       <start extended="true"> | ||||
|         @ (?: if | else \s+ if ) \%{css:keyword-end} | ||||
|       </start> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="css:at-rule"/> | ||||
|         <context ref="css:embedded-lang-hook"/> | ||||
| @@ -716,7 +739,9 @@ | ||||
|     </context> | ||||
|  | ||||
|     <context id="at-else"> | ||||
|       <start>@else\%]</start> | ||||
|       <start extended="true"> | ||||
|         @else \%{css:keyword-end} | ||||
|       </start> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="css:at-rule"/> | ||||
|         <context ref="css:embedded-lang-hook"/> | ||||
| @@ -730,13 +755,17 @@ | ||||
|     --> | ||||
|  | ||||
|     <context id="at-for-keyword" style-ref="css:at-rule-operator"> | ||||
|       <prefix>\%{css:keyword-start}</prefix> | ||||
|       <suffix>\%{css:keyword-end}</suffix> | ||||
|       <keyword>from</keyword> | ||||
|       <keyword>through</keyword> | ||||
|       <keyword>to</keyword> | ||||
|     </context> | ||||
|  | ||||
|     <context id="at-for"> | ||||
|       <start>@for\%]</start> | ||||
|       <start extended="true"> | ||||
|         @for \%{css:keyword-end} | ||||
|       </start> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="css:at-rule"/> | ||||
|         <context ref="css:embedded-lang-hook"/> | ||||
| @@ -753,11 +782,15 @@ | ||||
|     --> | ||||
|  | ||||
|     <context id="at-each-keyword" style-ref="css:at-rule-operator"> | ||||
|       <prefix>\%{css:keyword-start}</prefix> | ||||
|       <suffix>\%{css:keyword-end}</suffix> | ||||
|       <keyword>in</keyword> | ||||
|     </context> | ||||
|  | ||||
|     <context id="at-each"> | ||||
|       <start>@each\%]</start> | ||||
|       <start extended="true"> | ||||
|         @each \%{css:keyword-end} | ||||
|       </start> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="css:at-rule"/> | ||||
|         <context ref="css:embedded-lang-hook"/> | ||||
| @@ -775,7 +808,9 @@ | ||||
|     --> | ||||
|  | ||||
|     <context id="at-while"> | ||||
|       <start>@while\%]</start> | ||||
|       <start extended="true"> | ||||
|         @while \%{css:keyword-end} | ||||
|       </start> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="css:at-rule"/> | ||||
|         <context ref="css:embedded-lang-hook"/> | ||||
| @@ -802,7 +837,9 @@ | ||||
|     </context> | ||||
|  | ||||
|     <context id="at-mixin"> | ||||
|       <start>@mixin\%]</start> | ||||
|       <start extended="true"> | ||||
|         @mixin \%{css:keyword-end} | ||||
|       </start> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="css:at-rule"/> | ||||
|         <context ref="css:embedded-lang-hook"/> | ||||
| @@ -818,7 +855,9 @@ | ||||
|     --> | ||||
|  | ||||
|     <context id="at-include"> | ||||
|       <start>@include\%]</start> | ||||
|       <start extended="true"> | ||||
|         @include \%{css:keyword-end} | ||||
|       </start> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="css:at-rule"/> | ||||
|         <context ref="css:embedded-lang-hook"/> | ||||
| @@ -835,7 +874,9 @@ | ||||
|     --> | ||||
|  | ||||
|     <context id="at-content"> | ||||
|       <start>@content\%]</start> | ||||
|       <start extended="true"> | ||||
|         @content \%{css:keyword-end} | ||||
|       </start> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="css:at-rule"/> | ||||
|         <context ref="css:embedded-lang-hook"/> | ||||
| @@ -861,7 +902,9 @@ | ||||
|     </context> | ||||
|  | ||||
|     <context id="at-function"> | ||||
|       <start>@function\%]</start> | ||||
|       <start extended="true"> | ||||
|         @function \%{css:keyword-end} | ||||
|       </start> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="css:at-rule"/> | ||||
|         <context ref="css:embedded-lang-hook"/> | ||||
| @@ -879,7 +922,9 @@ | ||||
|     --> | ||||
|  | ||||
|     <context id="at-return"> | ||||
|       <start>@return\%]</start> | ||||
|       <start extended="true"> | ||||
|         @return \%{css:keyword-end} | ||||
|       </start> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="css:at-rule"/> | ||||
|         <context ref="css:embedded-lang-hook"/> | ||||
| @@ -954,8 +999,8 @@ | ||||
|     <context id="parent-combinator"> | ||||
|       <match>(&)(\%{css:identifier-chars}?)</match> | ||||
|       <include> | ||||
|         <context sub-pattern="1"  style-ref="css:combinator"/> | ||||
|         <context sub-pattern="2"  style-ref="selector-fragment"/> | ||||
|         <context sub-pattern="1" style-ref="css:combinator"/> | ||||
|         <context sub-pattern="2" style-ref="selector-fragment"/> | ||||
|       </include> | ||||
|     </context> | ||||
|  | ||||
|   | ||||
| @@ -95,7 +95,7 @@ | ||||
|       </include> | ||||
|     </context> | ||||
|  | ||||
|     <context id="command-substitution" style-ref="subshell"> | ||||
|     <context id="command-substitution" style-ref="subshell" class="no-spell-check"> | ||||
|       <start>\$\((?!\()</start> | ||||
|       <end>\)</end> | ||||
|       <include> | ||||
| @@ -202,7 +202,7 @@ | ||||
|       </include> | ||||
|     </context> | ||||
|  | ||||
|     <context id="arithmetic-expansion"> | ||||
|     <context id="arithmetic-expansion" class="no-spell-check"> | ||||
|       <start>\$\({2}(?!\()</start> | ||||
|       <end>\){2}</end> | ||||
|       <include> | ||||
| @@ -228,7 +228,7 @@ | ||||
|  | ||||
|     <!-- Treated separately, not including itself nor command-like contexts | ||||
|       (see https://gitlab.gnome.org/GNOME/gtksourceview/issues/94) --> | ||||
|     <context id="backtick-subshell" style-ref="subshell"> | ||||
|     <context id="backtick-subshell" style-ref="subshell" class="no-spell-check"> | ||||
|       <start>`</start> | ||||
|       <end>`</end> | ||||
|       <include> | ||||
| @@ -426,33 +426,32 @@ | ||||
|       </include> | ||||
|     </context> | ||||
|  | ||||
|     <context id="short-parameter-expansion" style-ref="variable"> | ||||
|     <context id="short-parameter-expansion" style-ref="variable" class="no-spell-check"> | ||||
|       <match>\$(\%{special-parameter}|\%{identifier})</match> | ||||
|     </context> | ||||
|  | ||||
|     <context id="parameter-expansion" style-ref="def:statement" style-inside="true"> | ||||
|     <context id="parameter-expansion" style-ref="def:statement" style-inside="true" class="no-spell-check"> | ||||
|       <start>\$\{(?=[!#]?\%{identifier}|\%{special-parameter})</start> | ||||
|       <end>\}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="variable"/> | ||||
|         <context sub-pattern="0" where="end" style-ref="variable"/> | ||||
|         <!-- The order of the two following contexts matters --> | ||||
|         <context id="array-variable" once-only="true"> | ||||
|           <start>([!#])?(\%{identifier})(\[)</start> | ||||
|           <end>\]</end> | ||||
|         <context id="parameter" once-only="true"> | ||||
|           <start>(?<=\$\{)([!#]?)(\%{identifier}|\%{special-parameter})</start> | ||||
|           <end>\%{def:always-match}</end> | ||||
|           <include> | ||||
|             <context sub-pattern="1" where="start" style-ref="keyword"/> | ||||
|             <context sub-pattern="2" where="start" style-ref="variable"/> | ||||
|             <context sub-pattern="3" where="start" style-ref="keyword"/> | ||||
|             <context sub-pattern="0" where="end" style-ref="keyword"/> | ||||
|             <context ref="expansion-nesting"/> | ||||
|             <context ref="expansion-precedence"/> | ||||
|           </include> | ||||
|         </context> | ||||
|         <context id="simple-variable" once-only="true" style-ref="variable"> | ||||
|           <match>([!#])?\%{identifier}|\%{special-parameter}</match> | ||||
|           <include> | ||||
|             <context sub-pattern="1" style-ref="keyword"/> | ||||
|             <context id="array-part" once-only="true"> | ||||
|               <start>\[</start> | ||||
|               <end>\]</end> | ||||
|               <include> | ||||
|                 <context sub-pattern="0" where="start" style-ref="keyword"/> | ||||
|                 <context sub-pattern="0" where="end" style-ref="keyword"/> | ||||
|                 <context ref="expansion-nesting"/> | ||||
|                 <context ref="expansion-precedence"/> | ||||
|               </include> | ||||
|             </context> | ||||
|           </include> | ||||
|         </context> | ||||
|         <!-- Must be included first, to ensure unescaped boundaries --> | ||||
| @@ -574,7 +573,7 @@ | ||||
|       </include> | ||||
|     </context> | ||||
|  | ||||
|     <context id="history-expansion-command"> | ||||
|     <context id="history-expansion-command" class="no-spell-check"> | ||||
|       <start extended="true"> | ||||
|         # Event Designator | ||||
|         ((?<!\\)!) (?: (!|\#|-?[1-9][0-9]*) | (\?)[^?]+(\?|$) | ||||
|   | ||||
| @@ -57,6 +57,26 @@ | ||||
|       <keyword>BFILE</keyword> | ||||
|       <keyword>BINARY_(FLOAT|DOUBLE)</keyword> | ||||
|     </context> | ||||
|      | ||||
|     <context id="psql-datatypes" style-ref="type"> | ||||
|       <keyword>BOOL</keyword> | ||||
|       <keyword>BYTEA</keyword> | ||||
|       <keyword>CITEXT</keyword> | ||||
|       <keyword>FLOAT8</keyword> | ||||
|       <keyword>FLOAT4</keyword> | ||||
|       <keyword>INT</keyword> | ||||
|       <keyword>INT2</keyword> | ||||
|       <keyword>INT4</keyword> | ||||
|       <keyword>INT8</keyword> | ||||
|       <keyword>SERIAL2</keyword> | ||||
|       <keyword>SERIAL4</keyword> | ||||
|       <keyword>SERIAL8</keyword> | ||||
|       <keyword>TEXT</keyword> | ||||
|       <keyword>TIMESTAMPTZ</keyword> | ||||
|       <keyword>TIMETZ</keyword> | ||||
|       <keyword>UUID</keyword> | ||||
|       <keyword>VARBIT</keyword> | ||||
|     </context> | ||||
|  | ||||
|     <context id="ansi-datatypes" style-ref="type"> | ||||
|       <!-- FIXME no \n in patterns! --> | ||||
| @@ -97,11 +117,12 @@ | ||||
|     </context> | ||||
|  | ||||
|     <context id="integer-literals" style-ref="decimal"> | ||||
|       <match>\b[0-9]+\b</match> | ||||
|       <match>\b[0-9]+(?![Ee][\+\-]?[0-9]*)\b</match> | ||||
|     </context> | ||||
|  | ||||
|     <context id="number-literals" style-ref="floating-point"> | ||||
|       <match>(\b[0-9]+(\.[0-9]+)?|\.[0-9]+)([Ee][\+-]?[0-9]+)?\b</match> | ||||
|       <!--match>(\b[0-9]+(\.[0-9]+)?|\.[0-9]+)([Ee][\+-]?[0-9]+)?\b</match--> | ||||
|       <match>(?<![\w\.])(([0-9]+\.[0-9]*|\.[0-9]+)([Ee][\+\-]?[0-9]*)?|([0-9]+[Ee][\+\-]?[0-9]*))(?![\w\.])</match> | ||||
|     </context> | ||||
|  | ||||
|     <context id="size-clause" style-ref="decimal"> | ||||
| @@ -356,8 +377,11 @@ | ||||
|       <keyword>ASC</keyword> | ||||
|       <keyword>BETWEEN</keyword> | ||||
|       <keyword>BY</keyword> | ||||
|       <keyword>CASCADE</keyword> | ||||
|       <keyword>CASCADED</keyword> | ||||
|       <keyword>CASE</keyword> | ||||
|       <keyword>CHECK</keyword> | ||||
|       <keyword>CONSTRAINT</keyword> | ||||
|       <keyword>CREATE</keyword> | ||||
|       <keyword>CROSS</keyword> | ||||
|       <keyword>CURRENT</keyword> | ||||
| @@ -370,6 +394,7 @@ | ||||
|       <keyword>END</keyword> | ||||
|       <keyword>FLOAT</keyword> | ||||
|       <keyword>FOR</keyword> | ||||
|       <keyword>FOREIGN[ \t]KEY</keyword> | ||||
|       <keyword>FROM</keyword> | ||||
|       <keyword>FULL</keyword> | ||||
|       <keyword>GRANT</keyword> | ||||
| @@ -387,17 +412,23 @@ | ||||
|       <keyword>LEFT</keyword> | ||||
|       <keyword>LEVEL</keyword> | ||||
|       <keyword>LIKE</keyword> | ||||
|       <keyword>LIMIT</keyword> | ||||
|       <keyword>LOOP</keyword> | ||||
|       <keyword>NATURAL</keyword> | ||||
|       <keyword>NOT</keyword> | ||||
|       <keyword>OF</keyword> | ||||
|       <keyword>OFFSET</keyword> | ||||
|       <keyword>ON</keyword> | ||||
|       <keyword>OPTION</keyword> | ||||
|       <keyword>ORDER</keyword> | ||||
|       <keyword>OR</keyword> | ||||
|       <keyword>OUTER</keyword> | ||||
|       <keyword>PRIMARY[ \t]KEY</keyword> | ||||
|       <keyword>PRIOR</keyword> | ||||
|       <keyword>PRIVILEGES</keyword> | ||||
|       <keyword>PUBLIC</keyword> | ||||
|       <keyword>REFERENCES</keyword> | ||||
|       <keyword>REVERSE</keyword> | ||||
|       <keyword>REVOKE</keyword> | ||||
|       <keyword>RIGHT</keyword> | ||||
|       <keyword>ROWS</keyword> | ||||
| @@ -463,6 +494,29 @@ | ||||
|       <keyword>WHERE</keyword> | ||||
|     </context> | ||||
|  | ||||
|     <context id="psql-reserved-words" style-ref="keyword"> | ||||
|       <keyword>BEGIN</keyword> | ||||
|       <keyword>DOMAIN</keyword> | ||||
|       <keyword>FUNCTION</keyword> | ||||
|       <keyword>GENERATED</keyword> | ||||
|       <keyword>IDENTITY</keyword> | ||||
|       <keyword>LANGUAGE</keyword> | ||||
|       <keyword>RETURNING</keyword> | ||||
|       <keyword>RETURNS</keyword> | ||||
|     </context> | ||||
|  | ||||
|     <context id="plpgsql-reserved-words" style-ref="keyword"> | ||||
|       <keyword>ARRAY</keyword> | ||||
|       <keyword>DECLARE</keyword> | ||||
|       <keyword>ERRCODE</keyword> | ||||
|       <keyword>EXCEPTION</keyword> | ||||
|       <keyword>HINT</keyword> | ||||
|       <keyword>IF</keyword> | ||||
|       <keyword>NOTICE</keyword> | ||||
|       <keyword>RAISE</keyword> | ||||
|       <keyword>RETURN</keyword> | ||||
|     </context> | ||||
|  | ||||
|     <context id="sql-statements" style-ref="keyword"> | ||||
|       <prefix>^[ \t]*</prefix> | ||||
|       <keyword>ALTER[ \t]+(CLUSTER|DATABASE|DIMENSION|DISKGROUP|FUNCTION|INDEX(TYPE)?|JAVA|MATERIALIZED[ \t]+VIEW([ \t]+LOG)?|OPERATOR|OUTLINE|PACKAGE|PROCEDURE|PROFILE|RESOURCE[ \t]+COST|ROLE|ROLLBACK[ \t]+SEGMENT|SEQUENCE|SESSION|SYSTEM|TABLE(SPACE)?|TRIGGER|TYPE|USER|VIEW)</keyword> | ||||
| @@ -470,7 +524,7 @@ | ||||
|       <keyword>(DIS)?ASSOCIATE[ \t]+STATISTICS</keyword> | ||||
|       <keyword>CALL</keyword> | ||||
|       <keyword>COMMIT([ \t]+WORK)?</keyword> | ||||
|       <keyword>CREATE[ \t]+(CLUSTER|CONTEXT|CONTROLFILE|DATABASE([ \t]+LINK)?|DIMENSION|DIRECTORY|DISKGROUP|FUNCTION|INDEX(TYPE)?|JAVA|LIBRARY|MATERIALIZED[ \t]+VIEW([ \t]+LOG)?|OPERATOR|OUTLINE|PACKAGE([ \t]+BODY)?|S?PFILE|PROCEDURE|PROFILE|RESTORE[ \t]+POINT|ROLE|ROLLBACK[ \t]+SEGMENT|SCHEMA|SEQUENCE|SYNONYM|TABLE(SPACE)?|TRIGGER|TYPE([ \t]+BODY)?|USER|VIEW)</keyword> | ||||
|       <keyword>CREATE[ \t]+(CLUSTER|CONTEXT|CONTROLFILE|DATABASE([ \t]+LINK)?|DIMENSION|DIRECTORY|DISKGROUP|DOMAIN|(OR[ \t]+REPLACE[ \t]+)?FUNCTION|INDEX(TYPE)?|JAVA|LIBRARY|MATERIALIZED[ \t]+VIEW([ \t]+LOG)?|OPERATOR|OUTLINE|PACKAGE([ \t]+BODY)?|S?PFILE|PROCEDURE|PROFILE|RESTORE[ \t]+POINT|ROLE|ROLLBACK[ \t]+SEGMENT|SCHEMA|SEQUENCE|SYNONYM|TABLE(SPACE)?|TRIGGER|TYPE([ \t]+BODY)?|USER|VIEW)</keyword> | ||||
|       <keyword>DROP[ \t]+(CLUSTER|CONTEXT|DATABASE([ \t]+LINK)?|DIMENSION|DIRECTORY|DISKGROUP|FUNCTION|INDEX(TYPE)?|JAVA|LIBRARY|MATERIALIZED[ \t]+VIEW([ \t]+LOG)?|OPERATOR|OUTLINE|PACKAGE|PROCEDURE|PROFILE|RESTORE[ \t]+POINT|ROLE|ROLLBACK[ \t]+SEGMENT|SEQUENCE|SYNONYM|TABLE(SPACE)?|TRIGGER|TYPE([ \t]+BODY)?|USER|VIEW)</keyword> | ||||
|       <keyword>EXPLAIN[ \t]+PLAN</keyword> | ||||
|       <keyword>FLASHBACK[ \t]+(DATABASE|TABLE)</keyword> | ||||
| @@ -574,15 +628,17 @@ | ||||
|         <context ref="ansi-datatypes"/> | ||||
|         <context ref="sql-ds-and-db2-datatypes"/> | ||||
|         <context ref="oracle-supplied-types"/> | ||||
|         <context ref="psql-datatypes"/> | ||||
|         <context ref="text-literals"/> | ||||
|         <context ref="integer-literals"/> | ||||
|         <context ref="number-literals"/> | ||||
|         <context ref="integer-literals"/> | ||||
|         <context ref="size-clause"/> | ||||
|         <context ref="unlimited"/> | ||||
|         <context ref="null"/> | ||||
|         <context ref="block-comment"/> | ||||
|         <context ref="line-comment"/> | ||||
|         <context ref="numeric-functions"/> | ||||
|         <context ref="sql-statements"/> | ||||
|         <context ref="character-functions-returning-character-values"/> | ||||
|         <context ref="nls-character-functions"/> | ||||
|         <context ref="character-functions-returning-number-values"/> | ||||
| @@ -603,7 +659,8 @@ | ||||
|         <context ref="model-functions"/> | ||||
|         <context ref="ansi-reserved-words"/> | ||||
|         <context ref="oracle-reserved-words"/> | ||||
|         <context ref="sql-statements"/> | ||||
|         <context ref="psql-reserved-words"/> | ||||
|         <context ref="plpgsql-reserved-words"/> | ||||
|         <context ref="operators"/> | ||||
|         <context ref="conditions"/> | ||||
|         <context ref="sql-plus-at-sign"/> | ||||
|   | ||||
| @@ -4,7 +4,7 @@ | ||||
|  This file is part of GtkSourceView | ||||
|  | ||||
|  Author: Jeffery To <jeffery.to@gmail.com> | ||||
|  Copyright (C) 2019 Jeffery To <jeffery.to@gmail.com> | ||||
|  Copyright (C) 2019-2020 Jeffery To <jeffery.to@gmail.com> | ||||
|  | ||||
|  GtkSourceView is free software; you can redistribute it and/or | ||||
|  modify it under the terms of the GNU Lesser General Public | ||||
| @@ -22,7 +22,7 @@ | ||||
| --> | ||||
| <language id="typescript-js-expr" name="TypeScript JavaScript Expression Additions" version="2.0" _section="Script" hidden="true"> | ||||
|   <!-- from js:identifier-char --> | ||||
|   <keyword-char-class>[\p{L}\p{Nl}\x{1885}-\x{1886}\x{2118}\x{212E}\x{309B}-\x{309C}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{00B7}\x{0387}\x{1369}-\x{1371}\x{19DA}$\x{200C}\x{200D}]</keyword-char-class> | ||||
|   <keyword-char-class>(?!\x{2E2F})[\p{L}\p{Nl}\x{1885}-\x{1886}\x{2118}\x{212E}\x{309B}-\x{309C}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{00B7}\x{0387}\x{1369}-\x{1371}\x{19DA}$\x{200C}\x{200D}]</keyword-char-class> | ||||
|  | ||||
|   <definitions> | ||||
|  | ||||
| @@ -97,7 +97,7 @@ | ||||
|     --> | ||||
|  | ||||
|     <context id="_non-null-assertion-operators" style-ref="typescript:non-null-assertion-operator"> | ||||
|       <match>!</match> | ||||
|       <match>!(?!=)</match> | ||||
|     </context> <!-- /_non-null-assertion-operators --> | ||||
|  | ||||
|  | ||||
| @@ -140,6 +140,22 @@ | ||||
|  | ||||
|     <!-- # Post-primary expression --> | ||||
|  | ||||
|     <!-- replaces js-expr:_dot-property-accessor-content --> | ||||
|     <context id="dot-property-accessor-content"> | ||||
|       <include> | ||||
|         <context ref="typescript:choice-private-identifier"/> | ||||
|         <context ref="js-expr:_dot-property-accessor-content" original="true"/> | ||||
|       </include> | ||||
|     </context> <!-- /dot-property-accessor-content --> | ||||
|  | ||||
|     <!-- replaces js-expr:_optional-chain-content --> | ||||
|     <context id="optional-chain-content"> | ||||
|       <include> | ||||
|         <context ref="typescript:choice-private-identifier"/> | ||||
|         <context ref="js-expr:_optional-chain-content" original="true"/> | ||||
|       </include> | ||||
|     </context> <!-- /optional-chain-content --> | ||||
|  | ||||
|     <!-- replaces js-expr:_post-primary-expression --> | ||||
|     <context id="post-primary-expression"> | ||||
|       <include> | ||||
| @@ -167,7 +183,7 @@ | ||||
|     --> | ||||
|  | ||||
|     <context id="_as-operators"> | ||||
|       <start>\%[as\%]</start> | ||||
|       <start>\%{js:as-keyword}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="typescript:type-keyword"/> | ||||
|   | ||||
| @@ -4,7 +4,7 @@ | ||||
|  This file is part of GtkSourceView | ||||
|  | ||||
|  Author: Jeffery To <jeffery.to@gmail.com> | ||||
|  Copyright (C) 2019 Jeffery To <jeffery.to@gmail.com> | ||||
|  Copyright (C) 2019-2020 Jeffery To <jeffery.to@gmail.com> | ||||
|  | ||||
|  GtkSourceView is free software; you can redistribute it and/or | ||||
|  modify it under the terms of the GNU Lesser General Public | ||||
| @@ -22,7 +22,7 @@ | ||||
| --> | ||||
| <language id="typescript-js-fn" name="TypeScript JavaScript Function and Class Additions" version="2.0" _section="Script" hidden="true"> | ||||
|   <!-- from js:identifier-char --> | ||||
|   <keyword-char-class>[\p{L}\p{Nl}\x{1885}-\x{1886}\x{2118}\x{212E}\x{309B}-\x{309C}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{00B7}\x{0387}\x{1369}-\x{1371}\x{19DA}$\x{200C}\x{200D}]</keyword-char-class> | ||||
|   <keyword-char-class>(?!\x{2E2F})[\p{L}\p{Nl}\x{1885}-\x{1886}\x{2118}\x{212E}\x{309B}-\x{309C}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{00B7}\x{0387}\x{1369}-\x{1371}\x{19DA}$\x{200C}\x{200D}]</keyword-char-class> | ||||
|  | ||||
|   <definitions> | ||||
|  | ||||
| @@ -34,9 +34,11 @@ | ||||
|     <!-- # Accessibility modifier --> | ||||
|  | ||||
|     <context id="_accessibility-modifier" style-ref="js:keyword" once-only="true"> | ||||
|       <keyword>private</keyword> | ||||
|       <keyword>protected</keyword> | ||||
|       <keyword>public</keyword> | ||||
|       <match extended="true"> | ||||
|         \%{typescript:private-keyword} | | ||||
|         \%{typescript:protected-keyword} | | ||||
|         \%{typescript:public-keyword} | ||||
|       </match> | ||||
|     </context> <!-- /_accessibility-modifier --> | ||||
|  | ||||
|     <context id="_ordered-accessibility-modifier" once-only="true"> | ||||
| @@ -48,19 +50,29 @@ | ||||
|     </context> <!-- /_ordered-accessibility-modifier --> | ||||
|  | ||||
|  | ||||
|     <!-- # Read-only property modifier --> | ||||
|  | ||||
|     <context id="_read-only-property-modifier" style-ref="js:keyword" once-only="true"> | ||||
|       <match>\%{typescript:readonly-keyword}</match> | ||||
|     </context> <!-- /_read-only-property-modifier --> | ||||
|  | ||||
|     <context id="_ordered-read-only-property-modifier" once-only="true"> | ||||
|       <start>\%{js:before-next-token}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context ref="_read-only-property-modifier"/> | ||||
|       </include> | ||||
|     </context> <!-- /_ordered-read-only-property-modifier --> | ||||
|  | ||||
|  | ||||
|     <!-- # Function expression --> | ||||
|  | ||||
|     <!-- <CallSignature> / <ParameterList> --> | ||||
|     <!-- replaces js-fn:_function-parameters-content --> | ||||
|     <context id="function-parameters-content"> | ||||
|       <include> | ||||
|         <!-- decorators are valid for class declaration methods only --> | ||||
|         <context ref="typescript:ordered-decorators"/> | ||||
|         <!-- accessibility modifiers are valid for class | ||||
|              expression/declaration constructors only --> | ||||
|         <context ref="_ordered-accessibility-modifier"/> | ||||
|         <context ref="js:ordered-rest-syntax"/> | ||||
|         <context ref="js:ordered-assignment-target"/> | ||||
|         <context ref="js:ordered-binding"/> | ||||
|         <context ref="typescript:ordered-optional-modifier"/> | ||||
|         <context ref="typescript:ordered-type-annotation"/> | ||||
|         <context ref="js:ordered-default-value-assignment"/> | ||||
| @@ -72,20 +84,12 @@ | ||||
|       <start>\%{js:before-next-token}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context ref="js:embedded-lang-hooks"/> | ||||
|         <context ref="js:comments"/> | ||||
|  | ||||
|         <context id="_function-first-parameter-content"> | ||||
|           <include> | ||||
|             <!-- decorators are valid for class declaration methods only --> | ||||
|             <context ref="typescript:ordered-decorators"/> | ||||
|             <!-- accessibility modifiers are valid for class | ||||
|                  expression/declaration constructors only --> | ||||
|             <context ref="_ordered-accessibility-modifier"/> | ||||
|             <context ref="js:ordered-rest-syntax"/> | ||||
|             <!-- this parameters are valid for class | ||||
|                  expression/declaration methods only --> | ||||
|             <context ref="typescript:ordered-this-parameter-or-assignment-target"/> | ||||
|             <context ref="typescript:ordered-this-parameter-or-binding"/> | ||||
|             <context ref="typescript:ordered-optional-modifier"/> | ||||
|             <context ref="typescript:ordered-type-annotation"/> | ||||
|             <context ref="js:ordered-default-value-assignment"/> | ||||
| @@ -115,63 +119,32 @@ | ||||
|  | ||||
|     <!-- # Method definition --> | ||||
|  | ||||
|     <!-- ensure type annotation for functions: | ||||
|            method(): 'type' { ... } | ||||
|          doesn't conflict with object literal property value: | ||||
|            property: 'value' | ||||
|     --> | ||||
|  | ||||
|     <context id="_function-parameters-list-and-type-annotation" once-only="true"> | ||||
|       <start>(?=\()</start> | ||||
|     <!-- replaces js-fn:choice-method-definition --> | ||||
|     <context id="choice-method-definition" style-ref="js:function-expression" end-parent="true"> | ||||
|       <start>(?=[<(])</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context ref="js:comments"/> | ||||
|  | ||||
|         <context id="_function-parameters-list-and-type-annotation-content"> | ||||
|         <context id="_method-definition-content"> | ||||
|           <include> | ||||
|             <context ref="js-fn:_ordered-function-parameters-list" style-ref="js:function-expression"/> | ||||
|             <context ref="typescript-type-gen:ordered-type-parameters-list"/> | ||||
|             <context ref="js-fn:_ordered-function-parameters-list"/> | ||||
|             <context ref="typescript:ordered-type-annotation"/> | ||||
|             <context ref="js-fn:_last-function-body"/> | ||||
|           </include> | ||||
|         </context> <!-- /_function-parameters-list-and-type-annotation-content --> | ||||
|         </context> <!-- /_method-definition-content --> | ||||
|  | ||||
|       </include> | ||||
|     </context> <!-- /_function-parameters-list-and-type-annotation --> | ||||
|  | ||||
|     <context id="_ordered-function-parameters-list-and-type-annotation" once-only="true"> | ||||
|       <start>\%{js:before-next-token}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context ref="_function-parameters-list-and-type-annotation"/> | ||||
|       </include> | ||||
|     </context> <!-- /_ordered-function-parameters-list-and-type-annotation --> | ||||
|  | ||||
|     <!-- replaces js-fn:_method-definition-content --> | ||||
|     <context id="method-definition-content"> | ||||
|       <include> | ||||
|         <context ref="js-fn:_ordered-method-definition-modifier"/> | ||||
|         <context ref="js:ordered-generator-modifier"/> | ||||
|         <context ref="js-lit:ordered-property-name"/> | ||||
|         <!-- technically, only class members can be marked as optional, | ||||
|              not object members --> | ||||
|         <context ref="typescript:ordered-optional-modifier"/> | ||||
|         <!-- technically, only class properties can be marked as | ||||
|              definitely assigned, not object members --> | ||||
|         <!-- also, optional modifier and definitely assignment | ||||
|              assertion cannot both be specified --> | ||||
|         <context ref="typescript:ordered-definite-assignment-assertion"/> | ||||
|         <context ref="typescript-type-gen:ordered-type-parameters-list"/> | ||||
|         <context ref="_ordered-function-parameters-list-and-type-annotation"/> | ||||
|         <context ref="js-fn:_last-function-body" style-ref="js:function-expression"/> | ||||
|       </include> | ||||
|     </context> <!-- /method-definition-content --> | ||||
|     </context> <!-- /choice-method-definition --> | ||||
|  | ||||
|  | ||||
|     <!-- # Class expression --> | ||||
|  | ||||
|     <!-- ## Class expression keyword --> | ||||
|  | ||||
|     <context id="_class-expression-abstract-keyword" style-ref="js:keyword"> | ||||
|       <keyword>abstract</keyword> | ||||
|     <context id="_class-expression-abstract-keyword" style-ref="js:keyword" once-only="true"> | ||||
|       <match>\%{typescript:abstract-keyword}</match> | ||||
|     </context> <!-- /_class-expression-abstract-keyword --> | ||||
|  | ||||
|     <context id="_ordered-class-expression-abstract-keyword" once-only="true"> | ||||
| @@ -182,8 +155,8 @@ | ||||
|       </include> | ||||
|     </context> <!-- /_ordered-class-expression-abstract-keyword --> | ||||
|  | ||||
|     <context id="_class-expression-class-keyword" style-ref="js:keyword"> | ||||
|       <keyword>class</keyword> | ||||
|     <context id="_class-expression-class-keyword" style-ref="js:keyword" once-only="true"> | ||||
|       <match>\%{js:class-keyword}</match> | ||||
|     </context> <!-- /_class-expression-class-keyword --> | ||||
|  | ||||
|     <context id="_ordered-class-expression-class-keyword" once-only="true"> | ||||
| @@ -201,7 +174,7 @@ | ||||
|       <include> | ||||
|  | ||||
|         <context id="_choice-class-optional-name-ignore-implements" end-parent="true"> | ||||
|           <start>(?=\%[implements\%])</start> | ||||
|           <start>(?=\%{typescript:implements-keyword})</start> | ||||
|           <end>\%{def:always-match}</end> | ||||
|         </context> <!-- /_choice-class-optional-name-ignore-implements --> | ||||
|  | ||||
| @@ -222,7 +195,7 @@ | ||||
|     <!-- ## Class implements clause --> | ||||
|  | ||||
|     <context id="_class-implements-clause" once-only="true"> | ||||
|       <start>\%[implements\%]</start> | ||||
|       <start>\%{typescript:implements-keyword}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="typescript:type-keyword"/> | ||||
| @@ -247,25 +220,10 @@ | ||||
|  | ||||
|     <!-- ## Class body --> | ||||
|  | ||||
|     <context id="_class-body-member-modifier" once-only="true"> | ||||
|       <start>\%{js:before-next-token}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context ref="js:comments"/> | ||||
|  | ||||
|         <context id="_class-body-member-modifier-content"> | ||||
|           <include> | ||||
|  | ||||
|             <context id="_class-body-member-modifier-keywords" style-ref="js:keyword"> | ||||
|               <keyword>abstract</keyword> | ||||
|               <keyword>declare</keyword> | ||||
|               <keyword>readonly</keyword> | ||||
|             </context> <!-- /_class-body-member-modifier-keywords --> | ||||
|  | ||||
|           </include> | ||||
|         </context> <!-- /_class-body-member-modifier-content --> | ||||
|  | ||||
|       </include> | ||||
|     <context id="_class-body-member-modifier" style-ref="js:keyword" once-only="true"> | ||||
|       <match extended="true"> | ||||
|         \%{typescript:abstract-keyword} | \%{js:static-keyword} | ||||
|       </match> | ||||
|     </context> <!-- /_class-body-member-modifier --> | ||||
|  | ||||
|     <context id="_ordered-class-body-member-modifier" once-only="true"> | ||||
| @@ -276,6 +234,10 @@ | ||||
|       </include> | ||||
|     </context> <!-- /_ordered-class-body-member-modifier --> | ||||
|  | ||||
|     <context id="_class-body-declare-property-modifier" style-ref="js:keyword" once-only="true"> | ||||
|       <match>\%{typescript:declare-keyword}</match> | ||||
|     </context> <!-- /_class-body-declare-property-modifier --> | ||||
|  | ||||
|     <context id="_choice-class-body-index-member" end-parent="true"> | ||||
|       <start>(?=\[)</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
| @@ -292,36 +254,283 @@ | ||||
|       </include> | ||||
|     </context> <!-- /_choice-class-body-index-member --> | ||||
|  | ||||
|     <context id="_choice-class-body-property-or-method-member" end-parent="true"> | ||||
|     <context id="_choice-class-body-private-field" end-parent="true"> | ||||
|       <start>(?=#\%{js:identifier-start})</start> | ||||
|       <end>;</end> | ||||
|       <include> | ||||
|         <context ref="js:comments"/> | ||||
|  | ||||
|         <context id="_class-body-private-field-content"> | ||||
|           <include> | ||||
|             <context ref="typescript:ordered-private-identifier"/> | ||||
|             <context ref="typescript:ordered-optional-modifier"/> | ||||
|             <context ref="typescript:ordered-definite-assignment-assertion"/> | ||||
|             <context ref="typescript:ordered-type-annotation"/> | ||||
|             <context ref="js:ordered-default-value-assignment"/> | ||||
|           </include> | ||||
|         </context> <!-- /_class-body-private-field-content --> | ||||
|  | ||||
|       </include> | ||||
|     </context> <!-- /_choice-class-body-private-field --> | ||||
|  | ||||
|     <context id="_class-body-method-parameters-list" once-only="true"> | ||||
|       <start>\(</start> | ||||
|       <end>\)</end> | ||||
|       <include> | ||||
|         <context ref="js:comments"/> | ||||
|  | ||||
|         <context id="_class-body-method-parameters-list-content"> | ||||
|           <include> | ||||
|  | ||||
|             <context id="_class-body-method-first-parameter" once-only="true"> | ||||
|               <start>\%{js:before-next-token}</start> | ||||
|               <end>\%{js:before-next-token}</end> | ||||
|               <include> | ||||
|                 <context ref="js:comments"/> | ||||
|  | ||||
|                 <context id="_class-body-method-first-parameter-content"> | ||||
|                   <include> | ||||
|                     <!-- decorators are valid for class declaration | ||||
|                          methods only (not class expressions) --> | ||||
|                     <context ref="typescript:ordered-decorators"/> | ||||
|                     <context ref="_function-first-parameter-content"/> | ||||
|                   </include> | ||||
|                 </context> <!-- /_class-body-method-first-parameter-content --> | ||||
|  | ||||
|               </include> | ||||
|             </context> <!-- /_class-body-method-first-parameter --> | ||||
|  | ||||
|             <context id="_class-body-method-parameters"> | ||||
|               <start>,</start> | ||||
|               <end>\%{js:before-next-token}</end> | ||||
|               <include> | ||||
|                 <context ref="js:comments"/> | ||||
|  | ||||
|                 <context id="_class-body-method-parameters-content"> | ||||
|                   <include> | ||||
|                     <!-- decorators are valid for class declaration | ||||
|                          methods only (not class expressions) --> | ||||
|                     <context ref="typescript:ordered-decorators"/> | ||||
|                     <context ref="function-parameters-content"/> | ||||
|                   </include> | ||||
|                 </context> <!-- /_class-body-method-parameters-content --> | ||||
|  | ||||
|               </include> | ||||
|             </context> <!-- /_class-body-method-parameters --> | ||||
|  | ||||
|           </include> | ||||
|         </context> <!-- /_class-body-method-parameters-list-content --> | ||||
|  | ||||
|       </include> | ||||
|     </context> <!-- /_class-body-method-parameters-list --> | ||||
|  | ||||
|     <context id="_ordered-class-body-method-parameters-list" once-only="true"> | ||||
|       <start>\%{js:before-next-token}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context ref="_class-body-method-parameters-list"/> | ||||
|       </include> | ||||
|     </context> <!-- /_ordered-class-body-method-parameters-list --> | ||||
|  | ||||
|     <context id="_choice-class-body-method-definition" style-ref="js:function-expression" end-parent="true"> | ||||
|       <start>(?=[<(])</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context ref="js:comments"/> | ||||
|  | ||||
|         <context id="_class-body-property-or-method-member-content"> | ||||
|         <context id="_class-body-method-definition-content"> | ||||
|           <include> | ||||
|             <context ref="js-fn:ordered-method-definition"/> | ||||
|             <!-- method-definition has a type-annotation, but it is tied | ||||
|                  to function-parameters-list --> | ||||
|             <context ref="typescript-type-gen:ordered-type-parameters-list"/> | ||||
|             <context ref="_ordered-class-body-method-parameters-list"/> | ||||
|             <context ref="typescript:ordered-type-annotation"/> | ||||
|             <context ref="js-fn:_last-function-body"/> | ||||
|           </include> | ||||
|         </context> <!-- /_class-body-method-definition-content --> | ||||
|  | ||||
|       </include> | ||||
|     </context> <!-- /_choice-class-body-method-definition --> | ||||
|  | ||||
|     <context id="_choice-class-body-method-keyword-method-definition" style-ref="js:function-expression" end-parent="true"> | ||||
|       <start>\%{js:method-keyword}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
|         <context ref="js:comments"/> | ||||
|  | ||||
|         <context id="_class-body-method-keyword-method-definition-content"> | ||||
|           <include> | ||||
|             <context ref="js:ordered-generator-modifier"/> | ||||
|             <context ref="js-lit:ordered-property-name"/> | ||||
|             <context ref="_choice-class-body-method-definition"/> | ||||
|           </include> | ||||
|         </context> <!-- /_class-body-method-keyword-method-definition-content --> | ||||
|  | ||||
|       </include> | ||||
|     </context> <!-- /choice-class-body-method-keyword-method-definition --> | ||||
|  | ||||
|     <context id="_choice-class-body-keyword-named-property-or-method" end-parent="true"> | ||||
|       <start extended="true"> | ||||
|         (?: | ||||
|           \%{js:get-keyword} | | ||||
|           \%{js:set-keyword} | | ||||
|           \%{js:static-keyword} | | ||||
|           \%{typescript:abstract-keyword} | | ||||
|           \%{typescript:declare-keyword} | | ||||
|           \%{typescript:private-keyword} | | ||||
|           \%{typescript:protected-keyword} | | ||||
|           \%{typescript:public-keyword} | | ||||
|           \%{typescript:readonly-keyword} | ||||
|         ) | ||||
|         (?= \%{js:optional-whitespace-or-comments} [;?!:=<(] ) | ||||
|       </start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:identifier"/> | ||||
|         <context ref="js:comments"/> | ||||
|  | ||||
|         <context id="_class-body-keyword-named-property-or-method-content"> | ||||
|           <include> | ||||
|             <!-- for class properties and methods --> | ||||
|             <context ref="typescript:ordered-optional-modifier"/> | ||||
|             <!-- for class properties only --> | ||||
|             <context ref="typescript:ordered-definite-assignment-assertion"/> | ||||
|             <!-- optional modifier and definitely assignment assertion | ||||
|                  cannot both be specified --> | ||||
|  | ||||
|             <context ref="_choice-class-body-method-definition"/> | ||||
|  | ||||
|             <context ref="typescript:ordered-type-annotation"/> | ||||
|             <context ref="js:ordered-default-value-assignment"/> | ||||
|           </include> | ||||
|         </context> <!-- /_class-body-property-or-method-member-content --> | ||||
|         </context> <!-- /_class-body-keyword-named-property-or-method-content --> | ||||
|  | ||||
|       </include> | ||||
|     </context> <!-- /_choice-class-body-property-or-method-member --> | ||||
|     </context> <!-- /_choice-class-body-keyword-named-property-or-method --> | ||||
|  | ||||
|     <context id="_class-body-constructor-parameters-content"> | ||||
|       <include> | ||||
|         <!-- decorators are valid for class declaration | ||||
|              methods only (not class expressions) --> | ||||
|         <context ref="typescript:ordered-decorators"/> | ||||
|         <context ref="_ordered-accessibility-modifier"/> | ||||
|         <context ref="_ordered-read-only-property-modifier"/> | ||||
|         <context ref="function-parameters-content"/> | ||||
|       </include> | ||||
|     </context> <!-- /_class-body-constructor-parameters-content --> | ||||
|  | ||||
|     <context id="_class-body-constructor-parameters-list" once-only="true"> | ||||
|       <start>\(</start> | ||||
|       <end>\)</end> | ||||
|       <include> | ||||
|         <context ref="js:comments"/> | ||||
|  | ||||
|         <context id="_class-body-constructor-parameters-list-content"> | ||||
|           <include> | ||||
|  | ||||
|             <context id="_class-body-constructor-first-parameter" once-only="true"> | ||||
|               <start>\%{js:before-next-token}</start> | ||||
|               <end>\%{js:before-next-token}</end> | ||||
|               <include> | ||||
|                 <context ref="js:comments"/> | ||||
|                 <!-- constructors cannot have a "this" parameter --> | ||||
|                 <context ref="_class-body-constructor-parameters-content"/> | ||||
|               </include> | ||||
|             </context> <!-- /_class-body-constructor-first-parameter --> | ||||
|  | ||||
|             <context id="_class-body-constructor-parameters"> | ||||
|               <start>,</start> | ||||
|               <end>\%{js:before-next-token}</end> | ||||
|               <include> | ||||
|                 <context ref="js:comments"/> | ||||
|                 <context ref="_class-body-constructor-parameters-content"/> | ||||
|               </include> | ||||
|             </context> <!-- /_class-body-constructor-parameters --> | ||||
|  | ||||
|           </include> | ||||
|         </context> <!-- /_class-body-constructor-parameters-list-content --> | ||||
|  | ||||
|       </include> | ||||
|     </context> <!-- /_class-body-constructor-parameters-list --> | ||||
|  | ||||
|     <context id="_ordered-class-body-constructor-parameters-list" once-only="true"> | ||||
|       <start>\%{js:before-next-token}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context ref="_class-body-constructor-parameters-list"/> | ||||
|       </include> | ||||
|     </context> <!-- /_ordered-class-body-constructor-parameters-list --> | ||||
|  | ||||
|     <context id="_choice-class-body-constructor-member" style-ref="js:function-expression" end-parent="true"> | ||||
|       <start extended="true"> | ||||
|         \%{js:keyword-start} constructor \%{js:keyword-end} | ||||
|         (?= \%{js:optional-whitespace-or-comments} \( ) | ||||
|       </start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:built-in-method"/> | ||||
|         <context ref="js:comments"/> | ||||
|  | ||||
|         <context id="_class-body-constructor-member-content"> | ||||
|           <include> | ||||
|             <context ref="_ordered-class-body-constructor-parameters-list"/> | ||||
|             <context ref="js-fn:_last-function-body"/> | ||||
|           </include> | ||||
|         </context> <!-- /_class-body-constructor-member-content --> | ||||
|  | ||||
|       </include> | ||||
|     </context> <!-- /_choice-class-body-constructor-member --> | ||||
|  | ||||
|     <!-- modifier order: | ||||
|          * accessibility ("public" / "protected" / "private") | ||||
|          * "abstract" / "static" (mutually exclusive) | ||||
|          * "readonly" | ||||
|  | ||||
|          "declare" can be in any position: | ||||
|          https://github.com/microsoft/TypeScript/issues/34172 | ||||
|  | ||||
|         index members can only be modified with "readonly" | ||||
|  | ||||
|         private fields can only be modified with "readonly" | ||||
|  | ||||
|         cannot have abstract generators: abstract *generator() | ||||
|         https://github.com/Microsoft/TypeScript/issues/25710 | ||||
|  | ||||
|         "abstract async" will probably be not allowed in the future | ||||
|         https://github.com/microsoft/TypeScript/issues/28516 | ||||
|     --> | ||||
|  | ||||
|     <!-- replaces js-fn:_class-body-member-content --> | ||||
|     <context id="class-body-member-content"> | ||||
|       <include> | ||||
|         <!-- only "readonly" applies to index members | ||||
|              but these all need to be here because of ordering --> | ||||
|         <!-- try to match before and after each modifier --> | ||||
|         <context ref="_choice-class-body-keyword-named-property-or-method"/> | ||||
|  | ||||
|         <context ref="_class-body-declare-property-modifier"/> | ||||
|  | ||||
|         <context ref="_ordered-accessibility-modifier"/> | ||||
|         <!-- "static" must precede "readonly" --> | ||||
|         <context ref="js-fn:_ordered-class-body-member-modifier"/> | ||||
|         <context ref="_ordered-class-body-member-modifier"/> | ||||
|         <context ref="_ordered-read-only-property-modifier"/> | ||||
|  | ||||
|         <context ref="_choice-class-body-index-member"/> | ||||
|         <context ref="_choice-class-body-property-or-method-member"/> | ||||
|         <context ref="_choice-class-body-private-field"/> | ||||
|         <context ref="_choice-class-body-method-keyword-method-definition"/> | ||||
|         <!-- should not be combined with some modifiers, but cannot prevent it --> | ||||
|         <context ref="_choice-class-body-constructor-member"/> | ||||
|  | ||||
|         <context ref="js-fn:ordered-property-accessor-keyword"/> | ||||
|         <context ref="js-lit:ordered-property-name"/> | ||||
|  | ||||
|         <!-- for class properties and methods --> | ||||
|         <context ref="typescript:ordered-optional-modifier"/> | ||||
|         <!-- for class properties only --> | ||||
|         <context ref="typescript:ordered-definite-assignment-assertion"/> | ||||
|         <!-- optional modifier and definitely assignment assertion | ||||
|              cannot both be specified --> | ||||
|  | ||||
|         <context ref="_choice-class-body-method-definition"/> | ||||
|  | ||||
|         <context ref="typescript:ordered-type-annotation"/> | ||||
|         <context ref="js:ordered-default-value-assignment"/> | ||||
|       </include> | ||||
|     </context> <!-- /class-body-member-content --> | ||||
|  | ||||
|   | ||||
| @@ -4,7 +4,7 @@ | ||||
|  This file is part of GtkSourceView | ||||
|  | ||||
|  Author: Jeffery To <jeffery.to@gmail.com> | ||||
|  Copyright (C) 2019 Jeffery To <jeffery.to@gmail.com> | ||||
|  Copyright (C) 2019-2020 Jeffery To <jeffery.to@gmail.com> | ||||
|  | ||||
|  GtkSourceView is free software; you can redistribute it and/or | ||||
|  modify it under the terms of the GNU Lesser General Public | ||||
| @@ -22,7 +22,7 @@ | ||||
| --> | ||||
| <language id="typescript-js-lit" name="TypeScript JavaScript Literal Additions" version="2.0" _section="Script" hidden="true"> | ||||
|   <!-- from js:identifier-char --> | ||||
|   <keyword-char-class>[\p{L}\p{Nl}\x{1885}-\x{1886}\x{2118}\x{212E}\x{309B}-\x{309C}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{00B7}\x{0387}\x{1369}-\x{1371}\x{19DA}$\x{200C}\x{200D}]</keyword-char-class> | ||||
|   <keyword-char-class>(?!\x{2E2F})[\p{L}\p{Nl}\x{1885}-\x{1886}\x{2118}\x{212E}\x{309B}-\x{309C}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{00B7}\x{0387}\x{1369}-\x{1371}\x{19DA}$\x{200C}\x{200D}]</keyword-char-class> | ||||
|  | ||||
|   <definitions> | ||||
|  | ||||
| @@ -45,13 +45,7 @@ | ||||
|       <include> | ||||
|  | ||||
|         <define-regex id="_decimal-digits" extended="true"> | ||||
|           (?> | ||||
|             [0-9] | ||||
|             (?: | ||||
|               [0-9]+ | | ||||
|               (?: _ [0-9] )+ | ||||
|             )* | ||||
|           ) | ||||
|           (?> [0-9] (?: [0-9]+ | (?: _ [0-9] )+ )* ) | ||||
|         </define-regex> <!-- /_decimal-digits --> | ||||
|  | ||||
|         <define-regex id="_decimal" extended="true"> | ||||
| @@ -64,91 +58,51 @@ | ||||
|  | ||||
|         <context id="_choice-decimal" style-ref="js:decimal" end-parent="true"> | ||||
|           <start extended="true"> | ||||
|             (?<! \%{js:identifier-char} | \. ) | ||||
|             (?= | ||||
|               \%{_decimal} | ||||
|               (?! \%{js:identifier-part} | \. ) | ||||
|             ) | ||||
|             \%{js:number-start} (?= \%{_decimal} \%{js:number-end} ) | ||||
|           </start> | ||||
|           <end>\%{_decimal}</end> | ||||
|         </context> <!-- /_choice-decimal --> | ||||
|  | ||||
|         <define-regex id="_decimal-integer" extended="true"> | ||||
|           (?> | ||||
|             (?: [1-9] _? \%{_decimal-digits} | [0-9] ) | ||||
|           ) | ||||
|           (?> [1-9] _? \%{_decimal-digits} | [0-9] ) | ||||
|         </define-regex> <!-- /_decimal-integer --> | ||||
|  | ||||
|         <context id="_choice-decimal-big-integer" style-ref="js:decimal" end-parent="true"> | ||||
|           <start extended="true"> | ||||
|             (?<! \%{js:identifier-char} | \. ) | ||||
|             (?= | ||||
|               \%{_decimal-integer} n | ||||
|               (?! \%{js:identifier-part} | \. ) | ||||
|             ) | ||||
|             \%{js:number-start} (?= \%{_decimal-integer} n \%{js:number-end} ) | ||||
|           </start> | ||||
|           <end>\%{_decimal-integer}n</end> | ||||
|         </context> <!-- /_choice-decimal-big-integer --> | ||||
|  | ||||
|         <define-regex id="_binary-integer" extended="true"> | ||||
|           (?> | ||||
|             0 [bB] [01] | ||||
|             (?: | ||||
|               [01]+ | | ||||
|               (?: _ [01] )+ | ||||
|             )* | ||||
|           ) | ||||
|           (?> 0 [bB] [01] (?: [01]+ | (?: _ [01] )+ )* ) | ||||
|         </define-regex> <!-- /_binary-integer --> | ||||
|  | ||||
|         <context id="_choice-binary-integer" style-ref="js:binary-integer" end-parent="true"> | ||||
|           <start extended="true"> | ||||
|             (?<! \%{js:identifier-char} | \. ) | ||||
|             (?= | ||||
|               \%{_binary-integer} n? | ||||
|               (?! \%{js:identifier-part} | \. ) | ||||
|             ) | ||||
|             \%{js:number-start} (?= \%{_binary-integer} n? \%{js:number-end} ) | ||||
|           </start> | ||||
|           <end>\%{_binary-integer}n?</end> | ||||
|         </context> <!-- /_choice-binary-integer --> | ||||
|  | ||||
|         <define-regex id="_octal-integer" extended="true"> | ||||
|           (?> | ||||
|             0 [oO] [0-7] | ||||
|             (?: | ||||
|               [0-7]+ | | ||||
|               (?: _ [0-7] )+ | ||||
|             )* | ||||
|           ) | ||||
|           (?> 0 [oO] [0-7] (?: [0-7]+ | (?: _ [0-7] )+ )* ) | ||||
|         </define-regex> <!-- /_octal-integer --> | ||||
|  | ||||
|         <context id="_choice-octal-integer" style-ref="js:octal-integer" end-parent="true"> | ||||
|           <start extended="true"> | ||||
|             (?<! \%{js:identifier-char} | \. ) | ||||
|             (?= | ||||
|               \%{_octal-integer} n? | ||||
|               (?! \%{js:identifier-part} | \. ) | ||||
|             ) | ||||
|             \%{js:number-start} (?= \%{_octal-integer} n? \%{js:number-end} ) | ||||
|           </start> | ||||
|           <end>\%{_octal-integer}n?</end> | ||||
|         </context> <!-- /_choice-octal-integer --> | ||||
|  | ||||
|         <define-regex id="_hex-integer" extended="true"> | ||||
|           (?> | ||||
|             0 [xX] [0-9a-fA-F] | ||||
|             (?: | ||||
|               [0-9a-fA-F]+ | | ||||
|               (?: _ [0-9a-fA-F] )+ | ||||
|             )* | ||||
|           ) | ||||
|           (?> 0 [xX] [0-9a-fA-F] (?: [0-9a-fA-F]+ | (?: _ [0-9a-fA-F] )+ )* ) | ||||
|         </define-regex> <!-- /_hex-integer --> | ||||
|  | ||||
|         <context id="_choice-hex-integer" style-ref="js:hex-integer" end-parent="true"> | ||||
|           <start extended="true"> | ||||
|             (?<! \%{js:identifier-char} | \. ) | ||||
|             (?= | ||||
|               \%{_hex-integer} n? | ||||
|               (?! \%{js:identifier-part} | \. ) | ||||
|             ) | ||||
|             \%{js:number-start} (?= \%{_hex-integer} n? \%{js:number-end} ) | ||||
|           </start> | ||||
|           <end>\%{_hex-integer}n?</end> | ||||
|         </context> <!-- /_choice-hex-integer --> | ||||
| @@ -157,5 +111,22 @@ | ||||
|       </include> | ||||
|     </context> <!-- /choice-number --> | ||||
|  | ||||
|  | ||||
|     <!-- # Object literal --> | ||||
|  | ||||
|     <!-- replaces js-lit:_choice-object-literal-keyword-named-property-or-method --> | ||||
|     <context id="choice-object-literal-keyword-named-property-or-method" end-parent="true"> | ||||
|       <start extended="true"> | ||||
|         (?: \%{js:get-keyword} | \%{js:set-keyword} ) | ||||
|         (?= \%{js:optional-whitespace-or-comments} [:=<(] ) | ||||
|       </start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:identifier"/> | ||||
|         <context ref="js:comments"/> | ||||
|         <context ref="js-lit:_object-literal-keyword-named-property-or-method-content"/> | ||||
|       </include> | ||||
|     </context> <!-- /choice-object-literal-keyword-named-property-or-method --> | ||||
|  | ||||
|   </definitions> | ||||
| </language> | ||||
|   | ||||
| @@ -4,7 +4,7 @@ | ||||
|  This file is part of GtkSourceView | ||||
|  | ||||
|  Author: Jeffery To <jeffery.to@gmail.com> | ||||
|  Copyright (C) 2019 Jeffery To <jeffery.to@gmail.com> | ||||
|  Copyright (C) 2019-2020 Jeffery To <jeffery.to@gmail.com> | ||||
|  | ||||
|  GtkSourceView is free software; you can redistribute it and/or | ||||
|  modify it under the terms of the GNU Lesser General Public | ||||
| @@ -22,7 +22,7 @@ | ||||
| --> | ||||
| <language id="typescript-js-mod" name="TypeScript JavaScript Module Additions" version="2.0" _section="Script" hidden="true"> | ||||
|   <!-- from js:identifier-char --> | ||||
|   <keyword-char-class>[\p{L}\p{Nl}\x{1885}-\x{1886}\x{2118}\x{212E}\x{309B}-\x{309C}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{00B7}\x{0387}\x{1369}-\x{1371}\x{19DA}$\x{200C}\x{200D}]</keyword-char-class> | ||||
|   <keyword-char-class>(?!\x{2E2F})[\p{L}\p{Nl}\x{1885}-\x{1886}\x{2118}\x{212E}\x{309B}-\x{309C}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{00B7}\x{0387}\x{1369}-\x{1371}\x{19DA}$\x{200C}\x{200D}]</keyword-char-class> | ||||
|  | ||||
|   <definitions> | ||||
|  | ||||
| @@ -39,7 +39,7 @@ | ||||
|     --> | ||||
|  | ||||
|     <context id="_export-as-namespace-keyword" style-ref="js:keyword" once-only="true"> | ||||
|       <keyword>namespace</keyword> | ||||
|       <match>\%{typescript:namespace-keyword}</match> | ||||
|     </context> <!-- /_export-as-namespace-keyword --> | ||||
|  | ||||
|     <context id="_ordered-export-as-namespace-keyword" once-only="true"> | ||||
| @@ -51,7 +51,7 @@ | ||||
|     </context> <!-- /_ordered-export-as-namespace-keyword --> | ||||
|  | ||||
|     <context id="_choice-export-as-namespace" end-parent="true"> | ||||
|       <start>\%[as\%]</start> | ||||
|       <start>\%{js:as-keyword}</start> | ||||
|       <end>\%{js:statement-end}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
| @@ -88,6 +88,42 @@ | ||||
|       </include> | ||||
|     </context> <!-- /_choice-export-assignment --> | ||||
|  | ||||
|     <!-- ## Type-only export or export type alias declaration | ||||
|  | ||||
|          type-only export: | ||||
|          export type { T }; | ||||
|          export type { T } from './mod'; | ||||
|  | ||||
|          export type alias declaration: | ||||
|          export type Name = string; | ||||
|     --> | ||||
|  | ||||
|     <context id="_choice-export-type-alias-declaration" style-ref="typescript:type-alias-declaration" end-parent="true"> | ||||
|       <start>\%{js:before-next-token}</start> | ||||
|       <end>\%{js:statement-end}</end> | ||||
|       <include> | ||||
|         <context ref="js:comments"/> | ||||
|         <context ref="typescript-js-st:_type-alias-declaration-content"/> | ||||
|       </include> | ||||
|     </context> <!-- /_choice-export-type-alias-declaration --> | ||||
|  | ||||
|     <context id="_choice-export-type-only-or-type-alias-declaration" end-parent="true"> | ||||
|       <start>\%{typescript:type-keyword}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="typescript:type-keyword"/> | ||||
|         <context ref="js:comments"/> | ||||
|  | ||||
|         <context id="_export-type-only-or-type-alias-declaration-content"> | ||||
|           <include> | ||||
|             <context ref="js-mod:_choice-export-named"/> | ||||
|             <context ref="_choice-export-type-alias-declaration"/> | ||||
|           </include> | ||||
|         </context> <!-- /_export-type-only-or-type-alias-declaration-content --> | ||||
|  | ||||
|       </include> | ||||
|     </context> <!-- /_choice-export-type-only-or-type-alias-declaration --> | ||||
|  | ||||
|     <!-- ## Export declaration --> | ||||
|  | ||||
|     <!-- replaces js-mod:_export-declaration-content --> | ||||
| @@ -98,10 +134,10 @@ | ||||
|         <context ref="typescript-js-st:choice-ambient-declaration"/> | ||||
|         <context ref="typescript-js-st:choice-const-declaration"/> | ||||
|         <context ref="typescript-js-st:choice-enum-declaration"/> | ||||
|         <context ref="_choice-import-declaration"/> <!-- for import alias declaration --> | ||||
|         <context ref="_choice-import-default-declaration"/> <!-- for import alias declaration --> | ||||
|         <context ref="typescript-js-st:choice-interface-declaration"/> | ||||
|         <context ref="typescript-js-st:choice-namespace-declaration"/> | ||||
|         <context ref="typescript-js-st:choice-type-alias-declaration"/> | ||||
|         <context ref="_choice-export-type-only-or-type-alias-declaration"/> | ||||
|         <context ref="js-mod:_export-declaration-content" original="true"/> | ||||
|       </include> | ||||
|     </context> <!-- /export-declaration-content --> | ||||
| @@ -120,7 +156,7 @@ | ||||
|     --> | ||||
|  | ||||
|     <context id="_choice-import-require" end-parent="true"> | ||||
|       <start>\%[require\%]</start> | ||||
|       <start>\%{typescript:require-keyword}</start> | ||||
|       <end>\%{js:statement-end}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
| @@ -181,6 +217,31 @@ | ||||
|       </include> | ||||
|     </context> <!-- /_choice-import-alias-or-require --> | ||||
|  | ||||
|     <!-- ## Type-only import | ||||
|  | ||||
|          import type T from './mod'; | ||||
|          import type { A, B } from './mod'; | ||||
|          import type * as Types from './mod'; | ||||
|     --> | ||||
|  | ||||
|     <context id="_choice-import-type-only" end-parent="true"> | ||||
|       <start>\%{typescript:type-keyword}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="typescript:type-keyword"/> | ||||
|         <context ref="js:comments"/> | ||||
|  | ||||
|         <context id="_import-type-only-content"> | ||||
|           <include> | ||||
|             <context ref="js-mod:_choice-import-named"/> | ||||
|             <context ref="js-mod:_choice-all-as-namespace"/> | ||||
|             <context ref="js-mod:_choice-import-default"/> | ||||
|           </include> | ||||
|         </context> <!-- _import-type-only-content --> | ||||
|  | ||||
|       </include> | ||||
|     </context> <!-- /_choice-import-type-only --> | ||||
|  | ||||
|     <!-- ## Import default --> | ||||
|  | ||||
|     <!-- replaces js-mod:_import-default-content --> | ||||
| @@ -193,37 +254,31 @@ | ||||
|       </include> | ||||
|     </context> <!-- /import-default-content --> | ||||
|  | ||||
|     <!-- ## Import declaration --> | ||||
|  | ||||
|     <define-regex id="_import-declaration-keyword" extended="true"> | ||||
|       (?: | ||||
|         \%[ import \%] | ||||
|         (?! \%{js:import-function-keyword-suffix} ) | ||||
|         (?! \%{typescript:import-meta-object-keyword-suffix} ) | ||||
|       ) | ||||
|     </define-regex> | ||||
|  | ||||
|     <!-- <ImportDeclaration> --> | ||||
|     <context id="_choice-import-declaration" style-ref="js:export-import-declaration" end-parent="true"> | ||||
|       <start>\%{_import-declaration-keyword}</start> | ||||
|     <!-- this is like js-mod:import-declarations but only matches import | ||||
|          default (for import alias) --> | ||||
|     <context id="_choice-import-default-declaration" style-ref="js:export-import-declaration" end-parent="true"> | ||||
|       <start>\%{js:import-keyword}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
|         <context ref="js:comments"/> | ||||
|         <context ref="js-mod:_import-declaration-content"/> | ||||
|       </include> | ||||
|     </context> <!-- /_choice-import-declaration --> | ||||
|  | ||||
|     <!-- replaces js-mod:import-declarations --> | ||||
|     <context id="import-declarations" style-ref="js:export-import-declaration"> | ||||
|       <start>\%{_import-declaration-keyword}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
|         <context ref="js:comments"/> | ||||
|         <context ref="js-mod:_import-declaration-content"/> | ||||
|         <context id="_import-default-declaration-content"> | ||||
|           <include> | ||||
|             <context ref="js-mod:_choice-import-default"/> | ||||
|           </include> | ||||
|         </context> <!-- /_import-default-declaration-content --> | ||||
|  | ||||
|       </include> | ||||
|     </context> <!-- /import-declarations --> | ||||
|     </context> <!-- /_choice-import-default-declaration --> | ||||
|  | ||||
|     <!-- replaces js-mod:_import-declaration-content --> | ||||
|     <context id="import-declaration-content"> | ||||
|       <include> | ||||
|         <context ref="_choice-import-type-only"/> | ||||
|         <context ref="js-mod:_import-declaration-content" original="true"/> | ||||
|       </include> | ||||
|     </context> <!-- /import-declaration-content --> | ||||
|  | ||||
|   </definitions> | ||||
| </language> | ||||
|   | ||||
| @@ -4,7 +4,7 @@ | ||||
|  This file is part of GtkSourceView | ||||
|  | ||||
|  Author: Jeffery To <jeffery.to@gmail.com> | ||||
|  Copyright (C) 2019 Jeffery To <jeffery.to@gmail.com> | ||||
|  Copyright (C) 2019-2020 Jeffery To <jeffery.to@gmail.com> | ||||
|  | ||||
|  GtkSourceView is free software; you can redistribute it and/or | ||||
|  modify it under the terms of the GNU Lesser General Public | ||||
| @@ -22,7 +22,7 @@ | ||||
| --> | ||||
| <language id="typescript-js-st" name="TypeScript JavaScript Statement Additions" version="2.0" _section="Script" hidden="true"> | ||||
|   <!-- from js:identifier-char --> | ||||
|   <keyword-char-class>[\p{L}\p{Nl}\x{1885}-\x{1886}\x{2118}\x{212E}\x{309B}-\x{309C}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{00B7}\x{0387}\x{1369}-\x{1371}\x{19DA}$\x{200C}\x{200D}]</keyword-char-class> | ||||
|   <keyword-char-class>(?!\x{2E2F})[\p{L}\p{Nl}\x{1885}-\x{1886}\x{2118}\x{212E}\x{309B}-\x{309C}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{00B7}\x{0387}\x{1369}-\x{1371}\x{19DA}$\x{200C}\x{200D}]</keyword-char-class> | ||||
|  | ||||
|   <definitions> | ||||
|  | ||||
| @@ -50,7 +50,7 @@ | ||||
|     <!-- replaces js-st:_variable-declaration-item-content --> | ||||
|     <context id="variable-declaration-item-content"> | ||||
|       <include> | ||||
|         <context ref="js:ordered-assignment-target"/> | ||||
|         <context ref="js:ordered-binding"/> | ||||
|         <context ref="typescript:ordered-definite-assignment-assertion"/> | ||||
|         <context ref="typescript:ordered-type-annotation"/> | ||||
|         <context ref="js:ordered-default-value-assignment"/> | ||||
| @@ -71,12 +71,8 @@ | ||||
|          declare global { ... } | ||||
|     --> | ||||
|  | ||||
|     <define-regex id="_ambient-declaration-keyword" extended="true"> | ||||
|       (?: \%[ declare \%] ) | ||||
|     </define-regex> <!-- /_ambient-declaration-keyword --> | ||||
|  | ||||
|     <context id="_choice-global-augmentation" style-ref="typescript:global-augmentation" end-parent="true"> | ||||
|       <start>\%[global\%]</start> | ||||
|       <start>\%{typescript:global-keyword}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
| @@ -106,7 +102,7 @@ | ||||
|  | ||||
|     <!-- <AmbientDeclaration> --> | ||||
|     <context id="_ambient-declarations" style-ref="typescript:ambient-declaration"> | ||||
|       <start>\%{_ambient-declaration-keyword}</start> | ||||
|       <start>\%{typescript:declare-keyword}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="typescript:type-keyword"/> | ||||
| @@ -117,7 +113,7 @@ | ||||
|  | ||||
|     <!-- <AmbientDeclaration> --> | ||||
|     <context id="choice-ambient-declaration" style-ref="typescript:ambient-declaration" end-parent="true"> | ||||
|       <start>\%{_ambient-declaration-keyword}</start> | ||||
|       <start>\%{typescript:declare-keyword}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="typescript:type-keyword"/> | ||||
| @@ -135,10 +131,6 @@ | ||||
|          we need a custom const declaration to handle "const enum" | ||||
|     --> | ||||
|  | ||||
|     <define-regex id="_const-declaration-keyword" extended="true"> | ||||
|       (?: \%[ const \%] ) | ||||
|     </define-regex> <!-- /_const-declaration-keyword --> | ||||
|  | ||||
|     <context id="_const-declaration-content"> | ||||
|       <include> | ||||
|         <context ref="choice-enum-declaration"/> | ||||
| @@ -156,7 +148,7 @@ | ||||
|     </context> <!-- /_const-declaration-content --> | ||||
|  | ||||
|     <context id="_const-declarations" style-ref="js:variable-declaration"> | ||||
|       <start>\%{_const-declaration-keyword}</start> | ||||
|       <start>\%{js:const-keyword}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
| @@ -166,7 +158,7 @@ | ||||
|     </context> <!-- /_const-declarations --> | ||||
|  | ||||
|     <context id="choice-const-declaration" style-ref="js:variable-declaration" end-parent="true"> | ||||
|       <start>\%{_const-declaration-keyword}</start> | ||||
|       <start>\%{js:const-keyword}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
| @@ -181,10 +173,6 @@ | ||||
|          enum Foo { A = 1, B, C } | ||||
|     --> | ||||
|  | ||||
|     <define-regex id="_enum-declaration-keyword" extended="true"> | ||||
|       (?: \%[ enum \%] ) | ||||
|     </define-regex> <!-- /_enum-declaration-keyword --> | ||||
|  | ||||
|     <context id="_enum-member-content"> | ||||
|       <include> | ||||
|         <context ref="typescript-type-lit:ordered-property-name"/> | ||||
| @@ -242,7 +230,7 @@ | ||||
|  | ||||
|     <!-- <EnumDeclaration> --> | ||||
|     <context id="_enum-declarations" style-ref="typescript:enum-declaration"> | ||||
|       <start>\%{_enum-declaration-keyword}</start> | ||||
|       <start>\%{typescript:enum-keyword}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
| @@ -253,7 +241,7 @@ | ||||
|  | ||||
|     <!-- <EnumDeclaration> --> | ||||
|     <context id="choice-enum-declaration" style-ref="typescript:enum-declaration" end-parent="true"> | ||||
|       <start>\%{_enum-declaration-keyword}</start> | ||||
|       <start>\%{typescript:enum-keyword}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
| @@ -270,12 +258,8 @@ | ||||
|            AnotherThing<string, number> { ... } | ||||
|     --> | ||||
|  | ||||
|     <define-regex id="_interface-declaration-keyword" extended="true"> | ||||
|       (?: \%[ interface \%] ) | ||||
|     </define-regex> <!-- /_interface-declaration-keyword --> | ||||
|  | ||||
|     <context id="_interface-extends-clause" once-only="true"> | ||||
|       <start>\%[extends\%]</start> | ||||
|       <start>\%{js:extends-keyword}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="typescript:type-keyword"/> | ||||
| @@ -309,7 +293,7 @@ | ||||
|  | ||||
|     <!-- <InterfaceDeclaration> --> | ||||
|     <context id="_interface-declarations" style-ref="typescript:interface-declaration"> | ||||
|       <start>\%{_interface-declaration-keyword}</start> | ||||
|       <start>\%{typescript:interface-keyword}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="typescript:type-keyword"/> | ||||
| @@ -320,7 +304,7 @@ | ||||
|  | ||||
|     <!-- <InterfaceDeclaration> --> | ||||
|     <context id="choice-interface-declaration" style-ref="typescript:interface-declaration" end-parent="true"> | ||||
|       <start>\%{_interface-declaration-keyword}</start> | ||||
|       <start>\%{typescript:interface-keyword}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="typescript:type-keyword"/> | ||||
| @@ -337,10 +321,6 @@ | ||||
|          module "foo.bar" { ... } // "external module" for d.ts files | ||||
|     --> | ||||
|  | ||||
|     <define-regex id="_module-declaration-keyword" extended="true"> | ||||
|       (?: \%[ module \%] ) | ||||
|     </define-regex> <!-- /_module-declaration-keyword --> | ||||
|  | ||||
|     <context id="_module-identifier-or-string" once-only="true"> | ||||
|       <start>\%{js:before-next-token}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
| @@ -374,7 +354,7 @@ | ||||
|  | ||||
|     <!-- <NamespaceDeclaration> --> | ||||
|     <context id="_module-declarations" style-ref="typescript:module-declaration"> | ||||
|       <start>\%{_module-declaration-keyword}</start> | ||||
|       <start>\%{typescript:module-keyword}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
| @@ -385,7 +365,7 @@ | ||||
|  | ||||
|     <!-- <NamespaceDeclaration> --> | ||||
|     <context id="choice-module-declaration" style-ref="typescript:module-declaration" end-parent="true"> | ||||
|       <start>\%{_module-declaration-keyword}</start> | ||||
|       <start>\%{typescript:module-keyword}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
| @@ -400,10 +380,6 @@ | ||||
|          namespace Foo.Bar { ... } | ||||
|     --> | ||||
|  | ||||
|     <define-regex id="_namespace-declaration-keyword" extended="true"> | ||||
|       (?: \%[ namespace \%] ) | ||||
|     </define-regex> <!-- /_namespace-declaration-keyword --> | ||||
|  | ||||
|     <context id="_namespace-body" once-only="true"> | ||||
|       <start>{</start> | ||||
|       <end>}</end> | ||||
| @@ -438,7 +414,7 @@ | ||||
|  | ||||
|     <!-- <NamespaceDeclaration> --> | ||||
|     <context id="_namespace-declarations" style-ref="typescript:namespace-declaration"> | ||||
|       <start>\%{_namespace-declaration-keyword}</start> | ||||
|       <start>\%{typescript:namespace-keyword}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
| @@ -449,7 +425,7 @@ | ||||
|  | ||||
|     <!-- <NamespaceDeclaration> --> | ||||
|     <context id="choice-namespace-declaration" style-ref="typescript:namespace-declaration" end-parent="true"> | ||||
|       <start>\%{_namespace-declaration-keyword}</start> | ||||
|       <start>\%{typescript:namespace-keyword}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
| @@ -467,10 +443,6 @@ | ||||
|          type Container<T> = { value: T }; | ||||
|     --> | ||||
|  | ||||
|     <define-regex id="_type-alias-declaration-keyword" extended="true"> | ||||
|       (?: \%[ type \%] ) | ||||
|     </define-regex> <!-- /_type-alias-declaration-keyword --> | ||||
|  | ||||
|     <context id="_type-alias-value" once-only="true"> | ||||
|       <start>=</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
| @@ -494,36 +466,25 @@ | ||||
|       </include> | ||||
|     </context> <!-- /_ordered-type-alias-value --> | ||||
|  | ||||
|     <context id="_type-alias-declaration-content"> | ||||
|       <include> | ||||
|         <context ref="js:ordered-identifier"/> | ||||
|         <context ref="typescript-type-gen:ordered-type-parameters-list"/> | ||||
|         <context ref="_ordered-type-alias-value"/> | ||||
|       </include> | ||||
|     </context> <!-- /_type-alias-declaration-content --> | ||||
|  | ||||
|     <!-- <TypeAliasDeclaration> --> | ||||
|     <context id="_type-alias-declarations" style-ref="typescript:type-alias-declaration"> | ||||
|       <start>\%{_type-alias-declaration-keyword}</start> | ||||
|       <start>\%{typescript:type-keyword}</start> | ||||
|       <end>\%{js:statement-end}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="typescript:type-keyword"/> | ||||
|         <context ref="js:comments"/> | ||||
|         <context ref="_type-alias-declaration-content"/> | ||||
|  | ||||
|         <context id="_type-alias-declaration-content"> | ||||
|           <include> | ||||
|             <context ref="js:ordered-identifier"/> | ||||
|             <context ref="typescript-type-gen:ordered-type-parameters-list"/> | ||||
|             <context ref="_ordered-type-alias-value"/> | ||||
|           </include> | ||||
|         </context> <!-- /_type-alias-declaration-content --> | ||||
|  | ||||
|       </include> | ||||
|     </context> <!-- /_type-alias-declarations --> | ||||
|  | ||||
|     <!-- <TypeAliasDeclaration> --> | ||||
|     <context id="choice-type-alias-declaration" style-ref="typescript:type-alias-declaration" end-parent="true"> | ||||
|       <start>\%{_type-alias-declaration-keyword}</start> | ||||
|       <end>\%{js:statement-end}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="typescript:type-keyword"/> | ||||
|         <context ref="js:comments"/> | ||||
|         <context ref="_type-alias-declaration-content"/> | ||||
|       </include> | ||||
|     </context> <!-- /choice-type-alias-declaration --> | ||||
|  | ||||
|  | ||||
|     <!-- # Statements --> | ||||
|  | ||||
|   | ||||
| @@ -1,65 +0,0 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <!-- | ||||
|  | ||||
|  This file is part of GtkSourceView | ||||
|  | ||||
|  Author: Jeffery To <jeffery.to@gmail.com> | ||||
|  Copyright (C) 2019 Jeffery To <jeffery.to@gmail.com> | ||||
|  | ||||
|  GtkSourceView is free software; you can redistribute it and/or | ||||
|  modify it under the terms of the GNU Lesser General Public | ||||
|  License as published by the Free Software Foundation; either | ||||
|  version 2.1 of the License, or (at your option) any later version. | ||||
|  | ||||
|  GtkSourceView is distributed in the hope that it will be useful, | ||||
|  but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
|  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU | ||||
|  Lesser General Public License for more details. | ||||
|  | ||||
|  You should have received a copy of the GNU Lesser General Public License | ||||
|  along with this library; if not, see <http://www.gnu.org/licenses/>. | ||||
|  | ||||
| --> | ||||
| <language id="typescript-js-val" name="TypeScript JavaScript Built-in Value Additions" version="2.0" _section="Script" hidden="true"> | ||||
|   <!-- from js:identifier-char --> | ||||
|   <keyword-char-class>[\p{L}\p{Nl}\x{1885}-\x{1886}\x{2118}\x{212E}\x{309B}-\x{309C}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{00B7}\x{0387}\x{1369}-\x{1371}\x{19DA}$\x{200C}\x{200D}]</keyword-char-class> | ||||
|  | ||||
|   <definitions> | ||||
|  | ||||
|     <!-- | ||||
|          See typescript.lang for general notes, naming conventions, etc. | ||||
|     --> | ||||
|  | ||||
|  | ||||
|     <!-- # Global values --> | ||||
|  | ||||
|     <!-- replaces js-val:global-values --> | ||||
|     <context id="global-values"> | ||||
|       <include> | ||||
|  | ||||
|         <!-- import.meta: stage 3 proposal --> | ||||
|         <context id="_import-meta-object-keyword"> | ||||
|           <start extended="true"> | ||||
|             \%[ import \%] (?= \%{typescript:import-meta-object-keyword-suffix} ) | ||||
|           </start> | ||||
|           <end>\%[meta\%]</end> | ||||
|           <include> | ||||
|             <context sub-pattern="0" where="start" style-ref="js:keyword"/> | ||||
|             <context sub-pattern="0" where="end" style-ref="js:keyword"/> | ||||
|             <context ref="js:comments"/> | ||||
|  | ||||
|             <context id="_import-meta-object-keyword-content"> | ||||
|               <include> | ||||
|                 <context ref="js:ordered-keyword-dot" style-ref="js:keyword"/> | ||||
|               </include> | ||||
|             </context> <!-- /_import-meta-object-keyword-content --> | ||||
|  | ||||
|           </include> | ||||
|         </context> <!-- /_import-meta-object-keyword --> | ||||
|  | ||||
|         <context ref="js-val:global-values" original="true"/> | ||||
|       </include> | ||||
|     </context> <!-- /global-values --> | ||||
|  | ||||
|   </definitions> | ||||
| </language> | ||||
| @@ -4,7 +4,7 @@ | ||||
|  This file is part of GtkSourceView | ||||
|  | ||||
|  Author: Jeffery To <jeffery.to@gmail.com> | ||||
|  Copyright (C) 2019 Jeffery To <jeffery.to@gmail.com> | ||||
|  Copyright (C) 2019-2020 Jeffery To <jeffery.to@gmail.com> | ||||
|  | ||||
|  GtkSourceView is free software; you can redistribute it and/or | ||||
|  modify it under the terms of the GNU Lesser General Public | ||||
| @@ -30,7 +30,7 @@ | ||||
|   </metadata> | ||||
|  | ||||
|   <!-- from js:identifier-char --> | ||||
|   <keyword-char-class>[\p{L}\p{Nl}\x{1885}-\x{1886}\x{2118}\x{212E}\x{309B}-\x{309C}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{00B7}\x{0387}\x{1369}-\x{1371}\x{19DA}$\x{200C}\x{200D}]</keyword-char-class> | ||||
|   <keyword-char-class>(?!\x{2E2F})[\p{L}\p{Nl}\x{1885}-\x{1886}\x{2118}\x{212E}\x{309B}-\x{309C}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{00B7}\x{0387}\x{1369}-\x{1371}\x{19DA}$\x{200C}\x{200D}]</keyword-char-class> | ||||
|  | ||||
|   <definitions> | ||||
|  | ||||
| @@ -47,7 +47,7 @@ | ||||
|       <include> | ||||
|         <context ref="typescript:typescript"/> | ||||
|       </include> | ||||
|     </context> | ||||
|     </context> <!-- /main-lang --> | ||||
|  | ||||
|     <replace id="jsx:main-lang" ref="main-lang"/> | ||||
|  | ||||
| @@ -55,46 +55,40 @@ | ||||
|     <!-- ## @jsx comment pragma | ||||
|  | ||||
|          /* @jsx dom */ | ||||
|  | ||||
|          can only be preceded by comments or other triple-slash | ||||
|          directives (i.e. at the top of a file) | ||||
|          can appear anywhere inside the comment(!) | ||||
|          appears to be case-insensitive | ||||
|          https://github.com/microsoft/TypeScript/blob/3c49fb0d9ffb67fd645835589d66687b4fb7543a/src/services/classifier.ts#L768 | ||||
|     --> | ||||
|  | ||||
|     <!-- I believe the allowed syntax is less strict but I haven't found | ||||
|          any definitive documentation --> | ||||
|     <context id="_jsx-comment-pragmas" style-ref="js:directive" class="comment"> | ||||
|       <start case-sensitive="false" extended="true"> | ||||
|         /\*\*? \%{js:whitespace}* @jsx \%] | ||||
|       </start> | ||||
|       <end>\*/</end> | ||||
|       <include> | ||||
|         <context ref="js:_comment-content"/> | ||||
|       </include> | ||||
|     </context> <!-- /_jsx-comment-pragmas --> | ||||
|     <define-regex id="_jsx-comment-pragma" case-sensitive="false" extended="true"> | ||||
|       @jsx \s+ (?> \%{js:identifier} (?: \. \%{js:identifier} )* ) (?! \S ) | ||||
|     </define-regex> <!-- /_jsx-comment-pragma --> | ||||
|  | ||||
|     <context id="_jsx-comment-pragmas-no-extend-parent" style-ref="js:directive" class="comment" extend-parent="false"> | ||||
|     <context id="_jsx-comment-pragma" style-ref="js:directive" class="no-spell-check" once-only="true"> | ||||
|       <match>\%{_jsx-comment-pragma}</match> | ||||
|     </context> <!-- /_jsx-comment-pragma --> | ||||
|  | ||||
|     <context id="_jsx-comment-pragma-multiline-comments" style-ref="js:directive" class-disabled="no-spell-check" class="comment"> | ||||
|       <start extended="true"> | ||||
|         /\*\*? \%{js:whitespace}* @jsx \%] | ||||
|         /\* (?= /* \** \s* \%{_jsx-comment-pragma} .*? \*/ ) | ||||
|       </start> | ||||
|       <end>\*/</end> | ||||
|       <include> | ||||
|         <context ref="js:_comment-content"/> | ||||
|         <context ref="js:_multiline-comment-content"/> | ||||
|       </include> | ||||
|     </context> <!-- /_jsx-comment-pragmas-no-extend-parent --> | ||||
|     </context> <!-- /_jsx-comment-pragma-multiline-comments --> | ||||
|  | ||||
|     <context id="_comments"> | ||||
|     <context id="_multiline-comment-content"> | ||||
|       <include> | ||||
|         <context ref="_jsx-comment-pragmas"/> | ||||
|         <context ref="typescript:_comments" original="true"/> | ||||
|         <context ref="_jsx-comment-pragma"/> | ||||
|         <context ref="typescript:_multiline-comment-content" original="true"/> | ||||
|       </include> | ||||
|     </context> <!-- /_comments --> | ||||
|     </context> <!-- /_multiline-comment-content --> | ||||
|  | ||||
|     <context id="_comments-no-extend-parent"> | ||||
|       <include> | ||||
|         <context ref="_jsx-comment-pragmas-no-extend-parent"/> | ||||
|         <context ref="typescript:_comments-no-extend-parent" original="true"/> | ||||
|       </include> | ||||
|     </context> <!-- /_comments-no-extend-parent --> | ||||
|  | ||||
|     <replace id="js:comments" ref="_comments"/> | ||||
|     <replace id="js:comments-no-extend-parent" ref="_comments-no-extend-parent"/> | ||||
|     <replace id="js:_multiline-comment-content" ref="_multiline-comment-content"/> | ||||
|  | ||||
|  | ||||
|     <!-- # Types --> | ||||
| @@ -131,11 +125,7 @@ | ||||
|           \%{js:optional-whitespace-or-comments} | ||||
|           \%{js:identifier} | ||||
|           \%{js:optional-whitespace-or-comments} | ||||
|           (?: | ||||
|             \%[ extends \%] | | ||||
|             , | | ||||
|             = | ||||
|           ) | ||||
|           (?: \%{js:extends-keyword} | [,=] ) | ||||
|         ) | ||||
|       </start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
| @@ -170,7 +160,7 @@ | ||||
|         <context ref="_arrow-function-type-parameters-list"/> | ||||
|         <context ref="js-expr:_pre-lhs-expression" original="true"/> | ||||
|       </include> | ||||
|     </context> | ||||
|     </context> <!-- /_pre-lhs-expression --> | ||||
|  | ||||
|     <replace id="js-expr:_pre-lhs-expression" ref="_pre-lhs-expression"/> | ||||
|  | ||||
| @@ -185,7 +175,7 @@ | ||||
|         <context ref="jsx:_attribute-names"/> | ||||
|         <context ref="jsx:_attribute-initializers"/> | ||||
|       </include> | ||||
|     </context> | ||||
|     </context> <!-- /_start-tag-head-content --> | ||||
|  | ||||
|     <replace id="jsx:_start-tag-head-content" ref="_start-tag-head-content"/> | ||||
|  | ||||
| @@ -194,9 +184,10 @@ | ||||
|  | ||||
|     <context id="typescript-jsx" class="no-spell-check"> | ||||
|       <include> | ||||
|         <context ref="_jsx-comment-pragma-multiline-comments"/> | ||||
|         <context ref="jsx:jsx"/> | ||||
|       </include> | ||||
|     </context> | ||||
|     </context> <!-- /typescript-jsx --> | ||||
|  | ||||
|   </definitions> | ||||
| </language> | ||||
|   | ||||
| @@ -4,7 +4,7 @@ | ||||
|  This file is part of GtkSourceView | ||||
|  | ||||
|  Author: Jeffery To <jeffery.to@gmail.com> | ||||
|  Copyright (C) 2019 Jeffery To <jeffery.to@gmail.com> | ||||
|  Copyright (C) 2019-2020 Jeffery To <jeffery.to@gmail.com> | ||||
|  | ||||
|  GtkSourceView is free software; you can redistribute it and/or | ||||
|  modify it under the terms of the GNU Lesser General Public | ||||
| @@ -22,7 +22,7 @@ | ||||
| --> | ||||
| <language id="typescript-type-expr" name="TypeScript Type Expressions" version="2.0" _section="Script" hidden="true"> | ||||
|   <!-- from js:identifier-char --> | ||||
|   <keyword-char-class>[\p{L}\p{Nl}\x{1885}-\x{1886}\x{2118}\x{212E}\x{309B}-\x{309C}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{00B7}\x{0387}\x{1369}-\x{1371}\x{19DA}$\x{200C}\x{200D}]</keyword-char-class> | ||||
|   <keyword-char-class>(?!\x{2E2F})[\p{L}\p{Nl}\x{1885}-\x{1886}\x{2118}\x{212E}\x{309B}-\x{309C}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{00B7}\x{0387}\x{1369}-\x{1371}\x{19DA}$\x{200C}\x{200D}]</keyword-char-class> | ||||
|  | ||||
|   <definitions> | ||||
|  | ||||
| @@ -41,7 +41,7 @@ | ||||
|     --> | ||||
|  | ||||
|     <context id="_choice-infer-declaration" end-parent="true"> | ||||
|       <start>\%[infer\%]</start> | ||||
|       <start>\%{typescript:infer-keyword}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="typescript:type-keyword"/> | ||||
| @@ -71,22 +71,22 @@ | ||||
|         <context ref="typescript:constructor-modifier"/> | ||||
|         <context ref="typescript-type-gen:type-parameters-list"/> | ||||
|  | ||||
|         <context id="_asserts-type-predicates" style-ref="typescript:type-keyword"> | ||||
|           <keyword>asserts</keyword> | ||||
|         </context> <!-- /_asserts-type-predicates --> | ||||
|         <context id="_asserts-type-predicate" style-ref="typescript:type-keyword" once-only="true"> | ||||
|           <match>\%{typescript:asserts-keyword}</match> | ||||
|         </context> <!-- /_asserts-type-predicate --> | ||||
|  | ||||
|         <context id="_indexed-type-queries" style-ref="typescript:type-keyword"> | ||||
|           <keyword>keyof</keyword> | ||||
|         </context> <!-- /_indexed-type-queries --> | ||||
|         <context id="_indexed-type-query" style-ref="typescript:type-keyword" once-only="true"> | ||||
|           <match>\%{typescript:keyof-keyword}</match> | ||||
|         </context> <!-- /_indexed-type-query --> | ||||
|  | ||||
|         <context id="_readonly-type-modifier" style-ref="typescript:type-keyword"> | ||||
|           <keyword>readonly</keyword> | ||||
|         <context id="_readonly-type-modifier" style-ref="typescript:type-keyword" once-only="true"> | ||||
|           <match>\%{typescript:readonly-keyword}</match> | ||||
|         </context> <!-- /_readonly-type-modifier --> | ||||
|  | ||||
|         <!-- for unique symbol subtype, can contain newlines between | ||||
|              "unique" and "symbol" --> | ||||
|         <context id="_unique-symbol-subtype" style-ref="typescript:basic-type" once-only="true"> | ||||
|           <keyword>unique</keyword> | ||||
|           <match>\%{typescript:unique-keyword}</match> | ||||
|         </context> <!-- /_unique-symbol-subtype --> | ||||
|  | ||||
|       </include> | ||||
| @@ -113,41 +113,41 @@ | ||||
|     <!-- ## Type "grouping" --> | ||||
|  | ||||
|     <!-- this will only catch simple cases :-( --> | ||||
|     <context id="_choice-type-grouping-this-parameter-or-assignment-target" end-parent="true"> | ||||
|     <context id="_choice-type-grouping-this-parameter-or-binding" end-parent="true"> | ||||
|       <start extended="true"> | ||||
|         (?: | ||||
|           (?<= \.\.\. ) (?= \%{js:identifier} ) |  # adding js:optional-whitespace-or-comments in between doesn't work | ||||
|           (?= \%{js:identifier} \%{js:optional-whitespace-or-comments} [?:,] ) | ||||
|         ) | ||||
|         (?<= \%{js:rest-syntax} ) | ||||
|         (?= \%{js:identifier} ) |  # adding js:optional-whitespace-or-comments in between doesn't work | ||||
|         (?<! \%{js:identifier-char} ) | ||||
|         (?= \%{js:identifier} \%{js:optional-whitespace-or-comments} [?:,] ) | ||||
|       </start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context ref="js:comments"/> | ||||
|  | ||||
|         <context id="_type-grouping-this-parameter-or-assignment-target-content"> | ||||
|         <context id="_type-grouping-this-parameter-or-binding-content"> | ||||
|           <include> | ||||
|             <context ref="typescript:ordered-this-parameter-or-assignment-target"/> | ||||
|             <context ref="typescript:ordered-this-parameter-or-binding"/> | ||||
|           </include> | ||||
|         </context> <!-- /_type-grouping-this-parameter-or-assignment-target-content --> | ||||
|         </context> <!-- /_type-grouping-this-parameter-or-binding-content --> | ||||
|  | ||||
|       </include> | ||||
|     </context> <!-- /__choice-type-grouping-this-parameter-or-assignment-target --> | ||||
|     </context> <!-- /__choice-type-grouping-this-parameter-or-binding --> | ||||
|  | ||||
|     <context id="_type-grouping-type-expression-or-this-parameter-or-assignment-target" once-only="true"> | ||||
|     <context id="_type-grouping-type-expression-or-this-parameter-or-binding" once-only="true"> | ||||
|       <start>\%{js:before-next-token}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <!-- no comments here --> | ||||
|  | ||||
|         <context id="_type-grouping-type-expression-or-this-parameter-or-assignment-target-content"> | ||||
|         <context id="_type-grouping-type-expression-or-this-parameter-or-binding-content"> | ||||
|           <include> | ||||
|             <context ref="_choice-type-grouping-this-parameter-or-assignment-target"/> | ||||
|             <context ref="_choice-type-grouping-this-parameter-or-binding"/> | ||||
|             <context ref="choice-type-expression"/> | ||||
|           </include> | ||||
|         </context> <!-- /_type-grouping-type-expression-or-this-parameter-or-assignment-target-content --> | ||||
|         </context> <!-- /_type-grouping-type-expression-or-this-parameter-or-binding-content --> | ||||
|  | ||||
|       </include> | ||||
|     </context> <!-- /_type-grouping-type-expression-or-this-parameter-or-assignment-target --> | ||||
|     </context> <!-- /_type-grouping-type-expression-or-this-parameter-or-binding --> | ||||
|  | ||||
|     <!-- function parameter list allows for accessibility modifiers and | ||||
|          default value assignment, but these are not allowed in a | ||||
| @@ -173,7 +173,7 @@ | ||||
|                 <context id="_type-grouping-first-item-content"> | ||||
|                   <include> | ||||
|                     <context ref="js:ordered-rest-syntax"/> | ||||
|                     <context ref="_type-grouping-type-expression-or-this-parameter-or-assignment-target"/> | ||||
|                     <context ref="_type-grouping-type-expression-or-this-parameter-or-binding"/> | ||||
|                     <context ref="typescript:ordered-optional-modifier"/> | ||||
|                     <context ref="typescript:ordered-type-annotation"/> | ||||
|                   </include> | ||||
| @@ -191,7 +191,7 @@ | ||||
|                 <context id="_type-grouping-item-content"> | ||||
|                   <include> | ||||
|                     <context ref="js:ordered-rest-syntax"/> | ||||
|                     <context ref="js:ordered-assignment-target"/> | ||||
|                     <context ref="js:ordered-binding"/> | ||||
|                     <context ref="typescript:ordered-optional-modifier"/> | ||||
|                     <context ref="typescript:ordered-type-annotation"/> | ||||
|                   </include> | ||||
| @@ -281,7 +281,7 @@ | ||||
|  | ||||
|             <!-- <TypeQuery> --> | ||||
|             <context id="_choice-type-query" style-ref="typescript:type-query" end-parent="true"> | ||||
|               <start>\%[typeof\%]</start> | ||||
|               <start>\%{js:typeof-keyword}</start> | ||||
|               <end>\%{js:before-next-token}</end> | ||||
|               <include> | ||||
|                 <context sub-pattern="0" where="start" style-ref="typescript:type-keyword"/> | ||||
| @@ -330,21 +330,21 @@ | ||||
|       <end>\%{def:always-match}</end> | ||||
|     </context> <!-- /_choice-conditional-type-operator-missing-true-type --> | ||||
|  | ||||
|     <context id="_conditional-type-operator-false-clause" once-only="true"> | ||||
|     <context id="_conditional-type-operator-false-type" once-only="true"> | ||||
|       <start>:</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="typescript:conditional-type-operator"/> | ||||
|         <context ref="js:comments"/> | ||||
|  | ||||
|         <context id="_conditional-type-operator-false-clause-content"> | ||||
|         <context id="_conditional-type-operator-false-type-content"> | ||||
|           <include> | ||||
|             <context ref="type-expression"/> | ||||
|           </include> | ||||
|         </context> <!-- /_conditional-type-operator-false-clause-content --> | ||||
|         </context> <!-- /_conditional-type-operator-false-type-content --> | ||||
|  | ||||
|       </include> | ||||
|     </context> <!-- /_conditional-type-operator-false-clause --> | ||||
|     </context> <!-- /_conditional-type-operator-false-type --> | ||||
|  | ||||
|     <context id="_choice-conditional-type-operator-true-type" end-parent="true"> | ||||
|       <start>\%{js:before-next-token}</start> | ||||
| @@ -355,7 +355,7 @@ | ||||
|         <context id="_conditional-type-operator-true-type-content"> | ||||
|           <include> | ||||
|             <context ref="type-expression"/> | ||||
|             <context ref="_conditional-type-operator-false-clause"/> | ||||
|             <context ref="_conditional-type-operator-false-type"/> | ||||
|           </include> | ||||
|         </context> <!-- /_conditional-type-operator-true-type-content --> | ||||
|  | ||||
| @@ -396,7 +396,7 @@ | ||||
|     </context> <!-- /_choice-conditional-type-operator-super-type --> | ||||
|  | ||||
|     <context id="_conditional-type-operators"> | ||||
|       <start>\%[extends\%]</start> | ||||
|       <start>\%{js:extends-keyword}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="typescript:type-keyword"/> | ||||
| @@ -463,7 +463,7 @@ | ||||
|         </context> <!-- /_union-intersection-type-operators --> | ||||
|  | ||||
|         <context id="_type-predicate-operators"> | ||||
|           <start>\%[is\%]</start> | ||||
|           <start>\%{typescript:is-keyword}</start> | ||||
|           <end>\%{js:before-next-token}</end> | ||||
|           <include> | ||||
|             <context sub-pattern="0" where="start" style-ref="typescript:type-keyword"/> | ||||
|   | ||||
| @@ -4,7 +4,7 @@ | ||||
|  This file is part of GtkSourceView | ||||
|  | ||||
|  Author: Jeffery To <jeffery.to@gmail.com> | ||||
|  Copyright (C) 2019 Jeffery To <jeffery.to@gmail.com> | ||||
|  Copyright (C) 2019-2020 Jeffery To <jeffery.to@gmail.com> | ||||
|  | ||||
|  GtkSourceView is free software; you can redistribute it and/or | ||||
|  modify it under the terms of the GNU Lesser General Public | ||||
| @@ -22,7 +22,7 @@ | ||||
| --> | ||||
| <language id="typescript-type-gen" name="TypeScript Type Generics" version="2.0" _section="Script" hidden="true"> | ||||
|   <!-- from js:identifier-char --> | ||||
|   <keyword-char-class>[\p{L}\p{Nl}\x{1885}-\x{1886}\x{2118}\x{212E}\x{309B}-\x{309C}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{00B7}\x{0387}\x{1369}-\x{1371}\x{19DA}$\x{200C}\x{200D}]</keyword-char-class> | ||||
|   <keyword-char-class>(?!\x{2E2F})[\p{L}\p{Nl}\x{1885}-\x{1886}\x{2118}\x{212E}\x{309B}-\x{309C}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{00B7}\x{0387}\x{1369}-\x{1371}\x{19DA}$\x{200C}\x{200D}]</keyword-char-class> | ||||
|  | ||||
|   <definitions> | ||||
|  | ||||
| @@ -39,7 +39,7 @@ | ||||
|  | ||||
|     <!-- <Constraint> --> | ||||
|     <context id="_type-parameter-constraint" once-only="true"> | ||||
|       <start>\%[extends\%]</start> | ||||
|       <start>\%{js:extends-keyword}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="typescript:type-keyword"/> | ||||
| @@ -151,8 +151,8 @@ | ||||
|     --> | ||||
|  | ||||
|     <context id="const-type-assertion-keyword-end-parent" style-ref="typescript:type-keyword" end-parent="true"> | ||||
|       <start>(?=\%[const\%])</start> | ||||
|       <end>const</end> | ||||
|       <start>(?=\%{js:const-keyword})</start> | ||||
|       <end>\%{js:const-keyword}</end> | ||||
|     </context> <!-- /const-type-assertion-keyword-end-parent --> | ||||
|  | ||||
|     <context id="_type-parameters-list-or-type-assertion-first-parameter" once-only="true"> | ||||
|   | ||||
| @@ -4,7 +4,7 @@ | ||||
|  This file is part of GtkSourceView | ||||
|  | ||||
|  Author: Jeffery To <jeffery.to@gmail.com> | ||||
|  Copyright (C) 2019 Jeffery To <jeffery.to@gmail.com> | ||||
|  Copyright (C) 2019-2020 Jeffery To <jeffery.to@gmail.com> | ||||
|  | ||||
|  GtkSourceView is free software; you can redistribute it and/or | ||||
|  modify it under the terms of the GNU Lesser General Public | ||||
| @@ -22,7 +22,7 @@ | ||||
| --> | ||||
| <language id="typescript-type-lit" name="TypeScript Type Literals" version="2.0" _section="Script" hidden="true"> | ||||
|   <!-- from js:identifier-char --> | ||||
|   <keyword-char-class>[\p{L}\p{Nl}\x{1885}-\x{1886}\x{2118}\x{212E}\x{309B}-\x{309C}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{00B7}\x{0387}\x{1369}-\x{1371}\x{19DA}$\x{200C}\x{200D}]</keyword-char-class> | ||||
|   <keyword-char-class>(?!\x{2E2F})[\p{L}\p{Nl}\x{1885}-\x{1886}\x{2118}\x{212E}\x{309B}-\x{309C}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{00B7}\x{0387}\x{1369}-\x{1371}\x{19DA}$\x{200C}\x{200D}]</keyword-char-class> | ||||
|  | ||||
|   <definitions> | ||||
|  | ||||
| @@ -38,24 +38,18 @@ | ||||
|     --> | ||||
|  | ||||
|     <define-regex id="_basic-types" extended="true"> | ||||
|       (?: | ||||
|         \%[ | ||||
|         (?: | ||||
|           any | | ||||
|           bigint | | ||||
|           boolean | | ||||
|           never | | ||||
|           null | | ||||
|           number | | ||||
|           object | | ||||
|           string | | ||||
|           symbol | | ||||
|           undefined | | ||||
|           unknown | | ||||
|           void | ||||
|         ) | ||||
|         \%] | ||||
|       ) | ||||
|       \%{typescript:any-keyword} | | ||||
|       \%{typescript:bigint-keyword} | | ||||
|       \%{typescript:boolean-keyword} | | ||||
|       \%{typescript:never-keyword} | | ||||
|       \%{js:null-keyword} | | ||||
|       \%{typescript:number-keyword} | | ||||
|       \%{typescript:object-keyword} | | ||||
|       \%{typescript:string-keyword} | | ||||
|       \%{typescript:symbol-keyword} | | ||||
|       \%{typescript:undefined-keyword} | | ||||
|       \%{typescript:unknown-keyword} | | ||||
|       \%{js:void-keyword} | ||||
|     </define-regex> <!-- /_basic-types --> | ||||
|  | ||||
|     <!-- <PredefinedType> --> | ||||
| @@ -71,14 +65,14 @@ | ||||
|          false | ||||
|     --> | ||||
|  | ||||
|     <define-regex id="_boolean-types" extended="true"> | ||||
|       (?: \%[ (?: false | true ) \%] ) | ||||
|     </define-regex> <!-- /_boolean-literal-types --> | ||||
|  | ||||
|     <!-- <PredefinedType> --> | ||||
|     <context id="choice-boolean-type" style-ref="typescript:boolean-type" end-parent="true"> | ||||
|       <start>(?=\%{_boolean-types})</start> | ||||
|       <end>\%{_boolean-types}</end> | ||||
|       <start extended="true"> | ||||
|         (?= \%{js:false-keyword} | \%{js:true-keyword} ) | ||||
|       </start> | ||||
|       <end extended="true"> | ||||
|         \%{js:false-keyword} | \%{js:true-keyword} | ||||
|       </end> | ||||
|     </context> <!-- /choice-boolean-type --> | ||||
|  | ||||
|  | ||||
| @@ -109,8 +103,8 @@ | ||||
|  | ||||
|     <!-- <ThisType> --> | ||||
|     <context id="choice-this-type" style-ref="typescript:basic-type" end-parent="true"> | ||||
|       <start>(?=\%[this\%])</start> | ||||
|       <end>this</end> | ||||
|       <start>(?=\%{js:this-keyword})</start> | ||||
|       <end>\%{js:this-keyword}</end> | ||||
|     </context> <!-- /choice-this-type --> | ||||
|  | ||||
|  | ||||
| @@ -203,7 +197,8 @@ | ||||
|           <include> | ||||
|  | ||||
|             <context id="_choice-object-type-literal-modifier-keyword" style-ref="typescript:type-keyword" end-parent="true"> | ||||
|               <keyword>readonly</keyword> | ||||
|               <start>(?=\%{typescript:readonly-keyword})</start> | ||||
|               <end>\%{typescript:readonly-keyword}</end> | ||||
|             </context> <!-- /_choice-object-type-literal-modifier-keyword --> | ||||
|  | ||||
|           </include> | ||||
| @@ -237,7 +232,7 @@ | ||||
|             <context ref="typescript:choice-type-annotation"/> | ||||
|  | ||||
|             <context id="_choice-mapped-type" end-parent="true"> | ||||
|               <start>\%[in\%]</start> | ||||
|               <start>\%{js:in-keyword}</start> | ||||
|               <end>\%{js:before-next-token}</end> | ||||
|               <include> | ||||
|                 <context sub-pattern="0" where="start" style-ref="typescript:type-keyword"/> | ||||
|   | ||||
| @@ -4,7 +4,7 @@ | ||||
|  This file is part of GtkSourceView | ||||
|  | ||||
|  Author: Jeffery To <jeffery.to@gmail.com> | ||||
|  Copyright (C) 2019 Jeffery To <jeffery.to@gmail.com> | ||||
|  Copyright (C) 2019-2020 Jeffery To <jeffery.to@gmail.com> | ||||
|  | ||||
|  GtkSourceView is free software; you can redistribute it and/or | ||||
|  modify it under the terms of the GNU Lesser General Public | ||||
| @@ -88,7 +88,7 @@ | ||||
|   </styles> | ||||
|  | ||||
|   <!-- from js:identifier-char --> | ||||
|   <keyword-char-class>[\p{L}\p{Nl}\x{1885}-\x{1886}\x{2118}\x{212E}\x{309B}-\x{309C}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{00B7}\x{0387}\x{1369}-\x{1371}\x{19DA}$\x{200C}\x{200D}]</keyword-char-class> | ||||
|   <keyword-char-class>(?!\x{2E2F})[\p{L}\p{Nl}\x{1885}-\x{1886}\x{2118}\x{212E}\x{309B}-\x{309C}\p{Mn}\p{Mc}\p{Nd}\p{Pc}\x{00B7}\x{0387}\x{1369}-\x{1371}\x{19DA}$\x{200C}\x{200D}]</keyword-char-class> | ||||
|  | ||||
|   <definitions> | ||||
|  | ||||
| @@ -98,7 +98,7 @@ | ||||
|          https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md | ||||
|          https://www.typescriptlang.org/ | ||||
|  | ||||
|          Supported level: TypeScript 3.7 | ||||
|          Supported level: TypeScript 3.9 | ||||
|  | ||||
|          Naming conventions described in javascript.lang | ||||
|     --> | ||||
| @@ -111,27 +111,129 @@ | ||||
|           so we move the definitions of these regexes here | ||||
|     --> | ||||
|  | ||||
|     <define-regex id="import-meta-object-keyword-suffix" extended="true"> | ||||
|       (?: | ||||
|         \%{js:optional-whitespace-or-comments} | ||||
|         \. | ||||
|         \%{js:optional-whitespace-or-comments} | ||||
|         meta \%] | ||||
|       ) | ||||
|     </define-regex> <!-- /import-meta-object-keyword-suffix --> | ||||
|     <define-regex id="abstract-keyword" extended="true"> | ||||
|       \%{js:keyword-start} abstract \%{js:keyword-end} | ||||
|     </define-regex> <!-- /abstract-keyword --> | ||||
|  | ||||
|     <define-regex id="any-keyword" extended="true"> | ||||
|       \%{js:keyword-start} any \%{js:keyword-end} | ||||
|     </define-regex> <!-- /any-keyword --> | ||||
|  | ||||
|     <define-regex id="asserts-keyword" extended="true"> | ||||
|       \%{js:keyword-start} asserts \%{js:keyword-end} | ||||
|     </define-regex> <!-- /asserts-keyword --> | ||||
|  | ||||
|     <define-regex id="bigint-keyword" extended="true"> | ||||
|       \%{js:keyword-start} bigint \%{js:keyword-end} | ||||
|     </define-regex> <!-- /bigint-keyword --> | ||||
|  | ||||
|     <define-regex id="boolean-keyword" extended="true"> | ||||
|       \%{js:keyword-start} boolean \%{js:keyword-end} | ||||
|     </define-regex> <!-- /boolean-keyword --> | ||||
|  | ||||
|     <define-regex id="declare-keyword" extended="true"> | ||||
|       \%{js:keyword-start} declare \%{js:keyword-end} | ||||
|     </define-regex> <!-- /declare-keyword --> | ||||
|  | ||||
|     <define-regex id="enum-keyword" extended="true"> | ||||
|       \%{js:keyword-start} enum \%{js:keyword-end} | ||||
|     </define-regex> <!-- /enum-keyword --> | ||||
|  | ||||
|     <define-regex id="global-keyword" extended="true"> | ||||
|       \%{js:keyword-start} global \%{js:keyword-end} | ||||
|     </define-regex> <!-- /global-keyword --> | ||||
|  | ||||
|     <define-regex id="implements-keyword" extended="true"> | ||||
|       \%{js:keyword-start} implements \%{js:keyword-end} | ||||
|     </define-regex> <!-- /implements-keyword --> | ||||
|  | ||||
|     <define-regex id="infer-keyword" extended="true"> | ||||
|       \%{js:keyword-start} infer \%{js:keyword-end} | ||||
|     </define-regex> <!-- /infer-keyword --> | ||||
|  | ||||
|     <define-regex id="interface-keyword" extended="true"> | ||||
|       \%{js:keyword-start} interface \%{js:keyword-end} | ||||
|     </define-regex> <!-- /interface-keyword --> | ||||
|  | ||||
|     <define-regex id="is-keyword" extended="true"> | ||||
|       \%{js:keyword-start} is \%{js:keyword-end} | ||||
|     </define-regex> <!-- /is-keyword --> | ||||
|  | ||||
|     <define-regex id="keyof-keyword" extended="true"> | ||||
|       \%{js:keyword-start} keyof \%{js:keyword-end} | ||||
|     </define-regex> <!-- /keyof-keyword --> | ||||
|  | ||||
|     <define-regex id="module-keyword" extended="true"> | ||||
|       \%{js:keyword-start} module \%{js:keyword-end} | ||||
|     </define-regex> <!-- /module-keyword --> | ||||
|  | ||||
|     <define-regex id="namespace-keyword" extended="true"> | ||||
|       \%{js:keyword-start} namespace \%{js:keyword-end} | ||||
|     </define-regex> <!-- /namespace-keyword --> | ||||
|  | ||||
|     <define-regex id="never-keyword" extended="true"> | ||||
|       \%{js:keyword-start} never \%{js:keyword-end} | ||||
|     </define-regex> <!-- /never-keyword --> | ||||
|  | ||||
|     <define-regex id="number-keyword" extended="true"> | ||||
|       \%{js:keyword-start} number \%{js:keyword-end} | ||||
|     </define-regex> <!-- /number-keyword --> | ||||
|  | ||||
|     <define-regex id="object-keyword" extended="true"> | ||||
|       \%{js:keyword-start} object \%{js:keyword-end} | ||||
|     </define-regex> <!-- /object-keyword --> | ||||
|  | ||||
|     <define-regex id="private-keyword" extended="true"> | ||||
|       \%{js:keyword-start} private \%{js:keyword-end} | ||||
|     </define-regex> <!-- /private-keyword --> | ||||
|  | ||||
|     <define-regex id="protected-keyword" extended="true"> | ||||
|       \%{js:keyword-start} protected \%{js:keyword-end} | ||||
|     </define-regex> <!-- /protected-keyword --> | ||||
|  | ||||
|     <define-regex id="public-keyword" extended="true"> | ||||
|       \%{js:keyword-start} public \%{js:keyword-end} | ||||
|     </define-regex> <!-- /public-keyword --> | ||||
|  | ||||
|     <define-regex id="readonly-keyword" extended="true"> | ||||
|       \%{js:keyword-start} readonly \%{js:keyword-end} | ||||
|     </define-regex> <!-- /readonly-keyword --> | ||||
|  | ||||
|     <define-regex id="require-keyword" extended="true"> | ||||
|       \%{js:keyword-start} require \%{js:keyword-end} | ||||
|     </define-regex> <!-- /require-keyword --> | ||||
|  | ||||
|     <define-regex id="string-keyword" extended="true"> | ||||
|       \%{js:keyword-start} string \%{js:keyword-end} | ||||
|     </define-regex> <!-- /string-keyword --> | ||||
|  | ||||
|     <define-regex id="symbol-keyword" extended="true"> | ||||
|       \%{js:keyword-start} symbol \%{js:keyword-end} | ||||
|     </define-regex> <!-- /symbol-keyword --> | ||||
|  | ||||
|     <define-regex id="type-keyword" extended="true"> | ||||
|       \%{js:keyword-start} type \%{js:keyword-end} | ||||
|     </define-regex> <!-- /type-keyword --> | ||||
|  | ||||
|     <define-regex id="undefined-keyword" extended="true"> | ||||
|       \%{js:keyword-start} undefined \%{js:keyword-end} | ||||
|     </define-regex> <!-- /undefined-keyword --> | ||||
|  | ||||
|     <define-regex id="unique-keyword" extended="true"> | ||||
|       \%{js:keyword-start} unique \%{js:keyword-end} | ||||
|     </define-regex> <!-- /unique-keyword --> | ||||
|  | ||||
|     <define-regex id="unknown-keyword" extended="true"> | ||||
|       \%{js:keyword-start} unknown \%{js:keyword-end} | ||||
|     </define-regex> <!-- /unknown-keyword --> | ||||
|  | ||||
|     <!-- no line terminator allowed between "abstract" and "class" | ||||
|          technically, there can be abstract class declarations but not | ||||
|          abstract class expressions --> | ||||
|     <define-regex id="class-expression-keyword" extended="true"> | ||||
|       (?: | ||||
|         (?: | ||||
|           \%[ abstract \%] | ||||
|           \%{js:optional-whitespace-or-comments} | ||||
|         )? | ||||
|         \%[ class \%] | ||||
|       ) | ||||
|     </define-regex> <!-- / --> | ||||
|       (?: \%{abstract-keyword} \%{js:optional-whitespace-or-comments} )? | ||||
|       \%{js:class-keyword} | ||||
|     </define-regex> <!-- /class-expression-keyword --> | ||||
|  | ||||
|     <context id="js-ordered-string" once-only="true"> | ||||
|       <start>\%{js:before-next-token}</start> | ||||
| @@ -141,33 +243,84 @@ | ||||
|       </include> | ||||
|     </context> <!-- /js-ordered-string --> | ||||
|  | ||||
|     <!-- ## @ts-ignore comment pragma | ||||
|     <!-- ## @ts-ignore / @ts-expect-error comment pragma | ||||
|  | ||||
|          // @ts-ignore | ||||
|          /* @ts-expect-error some reasons */ | ||||
|  | ||||
|          can be at the start of a double- or triple-slash comment | ||||
|          https://github.com/microsoft/TypeScript/blob/3c49fb0d9ffb67fd645835589d66687b4fb7543a/src/compiler/scanner.ts#L275 | ||||
|  | ||||
|          can also be on the last line of a multi-line comment | ||||
|          https://github.com/microsoft/TypeScript/blob/3c49fb0d9ffb67fd645835589d66687b4fb7543a/src/compiler/scanner.ts#L280 | ||||
|  | ||||
|          in both cases, the pragma should be at the start of the | ||||
|          line/comment, but in practice there can be code before the | ||||
|          comment (on the same line) | ||||
|  | ||||
|          also the regexes don't test for a word break, so any characters | ||||
|          can immediately follow the pragmas | ||||
|     --> | ||||
|  | ||||
|     <!-- can be double- or triple-slash | ||||
|          pragma must be at start of comment | ||||
|          technically, must be at the start of the line | ||||
|          https://github.com/microsoft/TypeScript/blob/e82d0af554d96738b2e8c7f9027e53ac8bc31007/src/compiler/program.ts#L2 | ||||
|     --> | ||||
|     <context id="_ts-ignore-comment-pragmas" style-ref="js:directive" end-at-line-end="true" class="comment"> | ||||
|       <start extended="true"> | ||||
|         ///? \%{js:whitespace}* @ts-ignore \%] | ||||
|       </start> | ||||
|       <include> | ||||
|         <context ref="js:_comment-content"/> | ||||
|       </include> | ||||
|     </context> <!-- /_ts-ignore-comment-pragmas --> | ||||
|     <define-regex id="_ts-ignore-comment-pragma" extended="true"> | ||||
|       @ (?: ts-expect-error | ts-ignore ) | ||||
|     </define-regex> <!-- /_ts-ignore-comment-pragma --> | ||||
|  | ||||
|     <context id="_ts-ignore-comment-pragmas-no-extend-parent" style-ref="js:directive" end-at-line-end="true" class="comment" extend-parent="false"> | ||||
|     <context id="_ts-ignore-comment-pragma" style-ref="js:directive" class="no-spell-check" once-only="true"> | ||||
|       <match>\%{_ts-ignore-comment-pragma}</match> | ||||
|     </context> <!-- /_ts-ignore-comment-pragma --> | ||||
|  | ||||
|     <context id="_ts-ignore-comment-pragma-single-line-comments" style-ref="js:directive" end-at-line-end="true" class-disabled="no-spell-check" class="comment"> | ||||
|       <start extended="true"> | ||||
|         ///? \%{js:whitespace}* @ts-ignore \%] | ||||
|         // (?= /? \s* \%{_ts-ignore-comment-pragma} ) | ||||
|       </start> | ||||
|       <include> | ||||
|         <context ref="js:_comment-content"/> | ||||
|         <context ref="_ts-ignore-comment-pragma"/> | ||||
|         <context ref="js:_single-line-comment-content"/> | ||||
|       </include> | ||||
|     </context> <!-- /_ts-ignore-comment-pragmas-no-extend-parent --> | ||||
|     </context> <!-- /_ts-ignore-comment-pragma-single-line-comments --> | ||||
|  | ||||
|     <context id="_ts-ignore-comment-pragma-single-line-comments-no-extend-parent" style-ref="js:directive" end-at-line-end="true" class-disabled="no-spell-check" class="comment" extend-parent="false"> | ||||
|       <start extended="true"> | ||||
|         // (?= /? \s* \%{_ts-ignore-comment-pragma} ) | ||||
|       </start> | ||||
|       <include> | ||||
|         <context ref="_ts-ignore-comment-pragma"/> | ||||
|         <context ref="js:_single-line-comment-content"/> | ||||
|       </include> | ||||
|     </context> <!-- /_ts-ignore-comment-pragma-single-line-comments-no-extend-parent --> | ||||
|  | ||||
|     <context id="_ts-ignore-comment-pragmas-multiline-comments" style-ref="js:directive" class-disabled="no-spell-check" class="comment"> | ||||
|       <start extended="true"> | ||||
|         /\* (?= /* \** \s* \%{_ts-ignore-comment-pragma} .*? \*/ ) | ||||
|       </start> | ||||
|       <end>\*/</end> | ||||
|       <include> | ||||
|         <context ref="_ts-ignore-comment-pragma"/> | ||||
|         <context ref="_multiline-comment-content"/> | ||||
|       </include> | ||||
|     </context> <!-- /_ts-ignore-comment-pragmas-multiline-comments --> | ||||
|  | ||||
|     <context id="_ts-ignore-comment-pragmas-multiline-comments-no-extend-parent" style-ref="js:directive" class-disabled="no-spell-check" class="comment" extend-parent="false"> | ||||
|       <start extended="true"> | ||||
|         /\* (?= /* \** \s* \%{_ts-ignore-comment-pragma} .*? \*/ ) | ||||
|       </start> | ||||
|       <end>\*/</end> | ||||
|       <include> | ||||
|         <context ref="_ts-ignore-comment-pragma"/> | ||||
|         <context ref="_multiline-comment-content"/> | ||||
|       </include> | ||||
|     </context> <!-- /_ts-ignore-comment-pragmas-multiline-comments-no-extend-parent --> | ||||
|  | ||||
|     <context id="_ts-ignore-comment-pragma-multiline-comment-last-line" once-only="true"> | ||||
|       <start extended="true"> | ||||
|         ^ \s* /* \** \s* (?= \%{_ts-ignore-comment-pragma} .*? \*/ ) | ||||
|       </start> | ||||
|       <end>\%{def:always-match}</end> | ||||
|       <include> | ||||
|         <context ref="_ts-ignore-comment-pragma"/> | ||||
|       </include> | ||||
|     </context> <!-- /_ts-ignore-comment-pragma-multiline-comment-last-line --> | ||||
|  | ||||
|     <!-- ## @ts-nocheck comment pragma | ||||
|  | ||||
| @@ -175,42 +328,63 @@ | ||||
|  | ||||
|          can only be preceded by comments or other triple-slash | ||||
|          directives (i.e. at the top of a file) | ||||
|          appears to be case-insensitive (cannot find code reference though) | ||||
|          case-insensitive ("i" modifier on regex) | ||||
|          https://github.com/microsoft/TypeScript/blob/3c49fb0d9ffb67fd645835589d66687b4fb7543a/src/services/classifier.ts#L768 | ||||
|     --> | ||||
|  | ||||
|     <context id="_ts-nocheck-comment-pragmas" style-ref="js:directive" end-at-line-end="true" class="comment"> | ||||
|     <define-regex id="_ts-nocheck-comment-pragma" case-sensitive="false" extended="true"> | ||||
|       @ts-nocheck (?! \S ) | ||||
|     </define-regex> <!-- /_ts-nocheck-comment-pragma --> | ||||
|  | ||||
|     <context id="_ts-nocheck-comment-pragma-comments" style-ref="js:directive" end-at-line-end="true" class-disabled="no-spell-check" class="comment"> | ||||
|       <start case-sensitive="false" extended="true"> | ||||
|         ///? \s* @ts-nocheck \%] | ||||
|         // (?= /? \s* \%{_ts-nocheck-comment-pragma} ) | ||||
|       </start> | ||||
|       <include> | ||||
|         <context ref="js:_comment-content"/> | ||||
|  | ||||
|         <context id="_ts-nocheck-comment-pragma" class="no-spell-check" once-only="true"> | ||||
|           <match>\%{_ts-nocheck-comment-pragma}</match> | ||||
|         </context> <!-- /_ts-nocheck-comment-pragma --> | ||||
|  | ||||
|         <context ref="js:_single-line-comment-content"/> | ||||
|       </include> | ||||
|     </context> <!-- /_ts-nocheck-comment-pragmas --> | ||||
|     </context> <!-- /_ts-nocheck-comment-pragma-comments --> | ||||
|  | ||||
|     <!-- ## Triple-slash directive | ||||
|  | ||||
|          /// <reference path="..." | ||||
|          /// <reference path="..." /> | ||||
|  | ||||
|          can only be preceded by comments or other triple-slash | ||||
|          directives (i.e. at the top of a file) | ||||
|          appears to be case-insensitive | ||||
|          https://github.com/microsoft/TypeScript/blob/ef0cca7d12a320bc98cefebbf4d391de36003149/src/services/classifier.ts#L768 | ||||
|          case-insensitive ("i" modifier on regex) | ||||
|          https://github.com/microsoft/TypeScript/blob/3c49fb0d9ffb67fd645835589d66687b4fb7543a/src/services/classifier.ts#L768 | ||||
|     --> | ||||
|  | ||||
|     <context id="_triple-slash-directives" style-ref="js:directive" end-at-line-end="true" class="comment"> | ||||
|       <start case-sensitive="false" extended="true"> | ||||
|         /// \%{js:whitespace}* < | ||||
|         ( | ||||
|           amd-module | | ||||
|           amd-dependency | | ||||
|           reference | ||||
|         ) | ||||
|         \%{js:whitespace} | ||||
|     <define-regex id="_triple-slash-directive" case-sensitive="false" extended="true"> | ||||
|       < | ||||
|       (?: amd-module | amd-dependency | reference ) | ||||
|       (?> | ||||
|         (?: | ||||
|           \s+ | | ||||
|           (?<= \s ) [\w-]+ \s* = \s* (?: '[^']*' | "[^"]*" ) | ||||
|         )* | ||||
|       ) | ||||
|       /> | ||||
|     </define-regex> <!-- /_triple-slash-directive --> | ||||
|  | ||||
|     <context id="_triple-slash-directive-comments" style-ref="js:directive" end-at-line-end="true" class-disabled="no-spell-check" class="comment"> | ||||
|       <start extended="true"> | ||||
|         /// (?= \s* \%{_triple-slash-directive} ) | ||||
|       </start> | ||||
|       <include> | ||||
|         <context ref="js:_comment-content"/> | ||||
|  | ||||
|         <context id="_triple-slash-directive" class="no-spell-check" once-only="true"> | ||||
|           <match>\%{_triple-slash-directive}</match> | ||||
|         </context> <!-- /_triple-slash-directive --> | ||||
|  | ||||
|         <context ref="js:_single-line-comment-content"/> | ||||
|       </include> | ||||
|     </context> <!-- /_triple-slash-directives --> | ||||
|     </context> <!-- /_triple-slash-directive-comments --> | ||||
|  | ||||
|     <!-- ## Namespace name | ||||
|  | ||||
| @@ -225,7 +399,7 @@ | ||||
|  | ||||
|     <!-- <NamespaceName> --> | ||||
|     <context id="choice-namespace-name" end-parent="true"> | ||||
|       <start>(?=\%{js:identifier-start})</start> | ||||
|       <start>\%{js:identifier-container-start}</start> | ||||
|       <end>\%{def:always-match}</end> | ||||
|       <include> | ||||
|         <!-- no comments here --> | ||||
| @@ -263,10 +437,36 @@ | ||||
|       </include> | ||||
|     </context> <!-- /ordered-namespace-name --> | ||||
|  | ||||
|     <!-- ## Private identifier (stage 3 proposal) | ||||
|  | ||||
|          #identifier | ||||
|     --> | ||||
|  | ||||
|     <!-- <PrivateIdentifier> --> | ||||
|     <context id="choice-private-identifier" end-parent="true"> | ||||
|       <start>#(?=\%{js:identifier-start})</start> | ||||
|       <end>\%{def:always-match}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="js:identifier"/> | ||||
|         <!-- no comments here --> | ||||
|         <!-- do not extend the context by matching comments, which may | ||||
|              lead to multiple identifiers --> | ||||
|         <context ref="js:_identifier-name-content"/> | ||||
|       </include> | ||||
|     </context> <!-- /choice-private-identifier --> | ||||
|  | ||||
|     <context id="ordered-private-identifier" once-only="true"> | ||||
|       <start>\%{js:before-next-token}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context ref="choice-private-identifier"/> | ||||
|       </include> | ||||
|     </context> <!-- /ordered-private-identifier --> | ||||
|  | ||||
|     <!-- ## Constructor modifier --> | ||||
|  | ||||
|     <context id="constructor-modifier" style-ref="type-keyword" once-only="true"> | ||||
|       <keyword>new</keyword> | ||||
|       <match>\%{js:new-keyword}</match> | ||||
|     </context> <!-- /constructor-modifier --> | ||||
|  | ||||
|     <context id="ordered-constructor-modifier" once-only="true"> | ||||
| @@ -316,44 +516,44 @@ | ||||
|       </include> | ||||
|     </context> <!-- /ordered-definite-assignment-assertion --> | ||||
|  | ||||
|     <!-- ## this parameter or assignment target --> | ||||
|     <!-- ## this parameter or binding --> | ||||
|  | ||||
|     <context id="_this-parameter-or-assignment-target" once-only="true"> | ||||
|     <context id="_this-parameter-or-binding" once-only="true"> | ||||
|       <start>\%{js:before-next-token}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context ref="js:comments"/> | ||||
|  | ||||
|         <context id="_this-parameter-or-assignment-target-content"> | ||||
|         <context id="_this-parameter-or-binding-content"> | ||||
|           <include> | ||||
|  | ||||
|             <context id="_choice-this-parameter" style-ref="js:keyword" end-parent="true"> | ||||
|               <keyword>this</keyword> | ||||
|               <match>\%{js:this-keyword}</match> | ||||
|             </context> <!-- /_choice-this-parameter --> | ||||
|  | ||||
|             <context id="_js-choice-assignment-target" end-parent="true"> | ||||
|             <context id="_js-choice-binding" end-parent="true"> | ||||
|               <start>\%{js:before-next-token}</start> | ||||
|               <end>\%{js:before-next-token}</end> | ||||
|               <include> | ||||
|                 <context ref="js:embedded-lang-hooks"/> | ||||
|                 <context ref="js:comments"/> | ||||
|                 <context ref="js:_assignment-target-content"/> | ||||
|                 <context ref="js:_binding-content"/> | ||||
|               </include> | ||||
|             </context> <!-- /_js-choice-assignment-target --> | ||||
|             </context> <!-- /_js-choice-binding --> | ||||
|  | ||||
|           </include> | ||||
|         </context> <!-- /_this-parameter-or-assignment-target-content --> | ||||
|         </context> <!-- /_this-parameter-or-binding-content --> | ||||
|  | ||||
|       </include> | ||||
|     </context> <!-- /_this-parameter-or-assignment-target --> | ||||
|     </context> <!-- /_this-parameter-or-binding --> | ||||
|  | ||||
|     <context id="ordered-this-parameter-or-assignment-target" once-only="true"> | ||||
|     <context id="ordered-this-parameter-or-binding" once-only="true"> | ||||
|       <start>\%{js:before-next-token}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context ref="_this-parameter-or-assignment-target"/> | ||||
|         <context ref="_this-parameter-or-binding"/> | ||||
|       </include> | ||||
|     </context> <!-- /ordered-this-parameter-or-assignment-target --> | ||||
|     </context> <!-- /ordered-this-parameter-or-binding --> | ||||
|  | ||||
|     <!-- ## Decorators | ||||
|  | ||||
| @@ -415,7 +615,7 @@ | ||||
|         </context> <!-- /_decorator-dot-property-accessor-content --> | ||||
|  | ||||
|       </include> | ||||
|     </context> | ||||
|     </context> <!-- /_decorator-dot-property-accessors --> | ||||
|  | ||||
|     <context id="decorators" style-ref="decorator"> | ||||
|       <start>@</start> | ||||
| @@ -450,6 +650,8 @@ | ||||
|     <!-- ## Type name --> | ||||
|  | ||||
|     <context id="_built-in-library-types" style-ref="built-in-library-type"> | ||||
|       <prefix>\%{js:keyword-start}</prefix> | ||||
|       <suffix>\%{js:keyword-end}</suffix> | ||||
|       <keyword>Exclude</keyword> | ||||
|       <keyword>Extract</keyword> | ||||
|       <keyword>InstanceType</keyword> | ||||
| @@ -467,6 +669,7 @@ | ||||
|  | ||||
|     <context id="_choice-type-name-identifier-only" end-parent="true"> | ||||
|       <start extended="true"> | ||||
|         (?<! \%{js:identifier-char} ) | ||||
|         (?= (?> \%{js:identifier} ) (?! \. ) ) | ||||
|       </start> | ||||
|       <end>\%{def:always-match}</end> | ||||
| @@ -485,7 +688,7 @@ | ||||
|     </context> <!-- /_choice-type-name-identifier-only --> | ||||
|  | ||||
|     <context id="_type-name" end-parent="true"> | ||||
|       <start>(?=\%{js:identifier-start})</start> | ||||
|       <start>\%{js:identifier-container-start}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <!-- no comments here --> | ||||
| @@ -552,7 +755,7 @@ | ||||
|     </context> <!-- /_ordered-import-type-trailing-dot --> | ||||
|  | ||||
|     <context id="_import-type" once-only="true"> | ||||
|       <start>\%[import\%]</start> | ||||
|       <start>\%{js:import-keyword}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context sub-pattern="0" where="start" style-ref="type-keyword"/> | ||||
| @@ -580,7 +783,7 @@ | ||||
|  | ||||
|     <!-- <TypeReference> --> | ||||
|     <context id="choice-type-reference" end-parent="true"> | ||||
|       <start>(?=\%{js:identifier-start})</start> | ||||
|       <start>\%{js:identifier-container-start}</start> | ||||
|       <end>\%{js:before-next-token}</end> | ||||
|       <include> | ||||
|         <context ref="js:comments"/> | ||||
| @@ -692,7 +895,6 @@ | ||||
|     <context id="unknown-context-error-workaround"> | ||||
|       <include> | ||||
|         <context ref="typescript-js-lit:choice-number"/> | ||||
|         <context ref="typescript-js-val:global-values"/> | ||||
|         <context ref="typescript-js-fn:function-parameters-content"/> | ||||
|         <context ref="typescript-js-expr:grouping-item-content"/> | ||||
|         <context ref="typescript-js-st:class-declarations"/> | ||||
| @@ -705,32 +907,43 @@ | ||||
|  | ||||
|     <!-- ## General --> | ||||
|  | ||||
|     <context id="_multiline-comment-content"> | ||||
|       <include> | ||||
|         <context ref="_ts-ignore-comment-pragma-multiline-comment-last-line"/> | ||||
|         <context ref="js:_multiline-comment-content" original="true"/> | ||||
|       </include> | ||||
|     </context> <!-- /_multiline-comment-content --> | ||||
|  | ||||
|     <context id="_comments"> | ||||
|       <include> | ||||
|         <context ref="_ts-ignore-comment-pragmas"/> | ||||
|         <context ref="_ts-ignore-comment-pragma-single-line-comments"/> | ||||
|         <context ref="_ts-ignore-comment-pragmas-multiline-comments"/> | ||||
|         <context ref="js:comments" original="true"/> | ||||
|       </include> | ||||
|     </context> <!-- /_comments --> | ||||
|  | ||||
|     <context id="_comments-no-extend-parent"> | ||||
|       <include> | ||||
|         <context ref="_ts-ignore-comment-pragmas-no-extend-parent"/> | ||||
|         <context ref="_ts-ignore-comment-pragma-single-line-comments-no-extend-parent"/> | ||||
|         <context ref="_ts-ignore-comment-pragmas-multiline-comments-no-extend-parent"/> | ||||
|         <context ref="js:comments-no-extend-parent" original="true"/> | ||||
|       </include> | ||||
|     </context> <!-- /_comments-no-extend-parent --> | ||||
|  | ||||
|     <replace id="js:_multiline-comment-content" ref="_multiline-comment-content"/> | ||||
|     <replace id="js:comments" ref="_comments"/> | ||||
|     <replace id="js:comments-no-extend-parent" ref="_comments-no-extend-parent"/> | ||||
|  | ||||
|  | ||||
|     <!-- ## Literals --> | ||||
|  | ||||
|     <!-- ### Number --> | ||||
|  | ||||
|     <replace id="js-lit:choice-number" ref="typescript-js-lit:choice-number"/> | ||||
|  | ||||
|     <!-- ### Object literal --> | ||||
|  | ||||
|     <!-- ## Values --> | ||||
|  | ||||
|     <replace id="js-val:global-values" ref="typescript-js-val:global-values"/> | ||||
|     <replace id="js-lit:_choice-object-literal-keyword-named-property-or-method" ref="typescript-js-lit:choice-object-literal-keyword-named-property-or-method"/> | ||||
|  | ||||
|  | ||||
|     <!-- ## Functions and classes --> | ||||
| @@ -743,7 +956,7 @@ | ||||
|  | ||||
|     <!-- ### Method definition --> | ||||
|  | ||||
|     <replace id="js-fn:_method-definition-content" ref="typescript-js-fn:method-definition-content"/> | ||||
|     <replace id="js-fn:choice-method-definition" ref="typescript-js-fn:choice-method-definition"/> | ||||
|  | ||||
|     <!-- ### Class expression --> | ||||
|  | ||||
| @@ -769,6 +982,8 @@ | ||||
|  | ||||
|     <!-- ### Post-primary expression --> | ||||
|  | ||||
|     <replace id="js-expr:_dot-property-accessor-content" ref="typescript-js-expr:dot-property-accessor-content"/> | ||||
|     <replace id="js-expr:_optional-chain-content" ref="typescript-js-expr:optional-chain-content"/> | ||||
|     <replace id="js-expr:_post-primary-expression" ref="typescript-js-expr:post-primary-expression"/> | ||||
|  | ||||
|     <!-- ### Pre-LHS expression --> | ||||
| @@ -806,16 +1021,15 @@ | ||||
|     <!-- ### Import declaration --> | ||||
|  | ||||
|     <replace id="js-mod:_import-default-content" ref="typescript-js-mod:import-default-content"/> | ||||
|  | ||||
|     <replace id="js-mod:import-declarations" ref="typescript-js-mod:import-declarations"/> | ||||
|     <replace id="js-mod:_import-declaration-content" ref="typescript-js-mod:import-declaration-content"/> | ||||
|  | ||||
|  | ||||
|     <!-- # Main context --> | ||||
|  | ||||
|     <context id="typescript" class="no-spell-check"> | ||||
|       <include> | ||||
|         <context ref="_ts-nocheck-comment-pragmas"/> | ||||
|         <context ref="_triple-slash-directives"/> | ||||
|         <context ref="_ts-nocheck-comment-pragma-comments"/> | ||||
|         <context ref="_triple-slash-directive-comments"/> | ||||
|         <context ref="js:js"/> | ||||
|       </include> | ||||
|     </context> <!-- /typescript --> | ||||
|   | ||||
							
								
								
									
										188
									
								
								gtk-nsis-pack/share/gtksourceview-4/language-specs/yara.lang
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										188
									
								
								gtk-nsis-pack/share/gtksourceview-4/language-specs/yara.lang
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,188 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
|  | ||||
| <!-- | ||||
|  | ||||
|  This file is part of GtkSourceView | ||||
|  | ||||
|  Author: Wes <13hurdw@gmail.com> | ||||
|  Copyright (C) 2017, 2020  | ||||
|  | ||||
|  GtkSourceView is free software; you can redistribute it and/or | ||||
|  modify it under the terms of the GNU Lesser General Public | ||||
|  License as published by the Free Software Foundation; either | ||||
|  version 2.1 of the License, or (at your option) any later version. | ||||
|  | ||||
|  GtkSourceView is distributed in the hope that it will be useful, | ||||
|  but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
|  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU | ||||
|  Lesser General Public License for more details. | ||||
|  | ||||
|  You should have received a copy of the GNU Lesser General Public License | ||||
|  along with this library; if not, see <http://www.gnu.org/licenses/>. | ||||
|  | ||||
| --> | ||||
|  | ||||
|  | ||||
| <language id="yara" name="YARA" version="2.0" _section="Other"> | ||||
|   <metadata> | ||||
|     <property name="mimetypes">text/yara;text/x-yara</property> | ||||
|     <property name="globs">*.yara;*.yar</property> | ||||
|     <property name="line-comment-start">//</property> | ||||
|     <property name="block-comment-start">/*</property> | ||||
|     <property name="block-comment-end">*/</property> | ||||
|   </metadata> | ||||
|  | ||||
|   <styles> | ||||
|     <style id="comment"           name="Comment"               map-to="def:comment"/> | ||||
|     <style id="include"           name="Include"               map-to="def:preprocessor"/> | ||||
|     <style id="keyword"           name="Keyword"               map-to="def:keyword"/> | ||||
|     <style id="rule"              name="Rule"                  map-to="def:function"/> | ||||
|     <style id="string"            name="String"                map-to="def:string"/> | ||||
|     <style id="escaped-character" name="Escaped Character"     map-to="def:special-char"/> | ||||
|     <style id="decimal"           name="Decimal number"        map-to="def:decimal"/> | ||||
|     <style id="hexadecimal"       name="Hexadecimal number"    map-to="def:base-n-integer"/> | ||||
|     <style id="boolean"           name="Boolean value"         map-to="def:boolean"/> | ||||
|  | ||||
|     <style id="error"             name="Error"                 map-to="def:error"/> | ||||
|   </styles> | ||||
|  | ||||
|   <definitions> | ||||
|      | ||||
|     <context id="include" style-ref="include"> | ||||
|       <keyword>include</keyword> | ||||
|       <!-- 'import' is currently in keywords--> | ||||
|     </context> | ||||
|  | ||||
|     <define-regex id="escaped-character" extended="true"> | ||||
|       \\(                   # leading backslash | ||||
|       [\\\"nt] |   # escaped character | ||||
|       x[0-9A-Fa-f]{2}         # hex char | ||||
|       ) | ||||
|     </define-regex> | ||||
|  | ||||
|     <context id="string" style-ref="string" end-at-line-end="true" class="string" class-disabled="no-spell-check"> | ||||
|       <start>"</start> | ||||
|       <end>"</end> | ||||
|       <include> | ||||
|         <context id="escaped-character" style-ref="escaped-character"> | ||||
|           <match>\%{escaped-character}</match> | ||||
|         </context> | ||||
|         <context ref="def:line-continue"/> | ||||
|       </include> | ||||
|     </context> | ||||
|  | ||||
|     <!-- Match on YARA hex string chars --> | ||||
|     <context id="hex-string" style-ref="hexadecimal"> | ||||
|       <match extended="true"> | ||||
|         (?<![\w\.]) | ||||
|         ([a-fA-F0-9?]{2})+ | ||||
|         (?![\w\.]) | ||||
|       </match> | ||||
|     </context> | ||||
|  | ||||
|     <context id="hexadecimal" style-ref="hexadecimal"> | ||||
|       <match extended="true"> | ||||
|         (?<![\w\.]) | ||||
|         0[xX][a-fA-F0-9]+ | ||||
|         (?![\w\.]) | ||||
|       </match> | ||||
|     </context> | ||||
|  | ||||
|     <context id="invalid-hexadecimal" style-ref="error"> | ||||
|       <match extended="true"> | ||||
|         (?<![\w\.]) | ||||
|         0[xX][a-fA-F0-9]*[g-zG-Z][a-zA-Z0-9]* | ||||
|         (?![\w\.]) | ||||
|       </match> | ||||
|     </context> | ||||
|  | ||||
|     <context id="decimal" style-ref="decimal"> | ||||
|       <match extended="true"> | ||||
|         (?<![\w\.]) | ||||
|         (0|[1-9][0-9]*) | ||||
|         (?![\w\.]) | ||||
|       </match> | ||||
|     </context> | ||||
|  | ||||
|     <!-- 'rule' is also present in the 'keywords' context, but has a lower | ||||
|          priority, so 'rule' is highlighted even if the rule name doesn't match. --> | ||||
|     <context id="rule"> | ||||
|       <match extended="true"> | ||||
|         (rule) | ||||
|         \s+ | ||||
|         ([a-zA-Z_]\w{0,127}) | ||||
|       </match> | ||||
|       <include> | ||||
|         <context sub-pattern="1" style-ref="keyword"/> | ||||
|         <context sub-pattern="2" style-ref="rule"/> | ||||
|       </include> | ||||
|     </context> | ||||
|  | ||||
|     <context id="keywords" style-ref="keyword"> | ||||
|       <keyword>all</keyword> | ||||
|       <keyword>and</keyword> | ||||
|       <keyword>any</keyword> | ||||
|       <keyword>ascii</keyword> | ||||
|       <keyword>at</keyword> | ||||
|       <keyword>base64</keyword> | ||||
|       <keyword>base64wide</keyword> | ||||
|       <keyword>condition</keyword> | ||||
|       <keyword>contains</keyword> | ||||
|       <keyword>entrypoint</keyword> <!-- being deprecated--> | ||||
|       <keyword>filesize</keyword> | ||||
|       <keyword>for</keyword> | ||||
|       <keyword>fullword</keyword> | ||||
|       <keyword>global</keyword> | ||||
|       <keyword>import</keyword> | ||||
|       <keyword>in</keyword> | ||||
|       <keyword>int8</keyword> | ||||
|       <keyword>int16</keyword> | ||||
|       <keyword>int32</keyword> | ||||
|       <keyword>int8be</keyword> | ||||
|       <keyword>int16be</keyword> | ||||
|       <keyword>int32be</keyword> | ||||
|       <keyword>matches</keyword> | ||||
|       <keyword>meta</keyword> | ||||
|       <keyword>nocase</keyword> | ||||
|       <keyword>not</keyword> | ||||
|       <keyword>or</keyword> | ||||
|       <keyword>of</keyword> | ||||
|       <keyword>private</keyword> | ||||
|       <keyword>rule</keyword> | ||||
|       <keyword>strings</keyword> | ||||
|       <keyword>them</keyword> | ||||
|       <keyword>uint8</keyword> | ||||
|       <keyword>uint16</keyword> | ||||
|       <keyword>uint32</keyword> | ||||
|       <keyword>uint8be</keyword> | ||||
|       <keyword>uint16be</keyword> | ||||
|       <keyword>uint32be</keyword> | ||||
|       <keyword>wide</keyword> | ||||
|       <keyword>xor</keyword> | ||||
|     </context> | ||||
|  | ||||
|     <context id="boolean" style-ref="boolean"> | ||||
|       <keyword>true</keyword> | ||||
|       <keyword>false</keyword> | ||||
|     </context> | ||||
|  | ||||
|     <!--Main context--> | ||||
|     <context id="yara" class="no-spell-check"> | ||||
|       <include> | ||||
|         <context ref="def:c-like-comment" style-ref="comment"/> | ||||
|         <context ref="def:c-like-comment-multiline" style-ref="comment"/> | ||||
|         <context ref="def:c-like-close-comment-outside-comment" style-ref="comment"/> | ||||
|         <context ref="include"/> | ||||
|         <context ref="string"/> | ||||
|         <context ref="hex-string"/> | ||||
|         <context ref="hexadecimal"/> | ||||
|         <context ref="invalid-hexadecimal"/> | ||||
|         <context ref="decimal"/> | ||||
|         <context ref="rule"/> | ||||
|         <context ref="keywords"/> | ||||
|         <context ref="boolean"/> | ||||
|       </include> | ||||
|     </context> | ||||
|  | ||||
|   </definitions> | ||||
| </language> | ||||
| @@ -33,6 +33,7 @@ | ||||
|   <color name="base1"   value="#93A1A1"/> | ||||
|   <color name="base2"   value="#EEE8D5"/> | ||||
|   <color name="base3"   value="#FDF6E3"/> | ||||
|   <color name="base4"   value="#C8CCC2"/> | ||||
|   <color name="yellow"  value="#B58900"/> | ||||
|   <color name="orange"  value="#CB4B16"/> | ||||
|   <color name="red"     value="#DC322F"/> | ||||
| @@ -51,6 +52,7 @@ | ||||
|   <style name="current-line"                background="base2"/> | ||||
|   <style name="line-numbers"                foreground="base1" background="base2"/> | ||||
|   <style name="background-pattern"          background="base3-2-blend"/> | ||||
|   <style name="draw-spaces"                 foreground="base4"/> | ||||
|  | ||||
|   <!-- Bracket Matching --> | ||||
|   <style name="bracket-match"               foreground="base3" background="base1"/> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user