├── .gitignore ├── LICENSE ├── README.md ├── binding.gyp ├── build ├── Makefile ├── binding.Makefile ├── config.gypi └── tree_sitter_xml_binding.target.mk ├── corpus └── main.txt ├── examples ├── cd_catalog.xml ├── sample.xml └── simple.xml ├── grammar.js ├── index.js ├── package-lock.json ├── package.json └── src ├── binding.cc ├── grammar.json ├── node-types.json ├── parser.c └── tree_sitter └── parser.h /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | lerna-debug.log* 8 | 9 | # Diagnostic reports (https://nodejs.org/api/report.html) 10 | report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | *.lcov 24 | 25 | # nyc test coverage 26 | .nyc_output 27 | 28 | # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) 29 | .grunt 30 | 31 | # Bower dependency directory (https://bower.io/) 32 | bower_components 33 | 34 | # node-waf configuration 35 | .lock-wscript 36 | 37 | # Compiled binary addons (https://nodejs.org/api/addons.html) 38 | build/Release 39 | 40 | # Dependency directories 41 | node_modules/ 42 | jspm_packages/ 43 | 44 | # TypeScript v1 declaration files 45 | typings/ 46 | 47 | # TypeScript cache 48 | *.tsbuildinfo 49 | 50 | # Optional npm cache directory 51 | .npm 52 | 53 | # Optional eslint cache 54 | .eslintcache 55 | 56 | # Microbundle cache 57 | .rpt2_cache/ 58 | .rts2_cache_cjs/ 59 | .rts2_cache_es/ 60 | .rts2_cache_umd/ 61 | 62 | # Optional REPL history 63 | .node_repl_history 64 | 65 | # Output of 'npm pack' 66 | *.tgz 67 | 68 | # Yarn Integrity file 69 | .yarn-integrity 70 | 71 | # dotenv environment variables file 72 | .env 73 | .env.test 74 | 75 | # parcel-bundler cache (https://parceljs.org/) 76 | .cache 77 | 78 | # Next.js build output 79 | .next 80 | 81 | # Nuxt.js build / generate output 82 | .nuxt 83 | dist 84 | 85 | # Gatsby files 86 | .cache/ 87 | # Comment in the public line in if your project uses Gatsby and *not* Next.js 88 | # https://nextjs.org/blog/next-9-1#public-directory-support 89 | # public 90 | 91 | # vuepress build output 92 | .vuepress/dist 93 | 94 | # Serverless directories 95 | .serverless/ 96 | 97 | # FuseBox cache 98 | .fusebox/ 99 | 100 | # DynamoDB Local files 101 | .dynamodb/ 102 | 103 | # TernJS port file 104 | .tern-port 105 | 106 | .eslintrc.js 107 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 dorgnarg 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # tree-sitter-xml 2 | XML Grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter) 3 | 4 | [Based on the W3C XML 1.0 recommendation](https://www.w3.org/TR/REC-xml/) 5 | 6 | Example files come from W3C samples, [generated data](www.generatedata.com), and [wikimedia dumps](https://dumps.wikimedia.org/). 7 | 8 | Finished sections from the XML specification: 9 | 10 | - [x] Document 11 | - [x] Character Range (currently doing with `/./`) 12 | - [x] White Space (currently doing with `/\s/`) 13 | - [x] Names and Tokens 14 | - [x] Literals 15 | - [x] Character Data 16 | - [x] Comments 17 | - [x] Processing Instructions (*haven't quite finished the pi_target definition*) 18 | - [x] CDATA Sections (*not sure about the cdata element, I need to test it more*) 19 | - [x] Prolog 20 | - [x] Document Type Definition 21 | - [x] External Subset 22 | - [x] Standalone Document Declaration 23 | - [x] Language Identification 24 | - [x] Element 25 | - [x] Start-tag 26 | - [x] End-tag 27 | - [x] Content of Elements 28 | - [x] Tags for Empty Elements 29 | - [x] Element Type Declaration 30 | - [x] Element-content Models 31 | - [x] Mixed-content Declaration 32 | - [x] Attribute-list Declaration 33 | - [x] Attribute Types 34 | - [x] Enumerated Attribute Types 35 | - [x] Attribute Defaults 36 | - [x] Conditional Section (*$.ignore might not be good enough*) 37 | - [x] Character Reference 38 | - [x] Entity Reference 39 | - [x] Entity Declaration 40 | - [x] External Entity Declaraion 41 | - [x] Text Declaration 42 | - [x] Well-Formed External Parsed Entity 43 | - [x] Encoding Declaration 44 | - [x] Encoding Declaration 45 | - [x] Notation Declarations 46 | - [x] Characters 47 | 48 | *Note that these just mean I have literally written them in, I'm still working on organization and figuring out what needs to be visible/hidden. Help is appreciated!* 49 | -------------------------------------------------------------------------------- /binding.gyp: -------------------------------------------------------------------------------- 1 | { 2 | "targets": [ 3 | { 4 | "target_name": "tree_sitter_xml_binding", 5 | "include_dirs": [ 6 | "> $(depfile) 108 | # Add extra rules as in (2). 109 | # We remove slashes and replace spaces with new lines; 110 | # remove blank lines; 111 | # delete the first line and append a colon to the remaining lines. 112 | sed -e 's|\\||' -e 'y| |\n|' $(depfile).raw |\ 113 | grep -v '^$$' |\ 114 | sed -e 1d -e 's|$$|:|' \ 115 | >> $(depfile) 116 | rm $(depfile).raw 117 | endef 118 | 119 | # Command definitions: 120 | # - cmd_foo is the actual command to run; 121 | # - quiet_cmd_foo is the brief-output summary of the command. 122 | 123 | quiet_cmd_cc = CC($(TOOLSET)) $@ 124 | cmd_cc = $(CC.$(TOOLSET)) $(GYP_CFLAGS) $(DEPFLAGS) $(CFLAGS.$(TOOLSET)) -c -o $@ $< 125 | 126 | quiet_cmd_cxx = CXX($(TOOLSET)) $@ 127 | cmd_cxx = $(CXX.$(TOOLSET)) $(GYP_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c -o $@ $< 128 | 129 | quiet_cmd_touch = TOUCH $@ 130 | cmd_touch = touch $@ 131 | 132 | quiet_cmd_copy = COPY $@ 133 | # send stderr to /dev/null to ignore messages when linking directories. 134 | cmd_copy = rm -rf "$@" && cp -af "$<" "$@" 135 | 136 | quiet_cmd_alink = AR($(TOOLSET)) $@ 137 | cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^) 138 | 139 | quiet_cmd_alink_thin = AR($(TOOLSET)) $@ 140 | cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^) 141 | 142 | # Due to circular dependencies between libraries :(, we wrap the 143 | # special "figure out circular dependencies" flags around the entire 144 | # input list during linking. 145 | quiet_cmd_link = LINK($(TOOLSET)) $@ 146 | cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) $(LIBS) -Wl,--end-group 147 | 148 | # We support two kinds of shared objects (.so): 149 | # 1) shared_library, which is just bundling together many dependent libraries 150 | # into a link line. 151 | # 2) loadable_module, which is generating a module intended for dlopen(). 152 | # 153 | # They differ only slightly: 154 | # In the former case, we want to package all dependent code into the .so. 155 | # In the latter case, we want to package just the API exposed by the 156 | # outermost module. 157 | # This means shared_library uses --whole-archive, while loadable_module doesn't. 158 | # (Note that --whole-archive is incompatible with the --start-group used in 159 | # normal linking.) 160 | 161 | # Other shared-object link notes: 162 | # - Set SONAME to the library filename so our binaries don't reference 163 | # the local, absolute paths used on the link command-line. 164 | quiet_cmd_solink = SOLINK($(TOOLSET)) $@ 165 | cmd_solink = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--whole-archive $(LD_INPUTS) -Wl,--no-whole-archive $(LIBS) 166 | 167 | quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@ 168 | cmd_solink_module = $(LINK.$(TOOLSET)) -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -o $@ -Wl,--start-group $(filter-out FORCE_DO_CMD, $^) -Wl,--end-group $(LIBS) 169 | 170 | 171 | # Define an escape_quotes function to escape single quotes. 172 | # This allows us to handle quotes properly as long as we always use 173 | # use single quotes and escape_quotes. 174 | escape_quotes = $(subst ','\'',$(1)) 175 | # This comment is here just to include a ' to unconfuse syntax highlighting. 176 | # Define an escape_vars function to escape '$' variable syntax. 177 | # This allows us to read/write command lines with shell variables (e.g. 178 | # $LD_LIBRARY_PATH), without triggering make substitution. 179 | escape_vars = $(subst $$,$$$$,$(1)) 180 | # Helper that expands to a shell command to echo a string exactly as it is in 181 | # make. This uses printf instead of echo because printf's behaviour with respect 182 | # to escape sequences is more portable than echo's across different shells 183 | # (e.g., dash, bash). 184 | exact_echo = printf '%s\n' '$(call escape_quotes,$(1))' 185 | 186 | # Helper to compare the command we're about to run against the command 187 | # we logged the last time we ran the command. Produces an empty 188 | # string (false) when the commands match. 189 | # Tricky point: Make has no string-equality test function. 190 | # The kernel uses the following, but it seems like it would have false 191 | # positives, where one string reordered its arguments. 192 | # arg_check = $(strip $(filter-out $(cmd_$(1)), $(cmd_$@)) \ 193 | # $(filter-out $(cmd_$@), $(cmd_$(1)))) 194 | # We instead substitute each for the empty string into the other, and 195 | # say they're equal if both substitutions produce the empty string. 196 | # .d files contain ? instead of spaces, take that into account. 197 | command_changed = $(or $(subst $(cmd_$(1)),,$(cmd_$(call replace_spaces,$@))),\ 198 | $(subst $(cmd_$(call replace_spaces,$@)),,$(cmd_$(1)))) 199 | 200 | # Helper that is non-empty when a prerequisite changes. 201 | # Normally make does this implicitly, but we force rules to always run 202 | # so we can check their command lines. 203 | # $? -- new prerequisites 204 | # $| -- order-only dependencies 205 | prereq_changed = $(filter-out FORCE_DO_CMD,$(filter-out $|,$?)) 206 | 207 | # Helper that executes all postbuilds until one fails. 208 | define do_postbuilds 209 | @E=0;\ 210 | for p in $(POSTBUILDS); do\ 211 | eval $$p;\ 212 | E=$$?;\ 213 | if [ $$E -ne 0 ]; then\ 214 | break;\ 215 | fi;\ 216 | done;\ 217 | if [ $$E -ne 0 ]; then\ 218 | rm -rf "$@";\ 219 | exit $$E;\ 220 | fi 221 | endef 222 | 223 | # do_cmd: run a command via the above cmd_foo names, if necessary. 224 | # Should always run for a given target to handle command-line changes. 225 | # Second argument, if non-zero, makes it do asm/C/C++ dependency munging. 226 | # Third argument, if non-zero, makes it do POSTBUILDS processing. 227 | # Note: We intentionally do NOT call dirx for depfile, since it contains ? for 228 | # spaces already and dirx strips the ? characters. 229 | define do_cmd 230 | $(if $(or $(command_changed),$(prereq_changed)), 231 | @$(call exact_echo, $($(quiet)cmd_$(1))) 232 | @mkdir -p "$(call dirx,$@)" "$(dir $(depfile))" 233 | $(if $(findstring flock,$(word 1,$(cmd_$1))), 234 | @$(cmd_$(1)) 235 | @echo " $(quiet_cmd_$(1)): Finished", 236 | @$(cmd_$(1)) 237 | ) 238 | @$(call exact_echo,$(call escape_vars,cmd_$(call replace_spaces,$@) := $(cmd_$(1)))) > $(depfile) 239 | @$(if $(2),$(fixup_dep)) 240 | $(if $(and $(3), $(POSTBUILDS)), 241 | $(call do_postbuilds) 242 | ) 243 | ) 244 | endef 245 | 246 | # Declare the "all" target first so it is the default, 247 | # even though we don't have the deps yet. 248 | .PHONY: all 249 | all: 250 | 251 | # make looks for ways to re-generate included makefiles, but in our case, we 252 | # don't have a direct way. Explicitly telling make that it has nothing to do 253 | # for them makes it go faster. 254 | %.d: ; 255 | 256 | # Use FORCE_DO_CMD to force a target to run. Should be coupled with 257 | # do_cmd. 258 | .PHONY: FORCE_DO_CMD 259 | FORCE_DO_CMD: 260 | 261 | TOOLSET := target 262 | # Suffix rules, putting all outputs into $(obj). 263 | $(obj).$(TOOLSET)/%.o: $(srcdir)/%.c FORCE_DO_CMD 264 | @$(call do_cmd,cc,1) 265 | $(obj).$(TOOLSET)/%.o: $(srcdir)/%.cc FORCE_DO_CMD 266 | @$(call do_cmd,cxx,1) 267 | $(obj).$(TOOLSET)/%.o: $(srcdir)/%.cpp FORCE_DO_CMD 268 | @$(call do_cmd,cxx,1) 269 | $(obj).$(TOOLSET)/%.o: $(srcdir)/%.cxx FORCE_DO_CMD 270 | @$(call do_cmd,cxx,1) 271 | $(obj).$(TOOLSET)/%.o: $(srcdir)/%.s FORCE_DO_CMD 272 | @$(call do_cmd,cc,1) 273 | $(obj).$(TOOLSET)/%.o: $(srcdir)/%.S FORCE_DO_CMD 274 | @$(call do_cmd,cc,1) 275 | 276 | # Try building from generated source, too. 277 | $(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.c FORCE_DO_CMD 278 | @$(call do_cmd,cc,1) 279 | $(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cc FORCE_DO_CMD 280 | @$(call do_cmd,cxx,1) 281 | $(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cpp FORCE_DO_CMD 282 | @$(call do_cmd,cxx,1) 283 | $(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cxx FORCE_DO_CMD 284 | @$(call do_cmd,cxx,1) 285 | $(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.s FORCE_DO_CMD 286 | @$(call do_cmd,cc,1) 287 | $(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.S FORCE_DO_CMD 288 | @$(call do_cmd,cc,1) 289 | 290 | $(obj).$(TOOLSET)/%.o: $(obj)/%.c FORCE_DO_CMD 291 | @$(call do_cmd,cc,1) 292 | $(obj).$(TOOLSET)/%.o: $(obj)/%.cc FORCE_DO_CMD 293 | @$(call do_cmd,cxx,1) 294 | $(obj).$(TOOLSET)/%.o: $(obj)/%.cpp FORCE_DO_CMD 295 | @$(call do_cmd,cxx,1) 296 | $(obj).$(TOOLSET)/%.o: $(obj)/%.cxx FORCE_DO_CMD 297 | @$(call do_cmd,cxx,1) 298 | $(obj).$(TOOLSET)/%.o: $(obj)/%.s FORCE_DO_CMD 299 | @$(call do_cmd,cc,1) 300 | $(obj).$(TOOLSET)/%.o: $(obj)/%.S FORCE_DO_CMD 301 | @$(call do_cmd,cc,1) 302 | 303 | 304 | ifeq ($(strip $(foreach prefix,$(NO_LOAD),\ 305 | $(findstring $(join ^,$(prefix)),\ 306 | $(join ^,tree_sitter_xml_binding.target.mk)))),) 307 | include tree_sitter_xml_binding.target.mk 308 | endif 309 | 310 | quiet_cmd_regen_makefile = ACTION Regenerating $@ 311 | cmd_regen_makefile = cd $(srcdir); /usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py -fmake --ignore-environment "-Dlibrary=shared_library" "-Dvisibility=default" "-Dnode_root_dir=/home/dan/.cache/node-gyp/15.6.0" "-Dnode_gyp_dir=/usr/lib/node_modules/npm/node_modules/node-gyp" "-Dnode_lib_file=/home/dan/.cache/node-gyp/15.6.0/<(target_arch)/node.lib" "-Dmodule_root_dir=/home/dan/Documents/tree-sitter-xml" "-Dnode_engine=v8" "--depth=." "-Goutput_dir=." "--generator-output=build" -I/home/dan/Documents/tree-sitter-xml/build/config.gypi -I/usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi -I/home/dan/.cache/node-gyp/15.6.0/include/node/common.gypi "--toplevel-dir=." binding.gyp 312 | Makefile: $(srcdir)/binding.gyp $(srcdir)/../../../../usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi $(srcdir)/build/config.gypi $(srcdir)/../../.cache/node-gyp/15.6.0/include/node/common.gypi 313 | $(call do_cmd,regen_makefile) 314 | 315 | # "all" is a concatenation of the "all" targets from all the included 316 | # sub-makefiles. This is just here to clarify. 317 | all: 318 | 319 | # Add in dependency-tracking rules. $(all_deps) is the list of every single 320 | # target in our tree. Only consider the ones with .d (dependency) info: 321 | d_files := $(wildcard $(foreach f,$(all_deps),$(depsdir)/$(f).d)) 322 | ifneq ($(d_files),) 323 | include $(d_files) 324 | endif 325 | -------------------------------------------------------------------------------- /build/binding.Makefile: -------------------------------------------------------------------------------- 1 | # This file is generated by gyp; do not edit. 2 | 3 | export builddir_name ?= ./build/. 4 | .PHONY: all 5 | all: 6 | $(MAKE) tree_sitter_xml_binding 7 | -------------------------------------------------------------------------------- /build/config.gypi: -------------------------------------------------------------------------------- 1 | # Do not edit. File was generated by node-gyp's "configure" step 2 | { 3 | "target_defaults": { 4 | "cflags": [], 5 | "default_configuration": "Release", 6 | "defines": [], 7 | "include_dirs": [], 8 | "libraries": [] 9 | }, 10 | "variables": { 11 | "asan": 0, 12 | "coverage": "false", 13 | "dcheck_always_on": 0, 14 | "debug_nghttp2": "false", 15 | "debug_node": "false", 16 | "enable_lto": "false", 17 | "enable_pgo_generate": "false", 18 | "enable_pgo_use": "false", 19 | "error_on_warn": "false", 20 | "experimental_quic": "false", 21 | "force_dynamic_crt": 0, 22 | "host_arch": "x64", 23 | "icu_gyp_path": "tools/icu/icu-system.gyp", 24 | "icu_small": "false", 25 | "icu_ver_major": "68", 26 | "is_debug": 0, 27 | "llvm_version": "0.0", 28 | "napi_build_version": "7", 29 | "node_byteorder": "little", 30 | "node_debug_lib": "false", 31 | "node_enable_d8": "false", 32 | "node_install_npm": "false", 33 | "node_module_version": 88, 34 | "node_no_browser_globals": "false", 35 | "node_prefix": "/usr", 36 | "node_release_urlbase": "", 37 | "node_section_ordering_info": "", 38 | "node_shared": "false", 39 | "node_shared_brotli": "false", 40 | "node_shared_cares": "false", 41 | "node_shared_http_parser": "false", 42 | "node_shared_libuv": "true", 43 | "node_shared_nghttp2": "true", 44 | "node_shared_openssl": "true", 45 | "node_shared_zlib": "true", 46 | "node_tag": "", 47 | "node_target_type": "executable", 48 | "node_use_bundled_v8": "true", 49 | "node_use_dtrace": "false", 50 | "node_use_etw": "false", 51 | "node_use_node_code_cache": "true", 52 | "node_use_node_snapshot": "true", 53 | "node_use_openssl": "true", 54 | "node_use_v8_platform": "true", 55 | "node_with_ltcg": "false", 56 | "node_without_node_options": "false", 57 | "openssl_fips": "", 58 | "openssl_is_fips": "false", 59 | "ossfuzz": "false", 60 | "shlib_suffix": "so.88", 61 | "target_arch": "x64", 62 | "v8_enable_31bit_smis_on_64bit_arch": 0, 63 | "v8_enable_gdbjit": 0, 64 | "v8_enable_i18n_support": 1, 65 | "v8_enable_inspector": 1, 66 | "v8_enable_lite_mode": 0, 67 | "v8_enable_object_print": 1, 68 | "v8_enable_pointer_compression": 0, 69 | "v8_no_strict_aliasing": 1, 70 | "v8_optimized_debug": 1, 71 | "v8_promise_internal_field_count": 1, 72 | "v8_random_seed": 0, 73 | "v8_trace_maps": 0, 74 | "v8_use_siphash": 1, 75 | "want_separate_host_toolset": 0, 76 | "nodedir": "/home/dan/.cache/node-gyp/15.6.0", 77 | "standalone_static_library": 1, 78 | "access": "", 79 | "timing": "", 80 | "save_dev": "", 81 | "sign_git_tag": "", 82 | "before": "", 83 | "userconfig": "/home/dan/.npmrc", 84 | "global": "", 85 | "unsafe_perm": "true", 86 | "fetch_retry_mintimeout": "10000", 87 | "cache": "/home/dan/.npm", 88 | "init_author_name": "", 89 | "send_metrics": "", 90 | "optional": "true", 91 | "user": "", 92 | "git_tag_version": "true", 93 | "rebuild_bundle": "true", 94 | "always_auth": "", 95 | "cache_max": "Infinity", 96 | "searchstaleness": "900", 97 | "ignore_scripts": "", 98 | "save_optional": "", 99 | "dev": "", 100 | "browser": "", 101 | "maxsockets": "50", 102 | "ham_it_up": "", 103 | "bin_links": "true", 104 | "allow_same_version": "", 105 | "globalconfig": "/usr/etc/npmrc", 106 | "cache_min": "10", 107 | "tag_version_prefix": "v", 108 | "shell": "/usr/bin/zsh", 109 | "preid": "", 110 | "usage": "", 111 | "only": "", 112 | "save_prefix": "^", 113 | "sign_git_commit": "", 114 | "commit_hooks": "true", 115 | "init_module": "/home/dan/.npm-init.js", 116 | "editor": "nvim", 117 | "otp": "", 118 | "tmp": "/tmp", 119 | "audit_level": "low", 120 | "color": "true", 121 | "package_lock_only": "", 122 | "save_prod": "", 123 | "format_package_lock": "true", 124 | "also": "", 125 | "cidr": "", 126 | "node_version": "15.6.0", 127 | "init_author_url": "", 128 | "globalignorefile": "/usr/etc/npmignore", 129 | "init_license": "ISC", 130 | "cache_lock_stale": "60000", 131 | "versions": "", 132 | "fetch_retry_maxtimeout": "60000", 133 | "fetch_retries": "2", 134 | "git": "git", 135 | "group": "1000", 136 | "read_only": "", 137 | "unicode": "true", 138 | "sso_type": "oauth", 139 | "cache_lock_retries": "10", 140 | "local_address": "", 141 | "description": "true", 142 | "dry_run": "", 143 | "viewer": "man", 144 | "message": "%s", 145 | "offline": "", 146 | "production": "", 147 | "prefer_online": "", 148 | "link": "", 149 | "shrinkwrap": "true", 150 | "force": "", 151 | "rollback": "true", 152 | "save_bundle": "", 153 | "onload_script": "", 154 | "prefix": "/usr", 155 | "cert": "", 156 | "heading": "npm", 157 | "cache_lock_wait": "10000", 158 | "node_options": "", 159 | "key": "", 160 | "json": "", 161 | "depth": "Infinity", 162 | "ca": "", 163 | "prefer_offline": "", 164 | "fund": "true", 165 | "if_present": "", 166 | "user_agent": "npm/6.14.11 node/v15.6.0 linux x64", 167 | "save_exact": "", 168 | "progress": "true", 169 | "global_style": "", 170 | "init_author_email": "", 171 | "long": "", 172 | "script_shell": "", 173 | "save": "true", 174 | "strict_ssl": "true", 175 | "auth_type": "legacy", 176 | "version": "", 177 | "logs_max": "10", 178 | "umask": "0022", 179 | "sso_poll_frequency": "500", 180 | "searchopts": "", 181 | "legacy_bundling": "", 182 | "searchlimit": "20", 183 | "metrics_registry": "https://registry.npmjs.org/", 184 | "node_gyp": "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js", 185 | "searchexclude": "", 186 | "update_notifier": "true", 187 | "registry": "https://registry.npmjs.org/", 188 | "ignore_prepublish": "", 189 | "audit": "true", 190 | "tag": "latest", 191 | "scripts_prepend_node_path": "warn-only", 192 | "fetch_retry_factor": "10", 193 | "engine_strict": "", 194 | "https_proxy": "", 195 | "scope": "", 196 | "package_lock": "true", 197 | "parseable": "", 198 | "init_version": "1.0.0" 199 | } 200 | } 201 | -------------------------------------------------------------------------------- /build/tree_sitter_xml_binding.target.mk: -------------------------------------------------------------------------------- 1 | # This file is generated by gyp; do not edit. 2 | 3 | TOOLSET := target 4 | TARGET := tree_sitter_xml_binding 5 | DEFS_Debug := \ 6 | '-DNODE_GYP_MODULE_NAME=tree_sitter_xml_binding' \ 7 | '-DUSING_UV_SHARED=1' \ 8 | '-DUSING_V8_SHARED=1' \ 9 | '-DV8_DEPRECATION_WARNINGS=1' \ 10 | '-DV8_DEPRECATION_WARNINGS' \ 11 | '-DV8_IMMINENT_DEPRECATION_WARNINGS' \ 12 | '-D_LARGEFILE_SOURCE' \ 13 | '-D_FILE_OFFSET_BITS=64' \ 14 | '-D__STDC_FORMAT_MACROS' \ 15 | '-DBUILDING_NODE_EXTENSION' \ 16 | '-DDEBUG' \ 17 | '-D_DEBUG' \ 18 | '-DV8_ENABLE_CHECKS' 19 | 20 | # Flags passed to all source files. 21 | CFLAGS_Debug := \ 22 | -fPIC \ 23 | -pthread \ 24 | -Wall \ 25 | -Wextra \ 26 | -Wno-unused-parameter \ 27 | -m64 \ 28 | -g \ 29 | -O0 30 | 31 | # Flags passed to only C files. 32 | CFLAGS_C_Debug := \ 33 | -std=c99 34 | 35 | # Flags passed to only C++ files. 36 | CFLAGS_CC_Debug := \ 37 | -fno-rtti \ 38 | -fno-exceptions \ 39 | -std=gnu++1y 40 | 41 | INCS_Debug := \ 42 | -I/home/dan/.cache/node-gyp/15.6.0/include/node \ 43 | -I/home/dan/.cache/node-gyp/15.6.0/src \ 44 | -I/home/dan/.cache/node-gyp/15.6.0/deps/openssl/config \ 45 | -I/home/dan/.cache/node-gyp/15.6.0/deps/openssl/openssl/include \ 46 | -I/home/dan/.cache/node-gyp/15.6.0/deps/uv/include \ 47 | -I/home/dan/.cache/node-gyp/15.6.0/deps/zlib \ 48 | -I/home/dan/.cache/node-gyp/15.6.0/deps/v8/include \ 49 | -I$(srcdir)/node_modules/nan \ 50 | -I$(srcdir)/src 51 | 52 | DEFS_Release := \ 53 | '-DNODE_GYP_MODULE_NAME=tree_sitter_xml_binding' \ 54 | '-DUSING_UV_SHARED=1' \ 55 | '-DUSING_V8_SHARED=1' \ 56 | '-DV8_DEPRECATION_WARNINGS=1' \ 57 | '-DV8_DEPRECATION_WARNINGS' \ 58 | '-DV8_IMMINENT_DEPRECATION_WARNINGS' \ 59 | '-D_LARGEFILE_SOURCE' \ 60 | '-D_FILE_OFFSET_BITS=64' \ 61 | '-D__STDC_FORMAT_MACROS' \ 62 | '-DBUILDING_NODE_EXTENSION' 63 | 64 | # Flags passed to all source files. 65 | CFLAGS_Release := \ 66 | -fPIC \ 67 | -pthread \ 68 | -Wall \ 69 | -Wextra \ 70 | -Wno-unused-parameter \ 71 | -m64 \ 72 | -O3 \ 73 | -fno-omit-frame-pointer 74 | 75 | # Flags passed to only C files. 76 | CFLAGS_C_Release := \ 77 | -std=c99 78 | 79 | # Flags passed to only C++ files. 80 | CFLAGS_CC_Release := \ 81 | -fno-rtti \ 82 | -fno-exceptions \ 83 | -std=gnu++1y 84 | 85 | INCS_Release := \ 86 | -I/home/dan/.cache/node-gyp/15.6.0/include/node \ 87 | -I/home/dan/.cache/node-gyp/15.6.0/src \ 88 | -I/home/dan/.cache/node-gyp/15.6.0/deps/openssl/config \ 89 | -I/home/dan/.cache/node-gyp/15.6.0/deps/openssl/openssl/include \ 90 | -I/home/dan/.cache/node-gyp/15.6.0/deps/uv/include \ 91 | -I/home/dan/.cache/node-gyp/15.6.0/deps/zlib \ 92 | -I/home/dan/.cache/node-gyp/15.6.0/deps/v8/include \ 93 | -I$(srcdir)/node_modules/nan \ 94 | -I$(srcdir)/src 95 | 96 | OBJS := \ 97 | $(obj).target/$(TARGET)/src/parser.o \ 98 | $(obj).target/$(TARGET)/src/binding.o 99 | 100 | # Add to the list of files we specially track dependencies for. 101 | all_deps += $(OBJS) 102 | 103 | # CFLAGS et al overrides must be target-local. 104 | # See "Target-specific Variable Values" in the GNU Make manual. 105 | $(OBJS): TOOLSET := $(TOOLSET) 106 | $(OBJS): GYP_CFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_C_$(BUILDTYPE)) 107 | $(OBJS): GYP_CXXFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_CC_$(BUILDTYPE)) 108 | 109 | # Suffix rules, putting all outputs into $(obj). 110 | 111 | $(obj).$(TOOLSET)/$(TARGET)/%.o: $(srcdir)/%.cc FORCE_DO_CMD 112 | @$(call do_cmd,cxx,1) 113 | 114 | $(obj).$(TOOLSET)/$(TARGET)/%.o: $(srcdir)/%.c FORCE_DO_CMD 115 | @$(call do_cmd,cc,1) 116 | 117 | # Try building from generated source, too. 118 | 119 | $(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj).$(TOOLSET)/%.cc FORCE_DO_CMD 120 | @$(call do_cmd,cxx,1) 121 | 122 | $(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj).$(TOOLSET)/%.c FORCE_DO_CMD 123 | @$(call do_cmd,cc,1) 124 | 125 | $(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj)/%.cc FORCE_DO_CMD 126 | @$(call do_cmd,cxx,1) 127 | 128 | $(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj)/%.c FORCE_DO_CMD 129 | @$(call do_cmd,cc,1) 130 | 131 | # End of this set of suffix rules 132 | ### Rules for final target. 133 | LDFLAGS_Debug := \ 134 | -pthread \ 135 | -rdynamic \ 136 | -m64 137 | 138 | LDFLAGS_Release := \ 139 | -pthread \ 140 | -rdynamic \ 141 | -m64 142 | 143 | LIBS := 144 | 145 | $(obj).target/tree_sitter_xml_binding.node: GYP_LDFLAGS := $(LDFLAGS_$(BUILDTYPE)) 146 | $(obj).target/tree_sitter_xml_binding.node: LIBS := $(LIBS) 147 | $(obj).target/tree_sitter_xml_binding.node: TOOLSET := $(TOOLSET) 148 | $(obj).target/tree_sitter_xml_binding.node: $(OBJS) FORCE_DO_CMD 149 | $(call do_cmd,solink_module) 150 | 151 | all_deps += $(obj).target/tree_sitter_xml_binding.node 152 | # Add target alias 153 | .PHONY: tree_sitter_xml_binding 154 | tree_sitter_xml_binding: $(builddir)/tree_sitter_xml_binding.node 155 | 156 | # Copy this to the executable output path. 157 | $(builddir)/tree_sitter_xml_binding.node: TOOLSET := $(TOOLSET) 158 | $(builddir)/tree_sitter_xml_binding.node: $(obj).target/tree_sitter_xml_binding.node FORCE_DO_CMD 159 | $(call do_cmd,copy) 160 | 161 | all_deps += $(builddir)/tree_sitter_xml_binding.node 162 | # Short alias for building this executable. 163 | .PHONY: tree_sitter_xml_binding.node 164 | tree_sitter_xml_binding.node: $(obj).target/tree_sitter_xml_binding.node $(builddir)/tree_sitter_xml_binding.node 165 | 166 | # Add executable to "all" target. 167 | .PHONY: all 168 | all: $(builddir)/tree_sitter_xml_binding.node 169 | 170 | -------------------------------------------------------------------------------- /corpus/main.txt: -------------------------------------------------------------------------------- 1 | ================================== 2 | Prolog 3 | ================================== 4 | 5 | 6 | --- 7 | 8 | (document 9 | (prolog 10 | (xml_decl (version_info) (encoding_decl) (standalone_decl)) 11 | (doctype_decl (doctype) (external_id (system_literal))))) 12 | 13 | 14 | ================================== 15 | Element declaration 16 | ================================== 17 | 19 | ]> 20 | --- 21 | 22 | (document 23 | (prolog 24 | (doctype_decl 25 | (doctype) 26 | (element_decl 27 | (element_name) 28 | (content_spec 29 | (mixed)))))) 30 | 31 | ================================== 32 | Tags 33 | ================================== 34 | 35 | --- 36 | 37 | (document 38 | (element 39 | (start_tag 40 | (tag_name)) 41 | (end_tag 42 | (tag_name)))) 43 | 44 | ================================== 45 | Tags with attributes 46 | ================================== 47 | 48 | --- 49 | 50 | (document 51 | (element 52 | (start_tag 53 | (tag_name) 54 | (attribute 55 | (attribute_name) (attribute_value)) 56 | (attribute 57 | (attribute_name) (attribute_value))) 58 | (end_tag 59 | (tag_name)))) 60 | 61 | ================================== 62 | Nested tags 63 | ================================== 64 |
Content
65 | --- 66 | 67 | (document 68 | (element 69 | (start_tag 70 | (tag_name)) 71 | (element 72 | (start_tag 73 | (tag_name)) 74 | (text) 75 | (end_tag 76 | (tag_name))) 77 | (end_tag 78 | (tag_name)))) 79 | 80 | ================================== 81 | Empty element tags (w/ attributes) 82 | ================================== 83 | 84 | --- 85 | 86 | (document 87 | (element 88 | (empty_elem_tag 89 | (tag_name) 90 | (attribute 91 | (attribute_name) (attribute_value)) 92 | (attribute 93 | (attribute_name) (attribute_value))))) 94 | 95 | ================================== 96 | Comments 97 | ================================== 98 | 99 | --- 100 | 101 | (document (comment)) 102 | -------------------------------------------------------------------------------- /examples/cd_catalog.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Empire Burlesque 5 | Bob Dylan 6 | USA 7 | Columbia 8 | 10.90 9 | 1985 10 | 11 | 12 | Hide your heart 13 | Bonnie Tyler 14 | UK 15 | CBS Records 16 | 9.90 17 | 1988 18 | 19 | 20 | Greatest Hits 21 | Dolly Parton 22 | USA 23 | RCA 24 | 9.90 25 | 1982 26 | 27 | 28 | Still got the blues 29 | Gary Moore 30 | UK 31 | Virgin records 32 | 10.20 33 | 1990 34 | 35 | 36 | Eros 37 | Eros Ramazzotti 38 | EU 39 | BMG 40 | 9.90 41 | 1997 42 | 43 | 44 | One night only 45 | Bee Gees 46 | UK 47 | Polydor 48 | 10.90 49 | 1998 50 | 51 | 52 | Sylvias Mother 53 | Dr.Hook 54 | UK 55 | CBS 56 | 8.10 57 | 1973 58 | 59 | 60 | Maggie May 61 | Rod Stewart 62 | UK 63 | Pickwick 64 | 8.50 65 | 1990 66 | 67 | 68 | Romanza 69 | Andrea Bocelli 70 | EU 71 | Polydor 72 | 10.80 73 | 1996 74 | 75 | 76 | When a man loves a woman 77 | Percy Sledge 78 | USA 79 | Atlantic 80 | 8.70 81 | 1987 82 | 83 | 84 | Black angel 85 | Savage Rose 86 | EU 87 | Mega 88 | 10.90 89 | 1995 90 | 91 | 92 | 1999 Grammy Nominees 93 | Many 94 | USA 95 | Grammy 96 | 10.20 97 | 1999 98 | 99 | 100 | For the good times 101 | Kenny Rogers 102 | UK 103 | Mucik Master 104 | 8.70 105 | 1995 106 | 107 | 108 | Big Willie style 109 | Will Smith 110 | USA 111 | Columbia 112 | 9.90 113 | 1997 114 | 115 | 116 | Tupelo Honey 117 | Van Morrison 118 | UK 119 | Polydor 120 | 8.20 121 | 1971 122 | 123 | 124 | Soulsville 125 | Jorn Hoel 126 | Norway 127 | WEA 128 | 7.90 129 | 1996 130 | 131 | 132 | The very best of 133 | Cat Stevens 134 | UK 135 | Island 136 | 8.90 137 | 1990 138 | 139 | 140 | Stop 141 | Sam Brown 142 | UK 143 | A and M 144 | 8.90 145 | 1988 146 | 147 | 148 | Bridge of Spies 149 | T'Pau 150 | UK 151 | Siren 152 | 7.90 153 | 1987 154 | 155 | 156 | Private Dancer 157 | Tina Turner 158 | UK 159 | Capitol 160 | 8.90 161 | 1983 162 | 163 | 164 | Midt om natten 165 | Kim Larsen 166 | EU 167 | Medley 168 | 7.80 169 | 1983 170 | 171 | 172 | Pavarotti Gala Concert 173 | Luciano Pavarotti 174 | UK 175 | DECCA 176 | 9.90 177 | 1991 178 | 179 | 180 | The dock of the bay 181 | Otis Redding 182 | USA 183 | Stax Records 184 | 7.90 185 | 1968 186 | 187 | 188 | Picture book 189 | Simply Red 190 | EU 191 | Elektra 192 | 7.20 193 | 1985 194 | 195 | 196 | Red 197 | The Communards 198 | UK 199 | London 200 | 7.80 201 | 1987 202 | 203 | 204 | Unchain my heart 205 | Joe Cocker 206 | USA 207 | EMI 208 | 8.20 209 | 1987 210 | 211 | -------------------------------------------------------------------------------- /examples/sample.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Samuel 5 | Jin Rowe 6 | Nov 14, 2020 7 | 1-119-884-8354 8 | 9 | 10 | Vincent 11 | Lawrence Cooper 12 | Sep 17, 2021 13 | 1-217-376-3115 14 | 15 | 16 | Wylie 17 | Scott Griffith 18 | Dec 17, 2021 19 | 230-8793 20 | 21 | 22 | Caesar 23 | Fletcher Estes 24 | Jul 29, 2021 25 | 1-762-866-7677 26 | 27 | 28 | Ali 29 | Christopher Barton 30 | Sep 23, 2021 31 | 1-485-684-6549 32 | 33 | 34 | Wesley 35 | Amos Newton 36 | Jan 25, 2021 37 | 896-8904 38 | 39 | 40 | Harding 41 | Clinton Walters 42 | Oct 12, 2020 43 | 1-757-683-9933 44 | 45 | 46 | Tyrone 47 | Dante Padilla 48 | Nov 27, 2020 49 | 1-913-917-3247 50 | 51 | 52 | Drake 53 | Evan Haney 54 | Jul 22, 2021 55 | 675-5983 56 | 57 | 58 | Colton 59 | Colt England 60 | May 11, 2020 61 | 314-1179 62 | 63 | 64 | Kermit 65 | Barclay Forbes 66 | Apr 23, 2021 67 | 215-7877 68 | 69 | 70 | Channing 71 | Mark Cobb 72 | Jan 17, 2022 73 | 787-6505 74 | 75 | 76 | Drew 77 | Reed Hopper 78 | Jan 2, 2022 79 | 1-837-775-6433 80 | 81 | 82 | Francis 83 | Scott Cantrell 84 | Jan 18, 2022 85 | 1-486-377-0108 86 | 87 | 88 | Abel 89 | Garth Reilly 90 | Sep 27, 2021 91 | 1-420-838-5707 92 | 93 | 94 | Victor 95 | Amal Patrick 96 | Mar 19, 2021 97 | 1-171-678-4012 98 | 99 | 100 | Price 101 | Thane Mercado 102 | Jan 23, 2021 103 | 1-736-809-2750 104 | 105 | 106 | Merritt 107 | Hu Rich 108 | Feb 20, 2021 109 | 219-6349 110 | 111 | 112 | Deacon 113 | Damon Carrillo 114 | Jun 11, 2021 115 | 727-1005 116 | 117 | 118 | Demetrius 119 | Zahir Joseph 120 | Jun 15, 2021 121 | 1-125-156-6715 122 | 123 | 124 | Bruce 125 | Armand Vaughan 126 | Jan 17, 2021 127 | 1-858-586-3894 128 | 129 | 130 | Malcolm 131 | Coby Boyd 132 | Jan 1, 2021 133 | 1-657-972-2752 134 | 135 | 136 | Finn 137 | Rashad Jimenez 138 | Aug 3, 2021 139 | 1-975-767-0795 140 | 141 | 142 | Brady 143 | Hector Caldwell 144 | Nov 7, 2020 145 | 891-2799 146 | 147 | 148 | Hammett 149 | Wing Sargent 150 | Aug 3, 2020 151 | 1-685-926-8940 152 | 153 | 154 | Thomas 155 | Donovan Jefferson 156 | Mar 23, 2020 157 | 508-8668 158 | 159 | 160 | Hoyt 161 | Bevis Monroe 162 | Feb 2, 2021 163 | 557-6146 164 | 165 | 166 | Michael 167 | Valentine Anthony 168 | Sep 10, 2020 169 | 331-5607 170 | 171 | 172 | Magee 173 | Hunter Rich 174 | Nov 2, 2021 175 | 1-415-590-9707 176 | 177 | 178 | Brandon 179 | Valentine Terrell 180 | May 25, 2021 181 | 556-5113 182 | 183 | 184 | Kevin 185 | Thaddeus Daniels 186 | Mar 17, 2020 187 | 1-993-870-8791 188 | 189 | 190 | Fletcher 191 | Tiger Sawyer 192 | Jan 28, 2021 193 | 1-396-755-7909 194 | 195 | 196 | Ezra 197 | Joel Doyle 198 | Sep 27, 2021 199 | 989-2266 200 | 201 | 202 | Ronan 203 | Lester Gibbs 204 | Oct 4, 2021 205 | 325-5298 206 | 207 | 208 | Patrick 209 | Vance Mathews 210 | Jul 12, 2021 211 | 937-5548 212 | 213 | 214 | Ralph 215 | Daquan Hale 216 | Feb 12, 2020 217 | 1-403-682-4351 218 | 219 | 220 | Xanthus 221 | Valentine Cherry 222 | Jun 18, 2020 223 | 917-0536 224 | 225 | 226 | Amery 227 | Brady Kline 228 | Feb 17, 2021 229 | 431-5663 230 | 231 | 232 | Elvis 233 | Joshua Cortez 234 | Nov 5, 2020 235 | 1-755-208-7392 236 | 237 | 238 | Jasper 239 | Grady Day 240 | Mar 15, 2021 241 | 1-584-535-7445 242 | 243 | 244 | August 245 | Brent Carrillo 246 | Apr 2, 2020 247 | 840-2645 248 | 249 | 250 | Axel 251 | Dolan Mcleod 252 | Oct 31, 2020 253 | 212-3290 254 | 255 | 256 | Cameron 257 | Cruz Rodriquez 258 | Jul 24, 2020 259 | 891-9416 260 | 261 | 262 | Fulton 263 | Ishmael Guzman 264 | Sep 1, 2020 265 | 1-779-977-3030 266 | 267 | 268 | Cain 269 | Sean Davis 270 | Feb 3, 2021 271 | 1-306-769-1944 272 | 273 | 274 | Aristotle 275 | Oleg Doyle 276 | Apr 10, 2021 277 | 771-7519 278 | 279 | 280 | Prescott 281 | Raymond Davenport 282 | Apr 10, 2020 283 | 1-762-999-7220 284 | 285 | 286 | Xavier 287 | Wyatt Weaver 288 | Jan 4, 2021 289 | 371-9729 290 | 291 | 292 | Adam 293 | Byron Wooten 294 | Sep 7, 2021 295 | 1-951-281-5899 296 | 297 | 298 | Devin 299 | Herman Kirkland 300 | Feb 6, 2020 301 | 1-268-748-9115 302 | 303 | 304 | Berk 305 | Porter Nielsen 306 | Feb 1, 2020 307 | 1-916-876-9174 308 | 309 | 310 | Len 311 | Lester Gaines 312 | Sep 12, 2021 313 | 1-916-501-5676 314 | 315 | 316 | Rajah 317 | Driscoll Hunter 318 | Apr 28, 2021 319 | 130-5350 320 | 321 | 322 | Adrian 323 | Elliott Chambers 324 | Aug 13, 2020 325 | 1-596-452-6959 326 | 327 | 328 | Howard 329 | Leroy Guthrie 330 | Nov 13, 2021 331 | 115-3159 332 | 333 | 334 | Rigel 335 | Buckminster Sloan 336 | May 5, 2021 337 | 498-4593 338 | 339 | 340 | Elijah 341 | Rafael Rosa 342 | Nov 9, 2021 343 | 868-0298 344 | 345 | 346 | David 347 | Sawyer Wiggins 348 | May 28, 2020 349 | 671-3011 350 | 351 | 352 | Devin 353 | Ivan Holloway 354 | Dec 7, 2020 355 | 1-391-821-8047 356 | 357 | 358 | Adrian 359 | Garrison Gordon 360 | Aug 15, 2021 361 | 1-151-737-8680 362 | 363 | 364 | Macon 365 | Devin Shaw 366 | Sep 24, 2021 367 | 1-933-905-8473 368 | 369 | 370 | Ahmed 371 | Eric Norman 372 | Oct 24, 2020 373 | 258-3253 374 | 375 | 376 | Amos 377 | Lester Hutchinson 378 | May 28, 2021 379 | 1-408-668-9124 380 | 381 | 382 | Louis 383 | Guy Gill 384 | Jun 26, 2021 385 | 1-996-173-6149 386 | 387 | 388 | Caleb 389 | Noble Schmidt 390 | Jul 11, 2021 391 | 1-689-683-9130 392 | 393 | 394 | Nathan 395 | Aquila Schultz 396 | Feb 21, 2021 397 | 1-475-761-8063 398 | 399 | 400 | Jonah 401 | Marvin May 402 | Oct 20, 2020 403 | 1-894-165-9749 404 | 405 | 406 | Gregory 407 | Nissim Pena 408 | Apr 13, 2020 409 | 1-875-878-4720 410 | 411 | 412 | Wing 413 | Graham Clark 414 | Mar 19, 2020 415 | 972-1235 416 | 417 | 418 | Theodore 419 | Philip Williams 420 | Feb 23, 2020 421 | 1-862-344-0851 422 | 423 | 424 | Axel 425 | Isaiah Bryant 426 | Nov 9, 2020 427 | 310-3836 428 | 429 | 430 | Adam 431 | Brennan Maynard 432 | Dec 3, 2021 433 | 324-0939 434 | 435 | 436 | Quamar 437 | Cain Parsons 438 | Jun 4, 2020 439 | 1-272-454-0090 440 | 441 | 442 | Brady 443 | Seth Silva 444 | Sep 22, 2021 445 | 1-550-980-3615 446 | 447 | 448 | Geoffrey 449 | Talon Callahan 450 | May 3, 2020 451 | 1-532-400-6026 452 | 453 | 454 | Noble 455 | Chadwick Randall 456 | Oct 22, 2021 457 | 1-160-128-4971 458 | 459 | 460 | Demetrius 461 | Hector Pacheco 462 | Apr 19, 2021 463 | 507-0753 464 | 465 | 466 | Zeus 467 | Keefe Keller 468 | Dec 19, 2020 469 | 386-6079 470 | 471 | 472 | Colt 473 | Preston Valenzuela 474 | Oct 26, 2020 475 | 505-9398 476 | 477 | 478 | Aidan 479 | Brent Ramirez 480 | May 14, 2020 481 | 845-0853 482 | 483 | 484 | Philip 485 | Raymond Martin 486 | May 30, 2021 487 | 174-5472 488 | 489 | 490 | Amal 491 | Jermaine Huber 492 | Nov 20, 2020 493 | 1-885-257-1904 494 | 495 | 496 | Hoyt 497 | Ethan Watts 498 | Sep 27, 2021 499 | 1-758-175-1715 500 | 501 | 502 | Graiden 503 | Asher Osborne 504 | May 16, 2020 505 | 664-2792 506 | 507 | 508 | Nero 509 | Zephania Cote 510 | Sep 27, 2020 511 | 182-7432 512 | 513 | 514 | Grant 515 | Russell Burgess 516 | May 12, 2020 517 | 1-542-647-6696 518 | 519 | 520 | Flynn 521 | Jin Bird 522 | Jul 9, 2021 523 | 641-5871 524 | 525 | 526 | Branden 527 | Stuart Irwin 528 | Jul 22, 2021 529 | 128-2287 530 | 531 | 532 | Ferdinand 533 | Yoshio Howard 534 | Jan 20, 2021 535 | 179-8009 536 | 537 | 538 | Amir 539 | Wayne Blankenship 540 | Jul 13, 2021 541 | 422-8639 542 | 543 | 544 | Mannix 545 | Hammett Wade 546 | May 22, 2020 547 | 1-968-637-1476 548 | 549 | 550 | Quinn 551 | Valentine Vinson 552 | Aug 16, 2020 553 | 1-401-392-7052 554 | 555 | 556 | Burton 557 | Alden Stark 558 | May 23, 2020 559 | 1-875-392-9392 560 | 561 | 562 | Tanner 563 | Damian Richards 564 | Aug 24, 2021 565 | 1-809-568-2669 566 | 567 | 568 | Evan 569 | Charles Willis 570 | Nov 18, 2021 571 | 442-6490 572 | 573 | 574 | Graiden 575 | Reece Ortega 576 | Oct 5, 2020 577 | 1-887-651-9291 578 | 579 | 580 | Calvin 581 | Connor Hubbard 582 | Oct 6, 2020 583 | 1-808-709-0596 584 | 585 | 586 | Sawyer 587 | August Hendricks 588 | Feb 5, 2021 589 | 1-994-613-0412 590 | 591 | 592 | Lewis 593 | Dean Schmidt 594 | Jan 16, 2021 595 | 1-185-372-5045 596 | 597 | 598 | Howard 599 | Lionel Terrell 600 | Jun 29, 2020 601 | 1-331-261-7890 602 | 603 | -------------------------------------------------------------------------------- /examples/simple.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Belgian Waffles 5 | $5.95 6 | Two of our famous Belgian Waffles with plenty of real maple syrup 7 | 650 8 | 9 | 10 | Strawberry Belgian Waffles 11 | $7.95 12 | Light Belgian waffles covered with strawberries and whipped cream 13 | 900 14 | 15 | 16 | Berry-Berry Belgian Waffles 17 | $8.95 18 | Light Belgian waffles covered with an assortment of fresh berries and whipped cream 19 | 900 20 | 21 | 22 | French Toast 23 | $4.50 24 | Thick slices made from our homemade sourdough bread 25 | 600 26 | 27 | 28 | Homestyle Breakfast 29 | $6.95 30 | Two eggs, bacon or sausage, toast, and our ever-popular hash browns 31 | 950 32 | 33 | -------------------------------------------------------------------------------- /grammar.js: -------------------------------------------------------------------------------- 1 | module.exports = grammar({ 2 | name: 'xml', 3 | 4 | extras: $ => [], 5 | 6 | inline: $ => [ 7 | $._eq 8 | ], 9 | 10 | rules: { 11 | document: $ => seq( 12 | repeat($.prolog), 13 | repeat($.element), 14 | repeat($._misc) 15 | ), 16 | 17 | /** Names and Tokens **/ 18 | 19 | _name_char: $ => choice ( 20 | /\w/, 21 | '.', 22 | '-', 23 | ':', 24 | /[\u0300-\u0345\u0360-\u0361\u0483-\u0486\u0591-\u05A1\u05A3-\u05B9\u05BB-\u05BD]/, 25 | /[\u05BF\u05C4\u0670\u093C\u094D\u09BC\u09BE\u09BF\u09D7\u0A02\u0A3C\u0A3E\u0A3F]/, 26 | /[\u05C1-\u05C2\u064B-\u0652\u06D6-\u06DC\u06DD-\u06DF\u06E0-\u06E4\u06E7-\u06E8]/, 27 | /[\u06EA-\u06ED\u0901-\u0903\u093E-\u094C\u0951-\u0954\u0962-\u0963\u0981-\u0983]/, 28 | /[\u09C0-\u09C4\u09C7-\u09C8\u09CB-\u09CD\u09E2-\u09E3\u0A40-\u0A42\u0A47-\u0A48]/, 29 | /[\u0A4B-\u0A4D\u0A70-\u0A71\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u3005]/, 30 | /[\u0ACB-\u0ACD\u0B01-\u0B03\u0B3C\u309A\u00B7\u02D0\u02D1\u0387\u0640\u0E46\u0EC6]/, 31 | /[\u0B3E-\u0B43\u0B47-\u0B48\u0B4B-\u0B4D\u0B56-\u0B57\u0B82-\u0B83\u0BBE-\u0BC2]/, 32 | /[\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0E31]/, 33 | /[\u0C01-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55-\u0C56\u0C82-\u0C83]/, 34 | /[\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5-\u0CD6\u0D02-\u0D03\u0D3E-\u0D43]/, 35 | /[\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB-\u0EBC\u0EC8-\u0ECD\u0F18-\u0F19]/, 36 | /[\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86-\u0F8B\u0F90-\u0F95\u0F97]/, 37 | /[\u0F99-\u0FAD\u0FB1-\u0FB7\u0FB9\u20D0-\u20DC\u20E1\u302A-\u302F\u3099]/, 38 | ), 39 | 40 | _name: $ => seq ( 41 | choice ( 42 | /\w/, 43 | '_', 44 | ':', 45 | ), 46 | repeat ( 47 | $._name_char 48 | ) 49 | ), 50 | 51 | names: $ => seq( 52 | $._name, 53 | repeat(seq( 54 | /\s/, 55 | $._name 56 | )) 57 | ), 58 | 59 | nm_token: $ => repeat1($._name_char), 60 | 61 | nm_tokens: $ => seq ( 62 | $.nm_token, 63 | repeat(seq( 64 | /\s/, 65 | $.nm_token 66 | )) 67 | ), 68 | 69 | /** Literals **/ 70 | 71 | entity_value: $ => choice ( 72 | seq( 73 | '"', 74 | repeat(choice( 75 | /[^<&"]/, 76 | $.pe_reference, 77 | $.reference 78 | )) 79 | ) 80 | ), 81 | 82 | attribute_value: $ => choice ( 83 | seq ( 84 | '"', 85 | repeat(choice( 86 | /[^<&"]/, 87 | $.reference 88 | )), 89 | '"' 90 | ), 91 | seq ( 92 | "'", 93 | repeat(choice( 94 | /[^<&"]/, 95 | $.reference 96 | )), 97 | "'" 98 | ) 99 | ), 100 | 101 | system_literal: $ => choice( 102 | seq( 103 | '"', 104 | /[^"]*/, 105 | '"' 106 | ), 107 | seq( 108 | "'", 109 | /[^"]*/, 110 | "'" 111 | ) 112 | ), 113 | 114 | pubid_literal: $ => choice ( 115 | seq( 116 | '"', 117 | repeat( 118 | $.pubid_char 119 | ), 120 | '"' 121 | ), 122 | seq( 123 | "'", 124 | repeat( 125 | $.pubid_char 126 | ), 127 | "'" 128 | ), 129 | ), 130 | 131 | pubid_char: $ => /[ \r\na-zA-Z0-9-"()+,./:=?;!*#@$_%]/, 132 | 133 | /** Character Data **/ 134 | 135 | _char_data: $ => /[^<&]+/, 136 | 137 | /** Comments **/ 138 | 139 | comment: $ => seq ( 140 | '' 148 | ), 149 | 150 | /** Processing instructions **/ 151 | 152 | processing_instructions: $ => seq ( 153 | ''.]/ 158 | )), 159 | '?>' 160 | ), 161 | 162 | pi_target: $ => $._name, // This should exclude [Xx][Mm][Ll] eventually too 163 | 164 | /** CDATA Sections **/ 165 | 166 | cdata_sect: $ => seq( 167 | $._cdata_start, 168 | $.cdata, 169 | $._cdata_end 170 | ), 171 | 172 | _cdata_start: $ => ' /./, 175 | 176 | _cdata_end: $ => ']]>', 177 | 178 | /** Prolog **/ 179 | 180 | prolog: $ => prec.right(choice( 181 | seq( 182 | $.xml_decl, 183 | optional($._misc), 184 | ), 185 | seq( 186 | $.xml_decl, 187 | optional($._misc), 188 | $.doctype_decl, 189 | optional($._misc), 190 | ), 191 | seq( 192 | optional($._misc), 193 | $.doctype_decl, 194 | optional($._misc) 195 | ), 196 | )), 197 | 198 | xml_decl: $ => seq ( 199 | '' 206 | ), 207 | 208 | version_info: $ => seq( 209 | 'version', 210 | $._eq, 211 | choice( 212 | seq( 213 | '"', 214 | $._version_num, 215 | '"' 216 | ), 217 | seq( 218 | "'", 219 | $._version_num, 220 | "'" 221 | ) 222 | ), 223 | ), 224 | 225 | _eq: $ => seq( 226 | optional(/\s/), 227 | '=', 228 | optional(/\s/), 229 | ), 230 | 231 | _version_num: $ => seq ( 232 | '1.', 233 | /[0-9]+/, 234 | ), 235 | 236 | _misc: $ => choice( 237 | $.comment, 238 | $.processing_instructions, 239 | /\s/ 240 | ), 241 | 242 | /** Document Type Definition **/ 243 | 244 | doctype_decl: $ => seq ( 245 | '' 261 | ), 262 | 263 | _markup_decl: $ => choice( 264 | $.element_decl, 265 | $.attlist_decl, 266 | $.entity_decl, 267 | $.notation_decl, 268 | $.processing_instructions, 269 | $.comment 270 | ), 271 | 272 | /** External Subset **/ 273 | 274 | external_subset: $ => seq( 275 | optional($.text_decl), 276 | repeat($.external_subset_decl) 277 | ), 278 | 279 | external_subset_decl: $ => choice( 280 | $._markup_decl, 281 | $.conditional_sect, 282 | $.pe_reference 283 | ), 284 | 285 | 286 | /** Standalone Document Declaration **/ 287 | 288 | standalone_decl: $ => seq( 289 | /\s/, 290 | 'standalone', 291 | $._eq, 292 | choice( 293 | seq( 294 | '"', 295 | choice( 296 | 'yes', 297 | 'no' 298 | ), 299 | '"' 300 | ), 301 | seq( 302 | "'", 303 | choice( 304 | 'yes', 305 | 'no' 306 | ), 307 | "'" 308 | ) 309 | ) 310 | ), 311 | 312 | /** Language Identification **/ 313 | 314 | language_id: $ => seq( 315 | $.langcode, 316 | optional(seq( 317 | '-', 318 | $.sub_code 319 | )) 320 | ), 321 | 322 | langcode: $ => choice( 323 | $._iso639_code, 324 | $._iana_code, 325 | $._user_code 326 | ), 327 | 328 | _iso639_code: $ => seq( 329 | choice( 330 | /[a-z]/, 331 | /[A-Z]/, 332 | ), 333 | choice( 334 | /[a-z]/, 335 | /[A-Z]/, 336 | ), 337 | ), 338 | 339 | _iana_code: $ => seq( 340 | choice( 341 | 'i', 342 | 'I' 343 | ), 344 | '-', 345 | repeat1( 346 | choice( 347 | /[a-z]/, 348 | /[A-Z]/ 349 | ) 350 | ) 351 | ), 352 | 353 | _user_code: $ => seq( 354 | choice( 355 | 'x', 356 | 'X' 357 | ), 358 | '-', 359 | repeat1( 360 | choice( 361 | /[a-z]/, 362 | /[A-Z]/ 363 | ) 364 | ) 365 | ), 366 | 367 | sub_code: $ => repeat1( 368 | choice( 369 | /[a-z]/, 370 | /[A-Z]/ 371 | ) 372 | ), 373 | 374 | /** Element **/ 375 | 376 | element: $ => choice( 377 | seq( 378 | $.start_tag, 379 | optional($._content), 380 | $.end_tag 381 | ), 382 | $.empty_elem_tag, 383 | ), 384 | 385 | /** Start-tag **/ 386 | 387 | start_tag: $ => seq ( 388 | '<', 389 | alias($._name, $.tag_name), 390 | repeat( 391 | seq ( 392 | /\s/, 393 | $.attribute 394 | ) 395 | ), 396 | optional(/\s/), 397 | '>' 398 | ), 399 | 400 | attribute: $ => seq( 401 | alias($._name, $.attribute_name), 402 | $._eq, 403 | $.attribute_value 404 | ), 405 | 406 | /** End-tag **/ 407 | 408 | end_tag: $ => seq ( // TODO: Make sure closing tag matches opening tag? 409 | '' 413 | ), 414 | 415 | /** Content of Elements **/ 416 | 417 | _content: $ => repeat1 ( choice ( 418 | $.element, 419 | $.cdata_sect, 420 | alias($._char_data, $.text), 421 | $.reference, 422 | $.processing_instructions, 423 | $.comment, 424 | )), 425 | 426 | /** Tags for Empty Elements **/ 427 | 428 | empty_elem_tag: $ => seq ( 429 | '<', 430 | alias($._name, $.tag_name), 431 | repeat( 432 | seq ( 433 | /\s/, 434 | $.attribute 435 | ) 436 | ), 437 | optional(/\s/), 438 | '/>' 439 | ), 440 | 441 | /** Element Type Declaration **/ 442 | 443 | element_decl: $ => seq( 444 | '' 451 | ), 452 | 453 | content_spec: $ => choice( 454 | 'EMPTY', 455 | 'ANY', 456 | $.mixed, 457 | $.children 458 | ), 459 | 460 | /** Element-content Models **/ 461 | 462 | children: $ => seq( 463 | choice( 464 | $.element_choice, 465 | $.element_seq 466 | ), 467 | optional(choice( 468 | '?', 469 | '*', 470 | '+' 471 | )) 472 | ), 473 | 474 | cp: $ => seq( 475 | choice( 476 | $._name, 477 | $.element_choice, 478 | $.element_seq 479 | ), 480 | optional(choice( 481 | '?', 482 | '*', 483 | "+" 484 | )) 485 | ), 486 | 487 | element_choice: $ => seq( 488 | '(', 489 | optional(/\s/), 490 | $.cp, 491 | repeat1( 492 | seq( 493 | optional(/\s/), 494 | '|', 495 | optional(/\s/), 496 | $.cp 497 | ), 498 | ), 499 | optional(/\s/), 500 | ')' 501 | ), 502 | 503 | element_seq: $ => seq( 504 | '(', 505 | optional(/\s/), 506 | $.cp, 507 | repeat( 508 | seq( 509 | optional(/\s/), 510 | ',', 511 | optional(/\s/), 512 | $.cp 513 | ), 514 | ), 515 | optional(/\s/), 516 | ')' 517 | ), 518 | 519 | /** Mixed-content Declaration **/ 520 | 521 | mixed: $ => prec.right(choice( 522 | seq( 523 | '(', 524 | optional(/\s/), 525 | '#PCDATA', 526 | repeat( 527 | seq( 528 | optional(/\s/), 529 | '|', 530 | optional(/\s/), 531 | $._name 532 | ), 533 | ), 534 | optional(/\s/), 535 | ')*' 536 | ), 537 | seq( 538 | '(', 539 | optional(/\s/), 540 | '#PCDATA', 541 | optional(/\s/), 542 | ')' 543 | ), 544 | )), 545 | 546 | /** Attribute-list Declaration **/ 547 | 548 | attlist_decl: $ => seq( 549 | '' 555 | ), 556 | 557 | attribute_def: $ => seq( 558 | /\s/, 559 | alias($._name, $.attribute_name), 560 | /\s/, 561 | $.attribute_type, 562 | /\s/, 563 | $.default_decl 564 | ), 565 | 566 | /** Attribute Types **/ 567 | 568 | attribute_type: $ => choice( 569 | $._string_type, 570 | $._tokenized_type, 571 | $._enumerated_type 572 | ), 573 | 574 | _string_type: $ => 'CDATA', 575 | 576 | _tokenized_type: $ => choice( 577 | 'ID', 578 | 'IDREF', 579 | 'IDREFS', 580 | 'ENTITY', 581 | 'ENTITIES', 582 | 'NMTOKEN', 583 | 'NMTOKENS' 584 | ), 585 | 586 | /** Enumerated Attribute Types **/ 587 | 588 | _enumerated_type: $ => choice ( 589 | $.notation_type, 590 | $.enumeration 591 | ), 592 | 593 | notation_type: $ => seq( 594 | 'NOTATION', 595 | /\s/, 596 | '(', 597 | optional(/\s/), 598 | alias($._name, $.notation_type_name), 599 | repeat( 600 | seq( 601 | optional(/\s/), 602 | '|', 603 | optional(/\s/), 604 | alias($._name,$.notation_type_name), 605 | ), 606 | ), 607 | ')' 608 | ), 609 | 610 | enumeration: $ => seq( 611 | '(', 612 | optional(/\s/), 613 | $.nm_token, 614 | repeat( 615 | seq( 616 | optional(/\s/), 617 | '|', 618 | optional(/\s/), 619 | $.nm_token 620 | ), 621 | ), 622 | optional(/\s/), 623 | ')' 624 | ), 625 | 626 | /** Attribute Defaults **/ 627 | 628 | default_decl: $ => choice( 629 | '#REQUIRED', 630 | '#IMPLIED', 631 | seq( 632 | optional( 633 | seq( 634 | '#FIXED', 635 | optional(/\s/), 636 | ) 637 | ), 638 | $.attribute_value 639 | ) 640 | ), 641 | 642 | /** Conditional Section **/ 643 | 644 | conditional_sect: $ => choice( 645 | $.include_sect, 646 | $.ignore_sect 647 | ), 648 | 649 | include_sect: $ => seq( 650 | '' 657 | ), 658 | 659 | ignore_sect: $ => seq( 660 | '' 667 | ), 668 | 669 | ignore_sect_contents: $ => seq( 670 | $.ignore, 671 | repeat( 672 | seq( 673 | '', 676 | $.ignore 677 | ), 678 | ) 679 | ), 680 | 681 | ignore: $ => /./, // Not technically accurate, but close enough for now 682 | 683 | /** Character Reference **/ 684 | 685 | char_ref: $ => choice( 686 | seq( 687 | '&#', 688 | /[0-9]+/, 689 | ';' 690 | ), 691 | seq( 692 | '&#x', 693 | /[0-9a-fA-F]+/, 694 | ';' 695 | ) 696 | ), 697 | 698 | /** Entity Reference **/ 699 | 700 | reference: $ => choice ( 701 | $.entity_ref, 702 | $.char_ref 703 | ), 704 | 705 | entity_ref: $ => seq( 706 | '&', 707 | $._name, 708 | ';' 709 | ), 710 | 711 | pe_reference: $ => seq( 712 | '%', 713 | $._name, 714 | ';', 715 | ), 716 | 717 | /** Entity Declaration **/ 718 | 719 | entity_decl: $ => choice( 720 | $.ge_decl, 721 | $.pe_decl 722 | ), 723 | 724 | ge_decl: $ => seq( 725 | '' 732 | ), 733 | 734 | pe_decl: $ => seq( 735 | '' 744 | ), 745 | 746 | entity_def: $ => prec.left(choice( 747 | $.entity_value, 748 | seq( 749 | $.external_id, 750 | optional($.ndata_decl) 751 | ) 752 | )), 753 | 754 | pe_def: $ => choice( 755 | $.entity_value, 756 | $.external_id, 757 | ), 758 | 759 | /** External Entity Declaration **/ 760 | 761 | external_id: $ => choice ( 762 | seq( 763 | 'SYSTEM', 764 | /\s/, 765 | $.system_literal, 766 | ), 767 | seq( 768 | 'PUBLIC', 769 | /\s/, 770 | $.pubid_literal, 771 | /\s/, 772 | $.system_literal 773 | ) 774 | ), 775 | 776 | ndata_decl: $ => seq( 777 | /\s/, 778 | 'NDATA', 779 | /\s/, 780 | alias($._name, $.ndata_name) 781 | ), 782 | 783 | /** Text Declaration **/ 784 | 785 | text_decl: $ => seq( 786 | '' 791 | ), 792 | 793 | /** Well-formed External Parsed Entity **/ 794 | 795 | 796 | external_parsed_ent: $ => seq( 797 | optional($.text_decl), 798 | $._content 799 | ), 800 | 801 | external_pe: $ => seq( 802 | optional($.text_decl), 803 | $.external_subset_decl 804 | ), 805 | 806 | /** Encoding Declaration **/ 807 | 808 | encoding_decl: $ => seq( 809 | /\s/, 810 | 'encoding', 811 | $._eq, 812 | choice( 813 | seq( 814 | '"', 815 | $._enc_name, 816 | '"' 817 | ), 818 | seq( 819 | "'", 820 | $._enc_name, 821 | "'" 822 | ) 823 | ) 824 | ), 825 | 826 | _enc_name: $ => seq( 827 | /[A-Za-z]/, 828 | repeat( 829 | choice( 830 | /[A-Za-z0-9._]/, 831 | '-', 832 | ), 833 | ), 834 | ), 835 | 836 | /** Notation Declaration **/ 837 | 838 | notation_decl: $ => seq( 839 | '' 849 | ), 850 | 851 | public_id: $ => prec.left(seq( 852 | 'PUBLIC', 853 | /\s/, 854 | $.pubid_literal 855 | )), 856 | 857 | } 858 | }) 859 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | try { 2 | module.exports = require("./build/Release/tree_sitter_xml_binding"); 3 | } catch (error) { 4 | try { 5 | module.exports = require("./build/Debug/tree_sitter_xml_binding"); 6 | } catch (_) { 7 | throw error 8 | } 9 | } 10 | 11 | try { 12 | module.exports.nodeTypeInfo = require("./src/node-types.json"); 13 | } catch (_) {} 14 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tree-sitter-xml", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "@babel/code-frame": { 8 | "version": "7.12.11", 9 | "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", 10 | "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", 11 | "dev": true, 12 | "requires": { 13 | "@babel/highlight": "^7.10.4" 14 | } 15 | }, 16 | "@babel/helper-validator-identifier": { 17 | "version": "7.12.11", 18 | "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz", 19 | "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==", 20 | "dev": true 21 | }, 22 | "@babel/highlight": { 23 | "version": "7.10.4", 24 | "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", 25 | "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", 26 | "dev": true, 27 | "requires": { 28 | "@babel/helper-validator-identifier": "^7.10.4", 29 | "chalk": "^2.0.0", 30 | "js-tokens": "^4.0.0" 31 | }, 32 | "dependencies": { 33 | "chalk": { 34 | "version": "2.4.2", 35 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", 36 | "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", 37 | "dev": true, 38 | "requires": { 39 | "ansi-styles": "^3.2.1", 40 | "escape-string-regexp": "^1.0.5", 41 | "supports-color": "^5.3.0" 42 | } 43 | } 44 | } 45 | }, 46 | "@eslint/eslintrc": { 47 | "version": "0.3.0", 48 | "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.3.0.tgz", 49 | "integrity": "sha512-1JTKgrOKAHVivSvOYw+sJOunkBjUOvjqWk1DPja7ZFhIS2mX/4EgTT8M7eTK9jrKhL/FvXXEbQwIs3pg1xp3dg==", 50 | "dev": true, 51 | "requires": { 52 | "ajv": "^6.12.4", 53 | "debug": "^4.1.1", 54 | "espree": "^7.3.0", 55 | "globals": "^12.1.0", 56 | "ignore": "^4.0.6", 57 | "import-fresh": "^3.2.1", 58 | "js-yaml": "^3.13.1", 59 | "lodash": "^4.17.20", 60 | "minimatch": "^3.0.4", 61 | "strip-json-comments": "^3.1.1" 62 | } 63 | }, 64 | "acorn": { 65 | "version": "7.4.1", 66 | "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", 67 | "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", 68 | "dev": true 69 | }, 70 | "acorn-jsx": { 71 | "version": "5.3.1", 72 | "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", 73 | "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", 74 | "dev": true 75 | }, 76 | "ajv": { 77 | "version": "6.12.6", 78 | "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", 79 | "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", 80 | "dev": true, 81 | "requires": { 82 | "fast-deep-equal": "^3.1.1", 83 | "fast-json-stable-stringify": "^2.0.0", 84 | "json-schema-traverse": "^0.4.1", 85 | "uri-js": "^4.2.2" 86 | } 87 | }, 88 | "ansi-colors": { 89 | "version": "4.1.1", 90 | "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", 91 | "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", 92 | "dev": true 93 | }, 94 | "ansi-regex": { 95 | "version": "5.0.0", 96 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", 97 | "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", 98 | "dev": true 99 | }, 100 | "ansi-styles": { 101 | "version": "3.2.1", 102 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", 103 | "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", 104 | "dev": true, 105 | "requires": { 106 | "color-convert": "^1.9.0" 107 | } 108 | }, 109 | "argparse": { 110 | "version": "1.0.10", 111 | "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", 112 | "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", 113 | "dev": true, 114 | "requires": { 115 | "sprintf-js": "~1.0.2" 116 | } 117 | }, 118 | "astral-regex": { 119 | "version": "2.0.0", 120 | "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", 121 | "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", 122 | "dev": true 123 | }, 124 | "balanced-match": { 125 | "version": "1.0.0", 126 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", 127 | "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", 128 | "dev": true 129 | }, 130 | "brace-expansion": { 131 | "version": "1.1.11", 132 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", 133 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", 134 | "dev": true, 135 | "requires": { 136 | "balanced-match": "^1.0.0", 137 | "concat-map": "0.0.1" 138 | } 139 | }, 140 | "callsites": { 141 | "version": "3.1.0", 142 | "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", 143 | "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", 144 | "dev": true 145 | }, 146 | "chalk": { 147 | "version": "4.1.0", 148 | "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", 149 | "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", 150 | "dev": true, 151 | "requires": { 152 | "ansi-styles": "^4.1.0", 153 | "supports-color": "^7.1.0" 154 | }, 155 | "dependencies": { 156 | "ansi-styles": { 157 | "version": "4.3.0", 158 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", 159 | "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", 160 | "dev": true, 161 | "requires": { 162 | "color-convert": "^2.0.1" 163 | } 164 | }, 165 | "color-convert": { 166 | "version": "2.0.1", 167 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", 168 | "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", 169 | "dev": true, 170 | "requires": { 171 | "color-name": "~1.1.4" 172 | } 173 | }, 174 | "color-name": { 175 | "version": "1.1.4", 176 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", 177 | "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", 178 | "dev": true 179 | }, 180 | "has-flag": { 181 | "version": "4.0.0", 182 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", 183 | "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", 184 | "dev": true 185 | }, 186 | "supports-color": { 187 | "version": "7.2.0", 188 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", 189 | "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", 190 | "dev": true, 191 | "requires": { 192 | "has-flag": "^4.0.0" 193 | } 194 | } 195 | } 196 | }, 197 | "color-convert": { 198 | "version": "1.9.3", 199 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", 200 | "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", 201 | "dev": true, 202 | "requires": { 203 | "color-name": "1.1.3" 204 | } 205 | }, 206 | "color-name": { 207 | "version": "1.1.3", 208 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", 209 | "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", 210 | "dev": true 211 | }, 212 | "concat-map": { 213 | "version": "0.0.1", 214 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", 215 | "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", 216 | "dev": true 217 | }, 218 | "cross-spawn": { 219 | "version": "7.0.3", 220 | "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", 221 | "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", 222 | "dev": true, 223 | "requires": { 224 | "path-key": "^3.1.0", 225 | "shebang-command": "^2.0.0", 226 | "which": "^2.0.1" 227 | } 228 | }, 229 | "debug": { 230 | "version": "4.3.1", 231 | "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", 232 | "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", 233 | "dev": true, 234 | "requires": { 235 | "ms": "2.1.2" 236 | } 237 | }, 238 | "deep-is": { 239 | "version": "0.1.3", 240 | "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", 241 | "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", 242 | "dev": true 243 | }, 244 | "doctrine": { 245 | "version": "3.0.0", 246 | "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", 247 | "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", 248 | "dev": true, 249 | "requires": { 250 | "esutils": "^2.0.2" 251 | } 252 | }, 253 | "emoji-regex": { 254 | "version": "8.0.0", 255 | "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", 256 | "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", 257 | "dev": true 258 | }, 259 | "enquirer": { 260 | "version": "2.3.6", 261 | "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", 262 | "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", 263 | "dev": true, 264 | "requires": { 265 | "ansi-colors": "^4.1.1" 266 | } 267 | }, 268 | "escape-string-regexp": { 269 | "version": "1.0.5", 270 | "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", 271 | "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", 272 | "dev": true 273 | }, 274 | "eslint": { 275 | "version": "7.18.0", 276 | "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.18.0.tgz", 277 | "integrity": "sha512-fbgTiE8BfUJZuBeq2Yi7J3RB3WGUQ9PNuNbmgi6jt9Iv8qrkxfy19Ds3OpL1Pm7zg3BtTVhvcUZbIRQ0wmSjAQ==", 278 | "dev": true, 279 | "requires": { 280 | "@babel/code-frame": "^7.0.0", 281 | "@eslint/eslintrc": "^0.3.0", 282 | "ajv": "^6.10.0", 283 | "chalk": "^4.0.0", 284 | "cross-spawn": "^7.0.2", 285 | "debug": "^4.0.1", 286 | "doctrine": "^3.0.0", 287 | "enquirer": "^2.3.5", 288 | "eslint-scope": "^5.1.1", 289 | "eslint-utils": "^2.1.0", 290 | "eslint-visitor-keys": "^2.0.0", 291 | "espree": "^7.3.1", 292 | "esquery": "^1.2.0", 293 | "esutils": "^2.0.2", 294 | "file-entry-cache": "^6.0.0", 295 | "functional-red-black-tree": "^1.0.1", 296 | "glob-parent": "^5.0.0", 297 | "globals": "^12.1.0", 298 | "ignore": "^4.0.6", 299 | "import-fresh": "^3.0.0", 300 | "imurmurhash": "^0.1.4", 301 | "is-glob": "^4.0.0", 302 | "js-yaml": "^3.13.1", 303 | "json-stable-stringify-without-jsonify": "^1.0.1", 304 | "levn": "^0.4.1", 305 | "lodash": "^4.17.20", 306 | "minimatch": "^3.0.4", 307 | "natural-compare": "^1.4.0", 308 | "optionator": "^0.9.1", 309 | "progress": "^2.0.0", 310 | "regexpp": "^3.1.0", 311 | "semver": "^7.2.1", 312 | "strip-ansi": "^6.0.0", 313 | "strip-json-comments": "^3.1.0", 314 | "table": "^6.0.4", 315 | "text-table": "^0.2.0", 316 | "v8-compile-cache": "^2.0.3" 317 | } 318 | }, 319 | "eslint-scope": { 320 | "version": "5.1.1", 321 | "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", 322 | "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", 323 | "dev": true, 324 | "requires": { 325 | "esrecurse": "^4.3.0", 326 | "estraverse": "^4.1.1" 327 | } 328 | }, 329 | "eslint-utils": { 330 | "version": "2.1.0", 331 | "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", 332 | "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", 333 | "dev": true, 334 | "requires": { 335 | "eslint-visitor-keys": "^1.1.0" 336 | }, 337 | "dependencies": { 338 | "eslint-visitor-keys": { 339 | "version": "1.3.0", 340 | "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", 341 | "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", 342 | "dev": true 343 | } 344 | } 345 | }, 346 | "eslint-visitor-keys": { 347 | "version": "2.0.0", 348 | "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz", 349 | "integrity": "sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==", 350 | "dev": true 351 | }, 352 | "espree": { 353 | "version": "7.3.1", 354 | "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.1.tgz", 355 | "integrity": "sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==", 356 | "dev": true, 357 | "requires": { 358 | "acorn": "^7.4.0", 359 | "acorn-jsx": "^5.3.1", 360 | "eslint-visitor-keys": "^1.3.0" 361 | }, 362 | "dependencies": { 363 | "eslint-visitor-keys": { 364 | "version": "1.3.0", 365 | "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", 366 | "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", 367 | "dev": true 368 | } 369 | } 370 | }, 371 | "esprima": { 372 | "version": "4.0.1", 373 | "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", 374 | "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", 375 | "dev": true 376 | }, 377 | "esquery": { 378 | "version": "1.3.1", 379 | "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz", 380 | "integrity": "sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==", 381 | "dev": true, 382 | "requires": { 383 | "estraverse": "^5.1.0" 384 | }, 385 | "dependencies": { 386 | "estraverse": { 387 | "version": "5.2.0", 388 | "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", 389 | "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", 390 | "dev": true 391 | } 392 | } 393 | }, 394 | "esrecurse": { 395 | "version": "4.3.0", 396 | "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", 397 | "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", 398 | "dev": true, 399 | "requires": { 400 | "estraverse": "^5.2.0" 401 | }, 402 | "dependencies": { 403 | "estraverse": { 404 | "version": "5.2.0", 405 | "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", 406 | "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", 407 | "dev": true 408 | } 409 | } 410 | }, 411 | "estraverse": { 412 | "version": "4.3.0", 413 | "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", 414 | "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", 415 | "dev": true 416 | }, 417 | "esutils": { 418 | "version": "2.0.3", 419 | "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", 420 | "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", 421 | "dev": true 422 | }, 423 | "fast-deep-equal": { 424 | "version": "3.1.3", 425 | "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", 426 | "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", 427 | "dev": true 428 | }, 429 | "fast-json-stable-stringify": { 430 | "version": "2.1.0", 431 | "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", 432 | "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", 433 | "dev": true 434 | }, 435 | "fast-levenshtein": { 436 | "version": "2.0.6", 437 | "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", 438 | "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", 439 | "dev": true 440 | }, 441 | "file-entry-cache": { 442 | "version": "6.0.0", 443 | "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.0.tgz", 444 | "integrity": "sha512-fqoO76jZ3ZnYrXLDRxBR1YvOvc0k844kcOg40bgsPrE25LAb/PDqTY+ho64Xh2c8ZXgIKldchCFHczG2UVRcWA==", 445 | "dev": true, 446 | "requires": { 447 | "flat-cache": "^3.0.4" 448 | } 449 | }, 450 | "flat-cache": { 451 | "version": "3.0.4", 452 | "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", 453 | "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", 454 | "dev": true, 455 | "requires": { 456 | "flatted": "^3.1.0", 457 | "rimraf": "^3.0.2" 458 | } 459 | }, 460 | "flatted": { 461 | "version": "3.1.1", 462 | "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.1.tgz", 463 | "integrity": "sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==", 464 | "dev": true 465 | }, 466 | "fs.realpath": { 467 | "version": "1.0.0", 468 | "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", 469 | "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", 470 | "dev": true 471 | }, 472 | "functional-red-black-tree": { 473 | "version": "1.0.1", 474 | "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", 475 | "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", 476 | "dev": true 477 | }, 478 | "glob": { 479 | "version": "7.1.6", 480 | "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", 481 | "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", 482 | "dev": true, 483 | "requires": { 484 | "fs.realpath": "^1.0.0", 485 | "inflight": "^1.0.4", 486 | "inherits": "2", 487 | "minimatch": "^3.0.4", 488 | "once": "^1.3.0", 489 | "path-is-absolute": "^1.0.0" 490 | } 491 | }, 492 | "glob-parent": { 493 | "version": "5.1.1", 494 | "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", 495 | "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", 496 | "dev": true, 497 | "requires": { 498 | "is-glob": "^4.0.1" 499 | } 500 | }, 501 | "globals": { 502 | "version": "12.4.0", 503 | "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", 504 | "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", 505 | "dev": true, 506 | "requires": { 507 | "type-fest": "^0.8.1" 508 | } 509 | }, 510 | "has-flag": { 511 | "version": "3.0.0", 512 | "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", 513 | "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", 514 | "dev": true 515 | }, 516 | "ignore": { 517 | "version": "4.0.6", 518 | "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", 519 | "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", 520 | "dev": true 521 | }, 522 | "import-fresh": { 523 | "version": "3.3.0", 524 | "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", 525 | "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", 526 | "dev": true, 527 | "requires": { 528 | "parent-module": "^1.0.0", 529 | "resolve-from": "^4.0.0" 530 | } 531 | }, 532 | "imurmurhash": { 533 | "version": "0.1.4", 534 | "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", 535 | "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", 536 | "dev": true 537 | }, 538 | "inflight": { 539 | "version": "1.0.6", 540 | "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", 541 | "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", 542 | "dev": true, 543 | "requires": { 544 | "once": "^1.3.0", 545 | "wrappy": "1" 546 | } 547 | }, 548 | "inherits": { 549 | "version": "2.0.4", 550 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 551 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", 552 | "dev": true 553 | }, 554 | "is-extglob": { 555 | "version": "2.1.1", 556 | "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", 557 | "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", 558 | "dev": true 559 | }, 560 | "is-fullwidth-code-point": { 561 | "version": "3.0.0", 562 | "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", 563 | "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", 564 | "dev": true 565 | }, 566 | "is-glob": { 567 | "version": "4.0.1", 568 | "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", 569 | "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", 570 | "dev": true, 571 | "requires": { 572 | "is-extglob": "^2.1.1" 573 | } 574 | }, 575 | "isexe": { 576 | "version": "2.0.0", 577 | "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", 578 | "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", 579 | "dev": true 580 | }, 581 | "js-tokens": { 582 | "version": "4.0.0", 583 | "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", 584 | "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", 585 | "dev": true 586 | }, 587 | "js-yaml": { 588 | "version": "3.14.1", 589 | "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", 590 | "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", 591 | "dev": true, 592 | "requires": { 593 | "argparse": "^1.0.7", 594 | "esprima": "^4.0.0" 595 | } 596 | }, 597 | "json-schema-traverse": { 598 | "version": "0.4.1", 599 | "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", 600 | "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", 601 | "dev": true 602 | }, 603 | "json-stable-stringify-without-jsonify": { 604 | "version": "1.0.1", 605 | "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", 606 | "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", 607 | "dev": true 608 | }, 609 | "levn": { 610 | "version": "0.4.1", 611 | "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", 612 | "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", 613 | "dev": true, 614 | "requires": { 615 | "prelude-ls": "^1.2.1", 616 | "type-check": "~0.4.0" 617 | } 618 | }, 619 | "lodash": { 620 | "version": "4.17.20", 621 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", 622 | "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", 623 | "dev": true 624 | }, 625 | "lru-cache": { 626 | "version": "6.0.0", 627 | "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", 628 | "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", 629 | "dev": true, 630 | "requires": { 631 | "yallist": "^4.0.0" 632 | } 633 | }, 634 | "minimatch": { 635 | "version": "3.0.4", 636 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", 637 | "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", 638 | "dev": true, 639 | "requires": { 640 | "brace-expansion": "^1.1.7" 641 | } 642 | }, 643 | "ms": { 644 | "version": "2.1.2", 645 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", 646 | "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", 647 | "dev": true 648 | }, 649 | "nan": { 650 | "version": "2.14.2", 651 | "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.2.tgz", 652 | "integrity": "sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ==" 653 | }, 654 | "natural-compare": { 655 | "version": "1.4.0", 656 | "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", 657 | "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", 658 | "dev": true 659 | }, 660 | "once": { 661 | "version": "1.4.0", 662 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 663 | "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", 664 | "dev": true, 665 | "requires": { 666 | "wrappy": "1" 667 | } 668 | }, 669 | "optionator": { 670 | "version": "0.9.1", 671 | "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", 672 | "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", 673 | "dev": true, 674 | "requires": { 675 | "deep-is": "^0.1.3", 676 | "fast-levenshtein": "^2.0.6", 677 | "levn": "^0.4.1", 678 | "prelude-ls": "^1.2.1", 679 | "type-check": "^0.4.0", 680 | "word-wrap": "^1.2.3" 681 | } 682 | }, 683 | "parent-module": { 684 | "version": "1.0.1", 685 | "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", 686 | "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", 687 | "dev": true, 688 | "requires": { 689 | "callsites": "^3.0.0" 690 | } 691 | }, 692 | "path-is-absolute": { 693 | "version": "1.0.1", 694 | "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", 695 | "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", 696 | "dev": true 697 | }, 698 | "path-key": { 699 | "version": "3.1.1", 700 | "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", 701 | "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", 702 | "dev": true 703 | }, 704 | "prelude-ls": { 705 | "version": "1.2.1", 706 | "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", 707 | "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", 708 | "dev": true 709 | }, 710 | "progress": { 711 | "version": "2.0.3", 712 | "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", 713 | "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", 714 | "dev": true 715 | }, 716 | "punycode": { 717 | "version": "2.1.1", 718 | "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", 719 | "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", 720 | "dev": true 721 | }, 722 | "regexpp": { 723 | "version": "3.1.0", 724 | "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", 725 | "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", 726 | "dev": true 727 | }, 728 | "require-from-string": { 729 | "version": "2.0.2", 730 | "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", 731 | "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", 732 | "dev": true 733 | }, 734 | "resolve-from": { 735 | "version": "4.0.0", 736 | "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", 737 | "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", 738 | "dev": true 739 | }, 740 | "rimraf": { 741 | "version": "3.0.2", 742 | "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", 743 | "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", 744 | "dev": true, 745 | "requires": { 746 | "glob": "^7.1.3" 747 | } 748 | }, 749 | "semver": { 750 | "version": "7.3.4", 751 | "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", 752 | "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", 753 | "dev": true, 754 | "requires": { 755 | "lru-cache": "^6.0.0" 756 | } 757 | }, 758 | "shebang-command": { 759 | "version": "2.0.0", 760 | "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", 761 | "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", 762 | "dev": true, 763 | "requires": { 764 | "shebang-regex": "^3.0.0" 765 | } 766 | }, 767 | "shebang-regex": { 768 | "version": "3.0.0", 769 | "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", 770 | "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", 771 | "dev": true 772 | }, 773 | "slice-ansi": { 774 | "version": "4.0.0", 775 | "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", 776 | "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", 777 | "dev": true, 778 | "requires": { 779 | "ansi-styles": "^4.0.0", 780 | "astral-regex": "^2.0.0", 781 | "is-fullwidth-code-point": "^3.0.0" 782 | }, 783 | "dependencies": { 784 | "ansi-styles": { 785 | "version": "4.3.0", 786 | "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", 787 | "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", 788 | "dev": true, 789 | "requires": { 790 | "color-convert": "^2.0.1" 791 | } 792 | }, 793 | "color-convert": { 794 | "version": "2.0.1", 795 | "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", 796 | "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", 797 | "dev": true, 798 | "requires": { 799 | "color-name": "~1.1.4" 800 | } 801 | }, 802 | "color-name": { 803 | "version": "1.1.4", 804 | "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", 805 | "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", 806 | "dev": true 807 | } 808 | } 809 | }, 810 | "sprintf-js": { 811 | "version": "1.0.3", 812 | "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", 813 | "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", 814 | "dev": true 815 | }, 816 | "string-width": { 817 | "version": "4.2.0", 818 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", 819 | "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", 820 | "dev": true, 821 | "requires": { 822 | "emoji-regex": "^8.0.0", 823 | "is-fullwidth-code-point": "^3.0.0", 824 | "strip-ansi": "^6.0.0" 825 | } 826 | }, 827 | "strip-ansi": { 828 | "version": "6.0.0", 829 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", 830 | "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", 831 | "dev": true, 832 | "requires": { 833 | "ansi-regex": "^5.0.0" 834 | } 835 | }, 836 | "strip-json-comments": { 837 | "version": "3.1.1", 838 | "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", 839 | "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", 840 | "dev": true 841 | }, 842 | "supports-color": { 843 | "version": "5.5.0", 844 | "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", 845 | "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", 846 | "dev": true, 847 | "requires": { 848 | "has-flag": "^3.0.0" 849 | } 850 | }, 851 | "table": { 852 | "version": "6.0.7", 853 | "resolved": "https://registry.npmjs.org/table/-/table-6.0.7.tgz", 854 | "integrity": "sha512-rxZevLGTUzWna/qBLObOe16kB2RTnnbhciwgPbMMlazz1yZGVEgnZK762xyVdVznhqxrfCeBMmMkgOOaPwjH7g==", 855 | "dev": true, 856 | "requires": { 857 | "ajv": "^7.0.2", 858 | "lodash": "^4.17.20", 859 | "slice-ansi": "^4.0.0", 860 | "string-width": "^4.2.0" 861 | }, 862 | "dependencies": { 863 | "ajv": { 864 | "version": "7.0.3", 865 | "resolved": "https://registry.npmjs.org/ajv/-/ajv-7.0.3.tgz", 866 | "integrity": "sha512-R50QRlXSxqXcQP5SvKUrw8VZeypvo12i2IX0EeR5PiZ7bEKeHWgzgo264LDadUsCU42lTJVhFikTqJwNeH34gQ==", 867 | "dev": true, 868 | "requires": { 869 | "fast-deep-equal": "^3.1.1", 870 | "json-schema-traverse": "^1.0.0", 871 | "require-from-string": "^2.0.2", 872 | "uri-js": "^4.2.2" 873 | } 874 | }, 875 | "json-schema-traverse": { 876 | "version": "1.0.0", 877 | "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", 878 | "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", 879 | "dev": true 880 | } 881 | } 882 | }, 883 | "text-table": { 884 | "version": "0.2.0", 885 | "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", 886 | "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", 887 | "dev": true 888 | }, 889 | "tree-sitter-cli": { 890 | "version": "0.18.0", 891 | "resolved": "https://registry.npmjs.org/tree-sitter-cli/-/tree-sitter-cli-0.18.0.tgz", 892 | "integrity": "sha512-84cxdTVXpVZrfXTvr4wtjG4zLWcUoaRLhgzDinW/84FHEv12mtVfRndV3QV7omTzdzWWDvpfshPfkCOOZWEdog==", 893 | "dev": true 894 | }, 895 | "type-check": { 896 | "version": "0.4.0", 897 | "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", 898 | "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", 899 | "dev": true, 900 | "requires": { 901 | "prelude-ls": "^1.2.1" 902 | } 903 | }, 904 | "type-fest": { 905 | "version": "0.8.1", 906 | "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", 907 | "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", 908 | "dev": true 909 | }, 910 | "uri-js": { 911 | "version": "4.4.1", 912 | "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", 913 | "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", 914 | "dev": true, 915 | "requires": { 916 | "punycode": "^2.1.0" 917 | } 918 | }, 919 | "v8-compile-cache": { 920 | "version": "2.2.0", 921 | "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.2.0.tgz", 922 | "integrity": "sha512-gTpR5XQNKFwOd4clxfnhaqvfqMpqEwr4tOtCyz4MtYZX2JYhfr1JvBFKdS+7K/9rfpZR3VLX+YWBbKoxCgS43Q==", 923 | "dev": true 924 | }, 925 | "which": { 926 | "version": "2.0.2", 927 | "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", 928 | "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", 929 | "dev": true, 930 | "requires": { 931 | "isexe": "^2.0.0" 932 | } 933 | }, 934 | "word-wrap": { 935 | "version": "1.2.3", 936 | "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", 937 | "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", 938 | "dev": true 939 | }, 940 | "wrappy": { 941 | "version": "1.0.2", 942 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 943 | "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", 944 | "dev": true 945 | }, 946 | "yallist": { 947 | "version": "4.0.0", 948 | "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", 949 | "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", 950 | "dev": true 951 | } 952 | } 953 | } 954 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tree-sitter-xml", 3 | "version": "0.17.3", 4 | "description": "XML grammar for tree-sitter", 5 | "main": "index.js", 6 | "keywords": [ 7 | "parser", 8 | "lexer" 9 | ], 10 | "authors": [ 11 | "@Dorgnarg" 12 | ], 13 | "license": "MIT", 14 | "dependencies": { 15 | "nan": "^2.14.0" 16 | }, 17 | "devDependencies": { 18 | "tree-sitter-cli": "^0.17.3" 19 | }, 20 | "scripts": { 21 | "test": "tree-sitter test && tree-sitter parse examples/*.xml --quiet --time", 22 | "test-windows": "tree-sitter test" 23 | }, 24 | "tree-sitter": [ 25 | { 26 | "scope": "text.xml.basic", 27 | "file-types": [ 28 | "xml" 29 | ], 30 | "injection-regex": "xml" 31 | } 32 | ] 33 | } 34 | -------------------------------------------------------------------------------- /src/binding.cc: -------------------------------------------------------------------------------- 1 | #include "tree_sitter/parser.h" 2 | #include 3 | #include "nan.h" 4 | 5 | using namespace v8; 6 | 7 | extern "C" TSLanguage * tree_sitter_xml(); 8 | 9 | namespace { 10 | 11 | NAN_METHOD(New) {} 12 | 13 | void Init(Local exports, Local module) { 14 | Local tpl = Nan::New(New); 15 | tpl->SetClassName(Nan::New("Language").ToLocalChecked()); 16 | tpl->InstanceTemplate()->SetInternalFieldCount(1); 17 | 18 | Local constructor = Nan::GetFunction(tpl).ToLocalChecked(); 19 | Local instance = constructor->NewInstance(Nan::GetCurrentContext()).ToLocalChecked(); 20 | Nan::SetInternalFieldPointer(instance, 0, tree_sitter_xml()); 21 | 22 | Nan::Set(instance, Nan::New("name").ToLocalChecked(), Nan::New("xml").ToLocalChecked()); 23 | Nan::Set(module, Nan::New("exports").ToLocalChecked(), instance); 24 | } 25 | 26 | NODE_MODULE(tree_sitter_xml_binding, Init) 27 | 28 | } // namespace 29 | -------------------------------------------------------------------------------- /src/node-types.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "type": "attlist_decl", 4 | "named": true, 5 | "fields": {}, 6 | "children": { 7 | "multiple": true, 8 | "required": true, 9 | "types": [ 10 | { 11 | "type": "attlist_name", 12 | "named": true 13 | }, 14 | { 15 | "type": "attribute_def", 16 | "named": true 17 | } 18 | ] 19 | } 20 | }, 21 | { 22 | "type": "attlist_name", 23 | "named": true, 24 | "fields": {} 25 | }, 26 | { 27 | "type": "attribute", 28 | "named": true, 29 | "fields": {}, 30 | "children": { 31 | "multiple": true, 32 | "required": true, 33 | "types": [ 34 | { 35 | "type": "attribute_name", 36 | "named": true 37 | }, 38 | { 39 | "type": "attribute_value", 40 | "named": true 41 | } 42 | ] 43 | } 44 | }, 45 | { 46 | "type": "attribute_def", 47 | "named": true, 48 | "fields": {}, 49 | "children": { 50 | "multiple": true, 51 | "required": true, 52 | "types": [ 53 | { 54 | "type": "attribute_name", 55 | "named": true 56 | }, 57 | { 58 | "type": "attribute_type", 59 | "named": true 60 | }, 61 | { 62 | "type": "default_decl", 63 | "named": true 64 | } 65 | ] 66 | } 67 | }, 68 | { 69 | "type": "attribute_name", 70 | "named": true, 71 | "fields": {} 72 | }, 73 | { 74 | "type": "attribute_type", 75 | "named": true, 76 | "fields": {}, 77 | "children": { 78 | "multiple": false, 79 | "required": false, 80 | "types": [ 81 | { 82 | "type": "enumeration", 83 | "named": true 84 | }, 85 | { 86 | "type": "notation_type", 87 | "named": true 88 | } 89 | ] 90 | } 91 | }, 92 | { 93 | "type": "attribute_value", 94 | "named": true, 95 | "fields": {}, 96 | "children": { 97 | "multiple": true, 98 | "required": false, 99 | "types": [ 100 | { 101 | "type": "reference", 102 | "named": true 103 | } 104 | ] 105 | } 106 | }, 107 | { 108 | "type": "cdata", 109 | "named": true, 110 | "fields": {} 111 | }, 112 | { 113 | "type": "cdata_sect", 114 | "named": true, 115 | "fields": {}, 116 | "children": { 117 | "multiple": false, 118 | "required": true, 119 | "types": [ 120 | { 121 | "type": "cdata", 122 | "named": true 123 | } 124 | ] 125 | } 126 | }, 127 | { 128 | "type": "char_ref", 129 | "named": true, 130 | "fields": {} 131 | }, 132 | { 133 | "type": "children", 134 | "named": true, 135 | "fields": {}, 136 | "children": { 137 | "multiple": false, 138 | "required": true, 139 | "types": [ 140 | { 141 | "type": "element_choice", 142 | "named": true 143 | }, 144 | { 145 | "type": "element_seq", 146 | "named": true 147 | } 148 | ] 149 | } 150 | }, 151 | { 152 | "type": "comment", 153 | "named": true, 154 | "fields": {} 155 | }, 156 | { 157 | "type": "conditional_sect", 158 | "named": true, 159 | "fields": {}, 160 | "children": { 161 | "multiple": false, 162 | "required": true, 163 | "types": [ 164 | { 165 | "type": "ignore_sect", 166 | "named": true 167 | }, 168 | { 169 | "type": "include_sect", 170 | "named": true 171 | } 172 | ] 173 | } 174 | }, 175 | { 176 | "type": "content_spec", 177 | "named": true, 178 | "fields": {}, 179 | "children": { 180 | "multiple": false, 181 | "required": false, 182 | "types": [ 183 | { 184 | "type": "children", 185 | "named": true 186 | }, 187 | { 188 | "type": "mixed", 189 | "named": true 190 | } 191 | ] 192 | } 193 | }, 194 | { 195 | "type": "cp", 196 | "named": true, 197 | "fields": {}, 198 | "children": { 199 | "multiple": false, 200 | "required": false, 201 | "types": [ 202 | { 203 | "type": "element_choice", 204 | "named": true 205 | }, 206 | { 207 | "type": "element_seq", 208 | "named": true 209 | } 210 | ] 211 | } 212 | }, 213 | { 214 | "type": "default_decl", 215 | "named": true, 216 | "fields": {}, 217 | "children": { 218 | "multiple": false, 219 | "required": false, 220 | "types": [ 221 | { 222 | "type": "attribute_value", 223 | "named": true 224 | } 225 | ] 226 | } 227 | }, 228 | { 229 | "type": "doctype", 230 | "named": true, 231 | "fields": {} 232 | }, 233 | { 234 | "type": "doctype_decl", 235 | "named": true, 236 | "fields": {}, 237 | "children": { 238 | "multiple": true, 239 | "required": true, 240 | "types": [ 241 | { 242 | "type": "attlist_decl", 243 | "named": true 244 | }, 245 | { 246 | "type": "comment", 247 | "named": true 248 | }, 249 | { 250 | "type": "doctype", 251 | "named": true 252 | }, 253 | { 254 | "type": "element_decl", 255 | "named": true 256 | }, 257 | { 258 | "type": "entity_decl", 259 | "named": true 260 | }, 261 | { 262 | "type": "external_id", 263 | "named": true 264 | }, 265 | { 266 | "type": "notation_decl", 267 | "named": true 268 | }, 269 | { 270 | "type": "pe_reference", 271 | "named": true 272 | }, 273 | { 274 | "type": "processing_instructions", 275 | "named": true 276 | } 277 | ] 278 | } 279 | }, 280 | { 281 | "type": "document", 282 | "named": true, 283 | "fields": {}, 284 | "children": { 285 | "multiple": true, 286 | "required": false, 287 | "types": [ 288 | { 289 | "type": "comment", 290 | "named": true 291 | }, 292 | { 293 | "type": "element", 294 | "named": true 295 | }, 296 | { 297 | "type": "processing_instructions", 298 | "named": true 299 | }, 300 | { 301 | "type": "prolog", 302 | "named": true 303 | } 304 | ] 305 | } 306 | }, 307 | { 308 | "type": "element", 309 | "named": true, 310 | "fields": {}, 311 | "children": { 312 | "multiple": true, 313 | "required": true, 314 | "types": [ 315 | { 316 | "type": "cdata_sect", 317 | "named": true 318 | }, 319 | { 320 | "type": "comment", 321 | "named": true 322 | }, 323 | { 324 | "type": "element", 325 | "named": true 326 | }, 327 | { 328 | "type": "empty_elem_tag", 329 | "named": true 330 | }, 331 | { 332 | "type": "end_tag", 333 | "named": true 334 | }, 335 | { 336 | "type": "processing_instructions", 337 | "named": true 338 | }, 339 | { 340 | "type": "reference", 341 | "named": true 342 | }, 343 | { 344 | "type": "start_tag", 345 | "named": true 346 | }, 347 | { 348 | "type": "text", 349 | "named": true 350 | } 351 | ] 352 | } 353 | }, 354 | { 355 | "type": "element_choice", 356 | "named": true, 357 | "fields": {}, 358 | "children": { 359 | "multiple": true, 360 | "required": true, 361 | "types": [ 362 | { 363 | "type": "cp", 364 | "named": true 365 | } 366 | ] 367 | } 368 | }, 369 | { 370 | "type": "element_decl", 371 | "named": true, 372 | "fields": {}, 373 | "children": { 374 | "multiple": true, 375 | "required": true, 376 | "types": [ 377 | { 378 | "type": "content_spec", 379 | "named": true 380 | }, 381 | { 382 | "type": "element_name", 383 | "named": true 384 | } 385 | ] 386 | } 387 | }, 388 | { 389 | "type": "element_name", 390 | "named": true, 391 | "fields": {} 392 | }, 393 | { 394 | "type": "element_seq", 395 | "named": true, 396 | "fields": {}, 397 | "children": { 398 | "multiple": true, 399 | "required": true, 400 | "types": [ 401 | { 402 | "type": "cp", 403 | "named": true 404 | } 405 | ] 406 | } 407 | }, 408 | { 409 | "type": "empty_elem_tag", 410 | "named": true, 411 | "fields": {}, 412 | "children": { 413 | "multiple": true, 414 | "required": true, 415 | "types": [ 416 | { 417 | "type": "attribute", 418 | "named": true 419 | }, 420 | { 421 | "type": "tag_name", 422 | "named": true 423 | } 424 | ] 425 | } 426 | }, 427 | { 428 | "type": "encoding_decl", 429 | "named": true, 430 | "fields": {} 431 | }, 432 | { 433 | "type": "end_tag", 434 | "named": true, 435 | "fields": {}, 436 | "children": { 437 | "multiple": false, 438 | "required": true, 439 | "types": [ 440 | { 441 | "type": "tag_name", 442 | "named": true 443 | } 444 | ] 445 | } 446 | }, 447 | { 448 | "type": "entity_decl", 449 | "named": true, 450 | "fields": {}, 451 | "children": { 452 | "multiple": false, 453 | "required": true, 454 | "types": [ 455 | { 456 | "type": "ge_decl", 457 | "named": true 458 | }, 459 | { 460 | "type": "pe_decl", 461 | "named": true 462 | } 463 | ] 464 | } 465 | }, 466 | { 467 | "type": "entity_def", 468 | "named": true, 469 | "fields": {}, 470 | "children": { 471 | "multiple": true, 472 | "required": true, 473 | "types": [ 474 | { 475 | "type": "entity_value", 476 | "named": true 477 | }, 478 | { 479 | "type": "external_id", 480 | "named": true 481 | }, 482 | { 483 | "type": "ndata_decl", 484 | "named": true 485 | } 486 | ] 487 | } 488 | }, 489 | { 490 | "type": "entity_ref", 491 | "named": true, 492 | "fields": {} 493 | }, 494 | { 495 | "type": "entity_value", 496 | "named": true, 497 | "fields": {}, 498 | "children": { 499 | "multiple": true, 500 | "required": false, 501 | "types": [ 502 | { 503 | "type": "pe_reference", 504 | "named": true 505 | }, 506 | { 507 | "type": "reference", 508 | "named": true 509 | } 510 | ] 511 | } 512 | }, 513 | { 514 | "type": "enumeration", 515 | "named": true, 516 | "fields": {}, 517 | "children": { 518 | "multiple": true, 519 | "required": true, 520 | "types": [ 521 | { 522 | "type": "nm_token", 523 | "named": true 524 | } 525 | ] 526 | } 527 | }, 528 | { 529 | "type": "external_id", 530 | "named": true, 531 | "fields": {}, 532 | "children": { 533 | "multiple": true, 534 | "required": true, 535 | "types": [ 536 | { 537 | "type": "pubid_literal", 538 | "named": true 539 | }, 540 | { 541 | "type": "system_literal", 542 | "named": true 543 | } 544 | ] 545 | } 546 | }, 547 | { 548 | "type": "external_subset_decl", 549 | "named": true, 550 | "fields": {}, 551 | "children": { 552 | "multiple": false, 553 | "required": true, 554 | "types": [ 555 | { 556 | "type": "attlist_decl", 557 | "named": true 558 | }, 559 | { 560 | "type": "comment", 561 | "named": true 562 | }, 563 | { 564 | "type": "conditional_sect", 565 | "named": true 566 | }, 567 | { 568 | "type": "element_decl", 569 | "named": true 570 | }, 571 | { 572 | "type": "entity_decl", 573 | "named": true 574 | }, 575 | { 576 | "type": "notation_decl", 577 | "named": true 578 | }, 579 | { 580 | "type": "pe_reference", 581 | "named": true 582 | }, 583 | { 584 | "type": "processing_instructions", 585 | "named": true 586 | } 587 | ] 588 | } 589 | }, 590 | { 591 | "type": "ge_decl", 592 | "named": true, 593 | "fields": {}, 594 | "children": { 595 | "multiple": false, 596 | "required": true, 597 | "types": [ 598 | { 599 | "type": "entity_def", 600 | "named": true 601 | } 602 | ] 603 | } 604 | }, 605 | { 606 | "type": "ignore", 607 | "named": true, 608 | "fields": {} 609 | }, 610 | { 611 | "type": "ignore_sect", 612 | "named": true, 613 | "fields": {}, 614 | "children": { 615 | "multiple": true, 616 | "required": false, 617 | "types": [ 618 | { 619 | "type": "ignore_sect_contents", 620 | "named": true 621 | } 622 | ] 623 | } 624 | }, 625 | { 626 | "type": "ignore_sect_contents", 627 | "named": true, 628 | "fields": {}, 629 | "children": { 630 | "multiple": true, 631 | "required": true, 632 | "types": [ 633 | { 634 | "type": "ignore", 635 | "named": true 636 | }, 637 | { 638 | "type": "ignore_sect_contents", 639 | "named": true 640 | } 641 | ] 642 | } 643 | }, 644 | { 645 | "type": "include_sect", 646 | "named": true, 647 | "fields": {}, 648 | "children": { 649 | "multiple": true, 650 | "required": false, 651 | "types": [ 652 | { 653 | "type": "external_subset_decl", 654 | "named": true 655 | } 656 | ] 657 | } 658 | }, 659 | { 660 | "type": "langcode", 661 | "named": true, 662 | "fields": {} 663 | }, 664 | { 665 | "type": "mixed", 666 | "named": true, 667 | "fields": {} 668 | }, 669 | { 670 | "type": "ndata_decl", 671 | "named": true, 672 | "fields": {}, 673 | "children": { 674 | "multiple": false, 675 | "required": true, 676 | "types": [ 677 | { 678 | "type": "ndata_name", 679 | "named": true 680 | } 681 | ] 682 | } 683 | }, 684 | { 685 | "type": "ndata_name", 686 | "named": true, 687 | "fields": {} 688 | }, 689 | { 690 | "type": "nm_token", 691 | "named": true, 692 | "fields": {} 693 | }, 694 | { 695 | "type": "notation_decl", 696 | "named": true, 697 | "fields": {}, 698 | "children": { 699 | "multiple": true, 700 | "required": true, 701 | "types": [ 702 | { 703 | "type": "external_id", 704 | "named": true 705 | }, 706 | { 707 | "type": "notation_name", 708 | "named": true 709 | }, 710 | { 711 | "type": "public_id", 712 | "named": true 713 | } 714 | ] 715 | } 716 | }, 717 | { 718 | "type": "notation_name", 719 | "named": true, 720 | "fields": {} 721 | }, 722 | { 723 | "type": "notation_type", 724 | "named": true, 725 | "fields": {}, 726 | "children": { 727 | "multiple": true, 728 | "required": true, 729 | "types": [ 730 | { 731 | "type": "notation_type_name", 732 | "named": true 733 | } 734 | ] 735 | } 736 | }, 737 | { 738 | "type": "notation_type_name", 739 | "named": true, 740 | "fields": {} 741 | }, 742 | { 743 | "type": "pe_decl", 744 | "named": true, 745 | "fields": {}, 746 | "children": { 747 | "multiple": false, 748 | "required": true, 749 | "types": [ 750 | { 751 | "type": "pe_def", 752 | "named": true 753 | } 754 | ] 755 | } 756 | }, 757 | { 758 | "type": "pe_def", 759 | "named": true, 760 | "fields": {}, 761 | "children": { 762 | "multiple": false, 763 | "required": true, 764 | "types": [ 765 | { 766 | "type": "entity_value", 767 | "named": true 768 | }, 769 | { 770 | "type": "external_id", 771 | "named": true 772 | } 773 | ] 774 | } 775 | }, 776 | { 777 | "type": "pe_reference", 778 | "named": true, 779 | "fields": {} 780 | }, 781 | { 782 | "type": "pi_target", 783 | "named": true, 784 | "fields": {} 785 | }, 786 | { 787 | "type": "processing_instructions", 788 | "named": true, 789 | "fields": {}, 790 | "children": { 791 | "multiple": false, 792 | "required": true, 793 | "types": [ 794 | { 795 | "type": "pi_target", 796 | "named": true 797 | } 798 | ] 799 | } 800 | }, 801 | { 802 | "type": "prolog", 803 | "named": true, 804 | "fields": {}, 805 | "children": { 806 | "multiple": true, 807 | "required": true, 808 | "types": [ 809 | { 810 | "type": "comment", 811 | "named": true 812 | }, 813 | { 814 | "type": "doctype_decl", 815 | "named": true 816 | }, 817 | { 818 | "type": "processing_instructions", 819 | "named": true 820 | }, 821 | { 822 | "type": "xml_decl", 823 | "named": true 824 | } 825 | ] 826 | } 827 | }, 828 | { 829 | "type": "pubid_literal", 830 | "named": true, 831 | "fields": {}, 832 | "children": { 833 | "multiple": true, 834 | "required": false, 835 | "types": [ 836 | { 837 | "type": "pubid_char", 838 | "named": true 839 | } 840 | ] 841 | } 842 | }, 843 | { 844 | "type": "public_id", 845 | "named": true, 846 | "fields": {}, 847 | "children": { 848 | "multiple": false, 849 | "required": true, 850 | "types": [ 851 | { 852 | "type": "pubid_literal", 853 | "named": true 854 | } 855 | ] 856 | } 857 | }, 858 | { 859 | "type": "reference", 860 | "named": true, 861 | "fields": {}, 862 | "children": { 863 | "multiple": false, 864 | "required": true, 865 | "types": [ 866 | { 867 | "type": "char_ref", 868 | "named": true 869 | }, 870 | { 871 | "type": "entity_ref", 872 | "named": true 873 | } 874 | ] 875 | } 876 | }, 877 | { 878 | "type": "standalone_decl", 879 | "named": true, 880 | "fields": {} 881 | }, 882 | { 883 | "type": "start_tag", 884 | "named": true, 885 | "fields": {}, 886 | "children": { 887 | "multiple": true, 888 | "required": true, 889 | "types": [ 890 | { 891 | "type": "attribute", 892 | "named": true 893 | }, 894 | { 895 | "type": "tag_name", 896 | "named": true 897 | } 898 | ] 899 | } 900 | }, 901 | { 902 | "type": "sub_code", 903 | "named": true, 904 | "fields": {} 905 | }, 906 | { 907 | "type": "system_literal", 908 | "named": true, 909 | "fields": {} 910 | }, 911 | { 912 | "type": "tag_name", 913 | "named": true, 914 | "fields": {} 915 | }, 916 | { 917 | "type": "text_decl", 918 | "named": true, 919 | "fields": {}, 920 | "children": { 921 | "multiple": true, 922 | "required": true, 923 | "types": [ 924 | { 925 | "type": "encoding_decl", 926 | "named": true 927 | }, 928 | { 929 | "type": "version_info", 930 | "named": true 931 | } 932 | ] 933 | } 934 | }, 935 | { 936 | "type": "version_info", 937 | "named": true, 938 | "fields": {} 939 | }, 940 | { 941 | "type": "xml_decl", 942 | "named": true, 943 | "fields": {}, 944 | "children": { 945 | "multiple": true, 946 | "required": true, 947 | "types": [ 948 | { 949 | "type": "encoding_decl", 950 | "named": true 951 | }, 952 | { 953 | "type": "standalone_decl", 954 | "named": true 955 | }, 956 | { 957 | "type": "version_info", 958 | "named": true 959 | } 960 | ] 961 | } 962 | }, 963 | { 964 | "type": "\"", 965 | "named": false 966 | }, 967 | { 968 | "type": "#FIXED", 969 | "named": false 970 | }, 971 | { 972 | "type": "#IMPLIED", 973 | "named": false 974 | }, 975 | { 976 | "type": "#PCDATA", 977 | "named": false 978 | }, 979 | { 980 | "type": "#REQUIRED", 981 | "named": false 982 | }, 983 | { 984 | "type": "%", 985 | "named": false 986 | }, 987 | { 988 | "type": "&", 989 | "named": false 990 | }, 991 | { 992 | "type": "&#", 993 | "named": false 994 | }, 995 | { 996 | "type": "&#x", 997 | "named": false 998 | }, 999 | { 1000 | "type": "'", 1001 | "named": false 1002 | }, 1003 | { 1004 | "type": "(", 1005 | "named": false 1006 | }, 1007 | { 1008 | "type": ")", 1009 | "named": false 1010 | }, 1011 | { 1012 | "type": ")*", 1013 | "named": false 1014 | }, 1015 | { 1016 | "type": "*", 1017 | "named": false 1018 | }, 1019 | { 1020 | "type": "+", 1021 | "named": false 1022 | }, 1023 | { 1024 | "type": ",", 1025 | "named": false 1026 | }, 1027 | { 1028 | "type": "-", 1029 | "named": false 1030 | }, 1031 | { 1032 | "type": "-->", 1033 | "named": false 1034 | }, 1035 | { 1036 | "type": ".", 1037 | "named": false 1038 | }, 1039 | { 1040 | "type": "/>", 1041 | "named": false 1042 | }, 1043 | { 1044 | "type": "1.", 1045 | "named": false 1046 | }, 1047 | { 1048 | "type": ":", 1049 | "named": false 1050 | }, 1051 | { 1052 | "type": ";", 1053 | "named": false 1054 | }, 1055 | { 1056 | "type": "<", 1057 | "named": false 1058 | }, 1059 | { 1060 | "type": "