├── .gitignore ├── .idea ├── .gitignore ├── modules.xml ├── tree-sitter-xml.iml └── vcs.xml ├── Cargo.toml ├── LICENSE ├── README.md ├── binding.gyp ├── bindings ├── node │ ├── binding.cc │ └── index.js └── rust │ ├── build.rs │ └── lib.rs ├── examples ├── colors.xml ├── q.scm ├── test.xml └── test2.xml ├── grammar.js ├── package.json ├── queries ├── blocks.scm ├── brackets.scm └── highlights.scm ├── src ├── grammar.json ├── node-types.json ├── parser.c └── tree_sitter │ └── parser.h ├── test.xml └── test └── corpus ├── basic.txt └── num-in-xml-tag.txt /.gitignore: -------------------------------------------------------------------------------- 1 | Cargo.lock 2 | node_modules 3 | build 4 | *.log 5 | package-lock.json 6 | script/javaparser-test/target 7 | test.java 8 | /examples/elasticsearch 9 | /examples/guava 10 | /examples/RxJava 11 | /target/ 12 | *.a 13 | *.dylib 14 | *.so 15 | *.o 16 | bindings/c/*.h 17 | bindings/c/tree-sitter-*.pc 18 | .build/ 19 | -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Editor-based HTTP Client requests 5 | /httpRequests/ 6 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/tree-sitter-xml.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "tree-sitter-xml" 3 | description = "xml grammar for the tree-sitter parsing library" 4 | version = "0.0.1" 5 | keywords = ["incremental", "parsing", "xml"] 6 | categories = ["parsing", "text-editors"] 7 | repository = "https://github.com/tree-sitter/tree-sitter-xml" 8 | edition = "2018" 9 | license = "MIT" 10 | 11 | build = "bindings/rust/build.rs" 12 | include = [ 13 | "bindings/rust/*", 14 | "grammar.js", 15 | "queries/*", 16 | "src/*", 17 | ] 18 | 19 | [lib] 20 | path = "bindings/rust/lib.rs" 21 | 22 | [dependencies] 23 | tree-sitter = "~0.20.3" 24 | 25 | [build-dependencies] 26 | cc = "1.0" 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | Version 2.1, February 1999 3 | 4 | Copyright (C) 1991, 1999 Free Software Foundation, Inc. 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | [This is the first released version of the Lesser GPL. It also counts 10 | as the successor of the GNU Library Public License, version 2, hence 11 | the version number 2.1.] 12 | 13 | Preamble 14 | 15 | The licenses for most software are designed to take away your 16 | freedom to share and change it. By contrast, the GNU General Public 17 | Licenses are intended to guarantee your freedom to share and change 18 | free software--to make sure the software is free for all its users. 19 | 20 | This license, the Lesser General Public License, applies to some 21 | specially designated software packages--typically libraries--of the 22 | Free Software Foundation and other authors who decide to use it. You 23 | can use it too, but we suggest you first think carefully about whether 24 | this license or the ordinary General Public License is the better 25 | strategy to use in any particular case, based on the explanations below. 26 | 27 | When we speak of free software, we are referring to freedom of use, 28 | not price. Our General Public Licenses are designed to make sure that 29 | you have the freedom to distribute copies of free software (and charge 30 | for this service if you wish); that you receive source code or can get 31 | it if you want it; that you can change the software and use pieces of 32 | it in new free programs; and that you are informed that you can do 33 | these things. 34 | 35 | To protect your rights, we need to make restrictions that forbid 36 | distributors to deny you these rights or to ask you to surrender these 37 | rights. These restrictions translate to certain responsibilities for 38 | you if you distribute copies of the library or if you modify it. 39 | 40 | For example, if you distribute copies of the library, whether gratis 41 | or for a fee, you must give the recipients all the rights that we gave 42 | you. You must make sure that they, too, receive or can get the source 43 | code. If you link other code with the library, you must provide 44 | complete object files to the recipients, so that they can relink them 45 | with the library after making changes to the library and recompiling 46 | it. And you must show them these terms so they know their rights. 47 | 48 | We protect your rights with a two-step method: (1) we copyright the 49 | library, and (2) we offer you this license, which gives you legal 50 | permission to copy, distribute and/or modify the library. 51 | 52 | To protect each distributor, we want to make it very clear that 53 | there is no warranty for the free library. Also, if the library is 54 | modified by someone else and passed on, the recipients should know 55 | that what they have is not the original version, so that the original 56 | author's reputation will not be affected by problems that might be 57 | introduced by others. 58 | 59 | Finally, software patents pose a constant threat to the existence of 60 | any free program. We wish to make sure that a company cannot 61 | effectively restrict the users of a free program by obtaining a 62 | restrictive license from a patent holder. Therefore, we insist that 63 | any patent license obtained for a version of the library must be 64 | consistent with the full freedom of use specified in this license. 65 | 66 | Most GNU software, including some libraries, is covered by the 67 | ordinary GNU General Public License. This license, the GNU Lesser 68 | General Public License, applies to certain designated libraries, and 69 | is quite different from the ordinary General Public License. We use 70 | this license for certain libraries in order to permit linking those 71 | libraries into non-free programs. 72 | 73 | When a program is linked with a library, whether statically or using 74 | a shared library, the combination of the two is legally speaking a 75 | combined work, a derivative of the original library. The ordinary 76 | General Public License therefore permits such linking only if the 77 | entire combination fits its criteria of freedom. The Lesser General 78 | Public License permits more lax criteria for linking other code with 79 | the library. 80 | 81 | We call this license the "Lesser" General Public License because it 82 | does Less to protect the user's freedom than the ordinary General 83 | Public License. It also provides other free software developers Less 84 | of an advantage over competing non-free programs. These disadvantages 85 | are the reason we use the ordinary General Public License for many 86 | libraries. However, the Lesser license provides advantages in certain 87 | special circumstances. 88 | 89 | For example, on rare occasions, there may be a special need to 90 | encourage the widest possible use of a certain library, so that it becomes 91 | a de-facto standard. To achieve this, non-free programs must be 92 | allowed to use the library. A more frequent case is that a free 93 | library does the same job as widely used non-free libraries. In this 94 | case, there is little to gain by limiting the free library to free 95 | software only, so we use the Lesser General Public License. 96 | 97 | In other cases, permission to use a particular library in non-free 98 | programs enables a greater number of people to use a large body of 99 | free software. For example, permission to use the GNU C Library in 100 | non-free programs enables many more people to use the whole GNU 101 | operating system, as well as its variant, the GNU/Linux operating 102 | system. 103 | 104 | Although the Lesser General Public License is Less protective of the 105 | users' freedom, it does ensure that the user of a program that is 106 | linked with the Library has the freedom and the wherewithal to run 107 | that program using a modified version of the Library. 108 | 109 | The precise terms and conditions for copying, distribution and 110 | modification follow. Pay close attention to the difference between a 111 | "work based on the library" and a "work that uses the library". The 112 | former contains code derived from the library, whereas the latter must 113 | be combined with the library in order to run. 114 | 115 | GNU LESSER GENERAL PUBLIC LICENSE 116 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 117 | 118 | 0. This License Agreement applies to any software library or other 119 | program which contains a notice placed by the copyright holder or 120 | other authorized party saying it may be distributed under the terms of 121 | this Lesser General Public License (also called "this License"). 122 | Each licensee is addressed as "you". 123 | 124 | A "library" means a collection of software functions and/or data 125 | prepared so as to be conveniently linked with application programs 126 | (which use some of those functions and data) to form executables. 127 | 128 | The "Library", below, refers to any such software library or work 129 | which has been distributed under these terms. A "work based on the 130 | Library" means either the Library or any derivative work under 131 | copyright law: that is to say, a work containing the Library or a 132 | portion of it, either verbatim or with modifications and/or translated 133 | straightforwardly into another language. (Hereinafter, translation is 134 | included without limitation in the term "modification".) 135 | 136 | "Source code" for a work means the preferred form of the work for 137 | making modifications to it. For a library, complete source code means 138 | all the source code for all modules it contains, plus any associated 139 | interface definition files, plus the scripts used to control compilation 140 | and installation of the library. 141 | 142 | Activities other than copying, distribution and modification are not 143 | covered by this License; they are outside its scope. The act of 144 | running a program using the Library is not restricted, and output from 145 | such a program is covered only if its contents constitute a work based 146 | on the Library (independent of the use of the Library in a tool for 147 | writing it). Whether that is true depends on what the Library does 148 | and what the program that uses the Library does. 149 | 150 | 1. You may copy and distribute verbatim copies of the Library's 151 | complete source code as you receive it, in any medium, provided that 152 | you conspicuously and appropriately publish on each copy an 153 | appropriate copyright notice and disclaimer of warranty; keep intact 154 | all the notices that refer to this License and to the absence of any 155 | warranty; and distribute a copy of this License along with the 156 | Library. 157 | 158 | You may charge a fee for the physical act of transferring a copy, 159 | and you may at your option offer warranty protection in exchange for a 160 | fee. 161 | 162 | 2. You may modify your copy or copies of the Library or any portion 163 | of it, thus forming a work based on the Library, and copy and 164 | distribute such modifications or work under the terms of Section 1 165 | above, provided that you also meet all of these conditions: 166 | 167 | a) The modified work must itself be a software library. 168 | 169 | b) You must cause the files modified to carry prominent notices 170 | stating that you changed the files and the date of any change. 171 | 172 | c) You must cause the whole of the work to be licensed at no 173 | charge to all third parties under the terms of this License. 174 | 175 | d) If a facility in the modified Library refers to a function or a 176 | table of data to be supplied by an application program that uses 177 | the facility, other than as an argument passed when the facility 178 | is invoked, then you must make a good faith effort to ensure that, 179 | in the event an application does not supply such function or 180 | table, the facility still operates, and performs whatever part of 181 | its purpose remains meaningful. 182 | 183 | (For example, a function in a library to compute square roots has 184 | a purpose that is entirely well-defined independent of the 185 | application. Therefore, Subsection 2d requires that any 186 | application-supplied function or table used by this function must 187 | be optional: if the application does not supply it, the square 188 | root function must still compute square roots.) 189 | 190 | These requirements apply to the modified work as a whole. If 191 | identifiable sections of that work are not derived from the Library, 192 | and can be reasonably considered independent and separate works in 193 | themselves, then this License, and its terms, do not apply to those 194 | sections when you distribute them as separate works. But when you 195 | distribute the same sections as part of a whole which is a work based 196 | on the Library, the distribution of the whole must be on the terms of 197 | this License, whose permissions for other licensees extend to the 198 | entire whole, and thus to each and every part regardless of who wrote 199 | it. 200 | 201 | Thus, it is not the intent of this section to claim rights or contest 202 | your rights to work written entirely by you; rather, the intent is to 203 | exercise the right to control the distribution of derivative or 204 | collective works based on the Library. 205 | 206 | In addition, mere aggregation of another work not based on the Library 207 | with the Library (or with a work based on the Library) on a volume of 208 | a storage or distribution medium does not bring the other work under 209 | the scope of this License. 210 | 211 | 3. You may opt to apply the terms of the ordinary GNU General Public 212 | License instead of this License to a given copy of the Library. To do 213 | this, you must alter all the notices that refer to this License, so 214 | that they refer to the ordinary GNU General Public License, version 2, 215 | instead of to this License. (If a newer version than version 2 of the 216 | ordinary GNU General Public License has appeared, then you can specify 217 | that version instead if you wish.) Do not make any other change in 218 | these notices. 219 | 220 | Once this change is made in a given copy, it is irreversible for 221 | that copy, so the ordinary GNU General Public License applies to all 222 | subsequent copies and derivative works made from that copy. 223 | 224 | This option is useful when you wish to copy part of the code of 225 | the Library into a program that is not a library. 226 | 227 | 4. You may copy and distribute the Library (or a portion or 228 | derivative of it, under Section 2) in object code or executable form 229 | under the terms of Sections 1 and 2 above provided that you accompany 230 | it with the complete corresponding machine-readable source code, which 231 | must be distributed under the terms of Sections 1 and 2 above on a 232 | medium customarily used for software interchange. 233 | 234 | If distribution of object code is made by offering access to copy 235 | from a designated place, then offering equivalent access to copy the 236 | source code from the same place satisfies the requirement to 237 | distribute the source code, even though third parties are not 238 | compelled to copy the source along with the object code. 239 | 240 | 5. A program that contains no derivative of any portion of the 241 | Library, but is designed to work with the Library by being compiled or 242 | linked with it, is called a "work that uses the Library". Such a 243 | work, in isolation, is not a derivative work of the Library, and 244 | therefore falls outside the scope of this License. 245 | 246 | However, linking a "work that uses the Library" with the Library 247 | creates an executable that is a derivative of the Library (because it 248 | contains portions of the Library), rather than a "work that uses the 249 | library". The executable is therefore covered by this License. 250 | Section 6 states terms for distribution of such executables. 251 | 252 | When a "work that uses the Library" uses material from a header file 253 | that is part of the Library, the object code for the work may be a 254 | derivative work of the Library even though the source code is not. 255 | Whether this is true is especially significant if the work can be 256 | linked without the Library, or if the work is itself a library. The 257 | threshold for this to be true is not precisely defined by law. 258 | 259 | If such an object file uses only numerical parameters, data 260 | structure layouts and accessors, and small macros and small inline 261 | functions (ten lines or less in length), then the use of the object 262 | file is unrestricted, regardless of whether it is legally a derivative 263 | work. (Executables containing this object code plus portions of the 264 | Library will still fall under Section 6.) 265 | 266 | Otherwise, if the work is a derivative of the Library, you may 267 | distribute the object code for the work under the terms of Section 6. 268 | Any executables containing that work also fall under Section 6, 269 | whether or not they are linked directly with the Library itself. 270 | 271 | 6. As an exception to the Sections above, you may also combine or 272 | link a "work that uses the Library" with the Library to produce a 273 | work containing portions of the Library, and distribute that work 274 | under terms of your choice, provided that the terms permit 275 | modification of the work for the customer's own use and reverse 276 | engineering for debugging such modifications. 277 | 278 | You must give prominent notice with each copy of the work that the 279 | Library is used in it and that the Library and its use are covered by 280 | this License. You must supply a copy of this License. If the work 281 | during execution displays copyright notices, you must include the 282 | copyright notice for the Library among them, as well as a reference 283 | directing the user to the copy of this License. Also, you must do one 284 | of these things: 285 | 286 | a) Accompany the work with the complete corresponding 287 | machine-readable source code for the Library including whatever 288 | changes were used in the work (which must be distributed under 289 | Sections 1 and 2 above); and, if the work is an executable linked 290 | with the Library, with the complete machine-readable "work that 291 | uses the Library", as object code and/or source code, so that the 292 | user can modify the Library and then relink to produce a modified 293 | executable containing the modified Library. (It is understood 294 | that the user who changes the contents of definitions files in the 295 | Library will not necessarily be able to recompile the application 296 | to use the modified definitions.) 297 | 298 | b) Use a suitable shared library mechanism for linking with the 299 | Library. A suitable mechanism is one that (1) uses at run time a 300 | copy of the library already present on the user's computer system, 301 | rather than copying library functions into the executable, and (2) 302 | will operate properly with a modified version of the library, if 303 | the user installs one, as long as the modified version is 304 | interface-compatible with the version that the work was made with. 305 | 306 | c) Accompany the work with a written offer, valid for at 307 | least three years, to give the same user the materials 308 | specified in Subsection 6a, above, for a charge no more 309 | than the cost of performing this distribution. 310 | 311 | d) If distribution of the work is made by offering access to copy 312 | from a designated place, offer equivalent access to copy the above 313 | specified materials from the same place. 314 | 315 | e) Verify that the user has already received a copy of these 316 | materials or that you have already sent this user a copy. 317 | 318 | For an executable, the required form of the "work that uses the 319 | Library" must include any data and utility programs needed for 320 | reproducing the executable from it. However, as a special exception, 321 | the materials to be distributed need not include anything that is 322 | normally distributed (in either source or binary form) with the major 323 | components (compiler, kernel, and so on) of the operating system on 324 | which the executable runs, unless that component itself accompanies 325 | the executable. 326 | 327 | It may happen that this requirement contradicts the license 328 | restrictions of other proprietary libraries that do not normally 329 | accompany the operating system. Such a contradiction means you cannot 330 | use both them and the Library together in an executable that you 331 | distribute. 332 | 333 | 7. You may place library facilities that are a work based on the 334 | Library side-by-side in a single library together with other library 335 | facilities not covered by this License, and distribute such a combined 336 | library, provided that the separate distribution of the work based on 337 | the Library and of the other library facilities is otherwise 338 | permitted, and provided that you do these two things: 339 | 340 | a) Accompany the combined library with a copy of the same work 341 | based on the Library, uncombined with any other library 342 | facilities. This must be distributed under the terms of the 343 | Sections above. 344 | 345 | b) Give prominent notice with the combined library of the fact 346 | that part of it is a work based on the Library, and explaining 347 | where to find the accompanying uncombined form of the same work. 348 | 349 | 8. You may not copy, modify, sublicense, link with, or distribute 350 | the Library except as expressly provided under this License. Any 351 | attempt otherwise to copy, modify, sublicense, link with, or 352 | distribute the Library is void, and will automatically terminate your 353 | rights under this License. However, parties who have received copies, 354 | or rights, from you under this License will not have their licenses 355 | terminated so long as such parties remain in full compliance. 356 | 357 | 9. You are not required to accept this License, since you have not 358 | signed it. However, nothing else grants you permission to modify or 359 | distribute the Library or its derivative works. These actions are 360 | prohibited by law if you do not accept this License. Therefore, by 361 | modifying or distributing the Library (or any work based on the 362 | Library), you indicate your acceptance of this License to do so, and 363 | all its terms and conditions for copying, distributing or modifying 364 | the Library or works based on it. 365 | 366 | 10. Each time you redistribute the Library (or any work based on the 367 | Library), the recipient automatically receives a license from the 368 | original licensor to copy, distribute, link with or modify the Library 369 | subject to these terms and conditions. You may not impose any further 370 | restrictions on the recipients' exercise of the rights granted herein. 371 | You are not responsible for enforcing compliance by third parties with 372 | this License. 373 | 374 | 11. If, as a consequence of a court judgment or allegation of patent 375 | infringement or for any other reason (not limited to patent issues), 376 | conditions are imposed on you (whether by court order, agreement or 377 | otherwise) that contradict the conditions of this License, they do not 378 | excuse you from the conditions of this License. If you cannot 379 | distribute so as to satisfy simultaneously your obligations under this 380 | License and any other pertinent obligations, then as a consequence you 381 | may not distribute the Library at all. For example, if a patent 382 | license would not permit royalty-free redistribution of the Library by 383 | all those who receive copies directly or indirectly through you, then 384 | the only way you could satisfy both it and this License would be to 385 | refrain entirely from distribution of the Library. 386 | 387 | If any portion of this section is held invalid or unenforceable under any 388 | particular circumstance, the balance of the section is intended to apply, 389 | and the section as a whole is intended to apply in other circumstances. 390 | 391 | It is not the purpose of this section to induce you to infringe any 392 | patents or other property right claims or to contest validity of any 393 | such claims; this section has the sole purpose of protecting the 394 | integrity of the free software distribution system which is 395 | implemented by public license practices. Many people have made 396 | generous contributions to the wide range of software distributed 397 | through that system in reliance on consistent application of that 398 | system; it is up to the author/donor to decide if he or she is willing 399 | to distribute software through any other system and a licensee cannot 400 | impose that choice. 401 | 402 | This section is intended to make thoroughly clear what is believed to 403 | be a consequence of the rest of this License. 404 | 405 | 12. If the distribution and/or use of the Library is restricted in 406 | certain countries either by patents or by copyrighted interfaces, the 407 | original copyright holder who places the Library under this License may add 408 | an explicit geographical distribution limitation excluding those countries, 409 | so that distribution is permitted only in or among countries not thus 410 | excluded. In such case, this License incorporates the limitation as if 411 | written in the body of this License. 412 | 413 | 13. The Free Software Foundation may publish revised and/or new 414 | versions of the Lesser General Public License from time to time. 415 | Such new versions will be similar in spirit to the present version, 416 | but may differ in detail to address new problems or concerns. 417 | 418 | Each version is given a distinguishing version number. If the Library 419 | specifies a version number of this License which applies to it and 420 | "any later version", you have the option of following the terms and 421 | conditions either of that version or of any later version published by 422 | the Free Software Foundation. If the Library does not specify a 423 | license version number, you may choose any version ever published by 424 | the Free Software Foundation. 425 | 426 | 14. If you wish to incorporate parts of the Library into other free 427 | programs whose distribution conditions are incompatible with these, 428 | write to the author to ask for permission. For software which is 429 | copyrighted by the Free Software Foundation, write to the Free 430 | Software Foundation; we sometimes make exceptions for this. Our 431 | decision will be guided by the two goals of preserving the free status 432 | of all derivatives of our free software and of promoting the sharing 433 | and reuse of software generally. 434 | 435 | NO WARRANTY 436 | 437 | 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO 438 | WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. 439 | EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR 440 | OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY 441 | KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE 442 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 443 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE 444 | LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME 445 | THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 446 | 447 | 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN 448 | WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY 449 | AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU 450 | FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR 451 | CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE 452 | LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING 453 | RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A 454 | FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF 455 | SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 456 | DAMAGES. 457 | 458 | END OF TERMS AND CONDITIONS 459 | 460 | How to Apply These Terms to Your New Libraries 461 | 462 | If you develop a new library, and you want it to be of the greatest 463 | possible use to the public, we recommend making it free software that 464 | everyone can redistribute and change. You can do so by permitting 465 | redistribution under these terms (or, alternatively, under the terms of the 466 | ordinary General Public License). 467 | 468 | To apply these terms, attach the following notices to the library. It is 469 | safest to attach them to the start of each source file to most effectively 470 | convey the exclusion of warranty; and each file should have at least the 471 | "copyright" line and a pointer to where the full notice is found. 472 | 473 | 474 | Copyright (C) 475 | 476 | This library is free software; you can redistribute it and/or 477 | modify it under the terms of the GNU Lesser General Public 478 | License as published by the Free Software Foundation; either 479 | version 2.1 of the License, or (at your option) any later version. 480 | 481 | This library is distributed in the hope that it will be useful, 482 | but WITHOUT ANY WARRANTY; without even the implied warranty of 483 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 484 | Lesser General Public License for more details. 485 | 486 | You should have received a copy of the GNU Lesser General Public 487 | License along with this library; if not, write to the Free Software 488 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 489 | USA 490 | 491 | Also add information on how to contact you by electronic and paper mail. 492 | 493 | You should also get your employer (if you work as a programmer) or your 494 | school, if any, to sign a "copyright disclaimer" for the library, if 495 | necessary. Here is a sample; alter the names: 496 | 497 | Yoyodyne, Inc., hereby disclaims all copyright interest in the 498 | library `Frob' (a library for tweaking knobs) written by James Random 499 | Hacker. 500 | 501 | , 1 April 1990 502 | Ty Coon, President of Vice 503 | 504 | That's all there is to it! 505 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # tree-sitter-xml 2 | 3 | 4 | 5 | XML grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter). 6 | 7 | ## See also 8 | 9 | - [android-tree-sitter](https://github.com/AndroidIDEOfficial/android-tree-sitter) - Android Java bindings for tree-sitter. -------------------------------------------------------------------------------- /binding.gyp: -------------------------------------------------------------------------------- 1 | { 2 | "targets": [ 3 | { 4 | "target_name": "tree_sitter_xml_binding", 5 | "include_dirs": [ 6 | " 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 | -------------------------------------------------------------------------------- /bindings/node/index.js: -------------------------------------------------------------------------------- 1 | try { 2 | module.exports = require("../../build/Release/tree_sitter_xml_binding"); 3 | } catch (error1) { 4 | if (error1.code !== 'MODULE_NOT_FOUND') { 5 | throw error1; 6 | } 7 | try { 8 | module.exports = require("../../build/Debug/tree_sitter_xml_binding"); 9 | } catch (error2) { 10 | if (error2.code !== 'MODULE_NOT_FOUND') { 11 | throw error2; 12 | } 13 | throw error1 14 | } 15 | } 16 | 17 | try { 18 | module.exports.nodeTypeInfo = require("../../src/node-types.json"); 19 | } catch (_) {} 20 | -------------------------------------------------------------------------------- /bindings/rust/build.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | let src_dir = std::path::Path::new("src"); 3 | 4 | let mut c_config = cc::Build::new(); 5 | c_config.include(&src_dir); 6 | c_config 7 | .flag_if_supported("-Wno-unused-parameter") 8 | .flag_if_supported("-Wno-unused-but-set-variable") 9 | .flag_if_supported("-Wno-trigraphs"); 10 | let parser_path = src_dir.join("parser.c"); 11 | c_config.file(&parser_path); 12 | 13 | // If your language uses an external scanner written in C, 14 | // then include this block of code: 15 | 16 | /* 17 | let scanner_path = src_dir.join("scanner.c"); 18 | c_config.file(&scanner_path); 19 | println!("cargo:rerun-if-changed={}", scanner_path.to_str().unwrap()); 20 | */ 21 | 22 | c_config.compile("parser"); 23 | println!("cargo:rerun-if-changed={}", parser_path.to_str().unwrap()); 24 | 25 | // If your language uses an external scanner written in C++, 26 | // then include this block of code: 27 | 28 | /* 29 | let mut cpp_config = cc::Build::new(); 30 | cpp_config.cpp(true); 31 | cpp_config.include(&src_dir); 32 | cpp_config 33 | .flag_if_supported("-Wno-unused-parameter") 34 | .flag_if_supported("-Wno-unused-but-set-variable"); 35 | let scanner_path = src_dir.join("scanner.cc"); 36 | cpp_config.file(&scanner_path); 37 | cpp_config.compile("scanner"); 38 | println!("cargo:rerun-if-changed={}", scanner_path.to_str().unwrap()); 39 | */ 40 | } 41 | -------------------------------------------------------------------------------- /bindings/rust/lib.rs: -------------------------------------------------------------------------------- 1 | //! This crate provides xml language support for the [tree-sitter][] parsing library. 2 | //! 3 | //! Typically, you will use the [language][language func] function to add this language to a 4 | //! tree-sitter [Parser][], and then use the parser to parse some code: 5 | //! 6 | //! ``` 7 | //! let code = ""; 8 | //! let mut parser = tree_sitter::Parser::new(); 9 | //! parser.set_language(tree_sitter_xml::language()).expect("Error loading xml grammar"); 10 | //! let tree = parser.parse(code, None).unwrap(); 11 | //! ``` 12 | //! 13 | //! [Language]: https://docs.rs/tree-sitter/*/tree_sitter/struct.Language.html 14 | //! [language func]: fn.language.html 15 | //! [Parser]: https://docs.rs/tree-sitter/*/tree_sitter/struct.Parser.html 16 | //! [tree-sitter]: https://tree-sitter.github.io/ 17 | 18 | use tree_sitter::Language; 19 | 20 | extern "C" { 21 | fn tree_sitter_xml() -> Language; 22 | } 23 | 24 | /// Get the tree-sitter [Language][] for this grammar. 25 | /// 26 | /// [Language]: https://docs.rs/tree-sitter/*/tree_sitter/struct.Language.html 27 | pub fn language() -> Language { 28 | unsafe { tree_sitter_xml() } 29 | } 30 | 31 | /// The content of the [`node-types.json`][] file for this grammar. 32 | /// 33 | /// [`node-types.json`]: https://tree-sitter.github.io/tree-sitter/using-parsers#static-node-types 34 | pub const NODE_TYPES: &'static str = include_str!("../../src/node-types.json"); 35 | 36 | // Uncomment these to include any queries that this grammar contains 37 | 38 | // pub const HIGHLIGHTS_QUERY: &'static str = include_str!("../../queries/highlights.scm"); 39 | // pub const INJECTIONS_QUERY: &'static str = include_str!("../../queries/injections.scm"); 40 | // pub const LOCALS_QUERY: &'static str = include_str!("../../queries/locals.scm"); 41 | // pub const TAGS_QUERY: &'static str = include_str!("../../queries/tags.scm"); 42 | 43 | #[cfg(test)] 44 | mod tests { 45 | #[test] 46 | fn test_can_load_grammar() { 47 | let mut parser = tree_sitter::Parser::new(); 48 | parser 49 | .set_language(super::language()) 50 | .expect("Error loading xml language"); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /examples/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | #f44336 < #2196f3 3 | 4 | -------------------------------------------------------------------------------- /examples/q.scm: -------------------------------------------------------------------------------- 1 | (empty_element 2 | "<" @tag.open 3 | tag_name: (_) @element.name 4 | "/" @tag.slash 5 | ">" @tag.close) @element.empty 6 | 7 | (end_tag_element 8 | (tag_start 9 | "<" @tag.start.open 10 | tag_name: (_) @tag.start.name 11 | ">" @tag.start.close) 12 | (tag_end 13 | "<" @tag.end.open 14 | "/" @tag.end.slash 15 | tag_name: (_) @tag.end.name 16 | ">" @tag.end.close) 17 | ) @element.with_end -------------------------------------------------------------------------------- /examples/test.xml: -------------------------------------------------------------------------------- 1 | 2 | 2 | -------------------------------------------------------------------------------- /grammar.js: -------------------------------------------------------------------------------- 1 | module.exports = grammar({ 2 | name: 'xml', 3 | 4 | extras: $ => [ 5 | $._ws 6 | ], 7 | 8 | rules: { 9 | xml_file: $ => seq( 10 | optional($.xml_decl), 11 | $.element, 12 | repeat($._misc) 13 | ), 14 | 15 | pi: $ => seq( 16 | '' 25 | ), 26 | 27 | element: $ => choice( 28 | $.empty_element, 29 | $.end_tag_element 30 | ), 31 | 32 | end_tag_element: $ => seq( 33 | $.tag_start, 34 | optional($.char_data), 35 | optional($._content), 36 | $.tag_end 37 | ), 38 | 39 | empty_element: $ => seq( 40 | '<', 41 | field("tag_name", $.name), 42 | repeat(seq($._ws, $.attribute)), 43 | optional($._ws), 44 | '/', 45 | '>' 46 | ), 47 | 48 | tag_start: $ => seq( 49 | '<', 50 | field("tag_name", $.name), 51 | repeat( 52 | seq( 53 | $._ws, 54 | $.attribute 55 | ) 56 | ), 57 | optional($._ws), 58 | '>' 59 | ), 60 | 61 | tag_end: $ => seq( 62 | '<', 63 | '/', 64 | field("tag_name", $.name), 65 | optional($._ws), 66 | '>' 67 | ), 68 | 69 | _content: $ => repeat1( 70 | seq( 71 | choice( 72 | $.element, 73 | $._ref, 74 | $.cdata_sect, 75 | $.pi, 76 | $.comment 77 | ), 78 | optional($.char_data) 79 | ) 80 | ), 81 | 82 | 83 | attribute: $ => choice( 84 | $.ns_decl, 85 | $.xml_attr 86 | ), 87 | 88 | ns_decl: $ => seq( 89 | 'xmlns', 90 | ':', 91 | field("xmlns_prefix", $.name), 92 | $.eq, 93 | $.attr_value, 94 | ), 95 | 96 | xml_attr: $ => seq( 97 | optional(seq(field("ns_prefix", $.name), ':')), 98 | field("attr_name", $.name), 99 | $.eq, 100 | $.attr_value, 101 | ), 102 | 103 | attr_value: $ => seq( 104 | $._quote, 105 | repeat( 106 | choice( 107 | /[^<&]/, 108 | $._ref 109 | ) 110 | ), 111 | $._quote 112 | ), 113 | 114 | xml_decl: $ => seq( 115 | '' 120 | ), 121 | 122 | xml_version: $ => seq( 123 | $._ws, 124 | field("version_attr", 'version'), 125 | $.eq, 126 | $.xml_version_value 127 | ), 128 | 129 | xml_version_value: $ => seq( 130 | $._quote, 131 | $._dec_num, 132 | $._quote 133 | ), 134 | 135 | xml_encoding: $ => seq( 136 | $._ws, 137 | field("encoding_attr", 'encoding'), 138 | $.eq, 139 | $.xml_encoding_value 140 | ), 141 | 142 | xml_encoding_value: $ => seq( 143 | $._quote, 144 | $._encoding, 145 | $._quote 146 | ), 147 | 148 | name: $ => token(/[A-Za-z_]([A-Za-z0-9_\-.])*/), 149 | 150 | comment: $ => seq(''), 151 | 152 | char_data: $ => /[^<&\s]*/, 153 | char_ref: $ => token(/(&#[0-9]+;)|(&#x[0-9a-fA-F]+;)/), 154 | 155 | cdata_sect: $ => seq( 156 | $.cdata_start, 157 | optional($.cdata), 158 | $.cdata_end 159 | ), 160 | 161 | cdata_start: $ => ' repeat1($._char), 164 | 165 | cdata_end: $ => ']]>', 166 | 167 | _ref: $ => choice( 168 | $.entity_ref, 169 | $.char_ref 170 | ), 171 | 172 | entity_ref: $ => seq( 173 | '&', 174 | $.name, 175 | ';' 176 | ), 177 | 178 | eq: $ => '=', 179 | 180 | _misc: $ => choice($.pi, $.comment, $._char), 181 | _char: $ => /./, 182 | _ws: $ => /\s/, 183 | _quote: $ => choice('"', '\''), 184 | _dec_num: $ => /[0-9]+\.[0-9]+/, 185 | _encoding: $ => token(/[A-Za-z]([A-Za-z0-9._\-])*/) 186 | } 187 | }); 188 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tree-sitter-xml", 3 | "version": "1.0.0", 4 | "description": "Tree Sitter grammar for XML files", 5 | "main": "bindings/node", 6 | "scripts": { 7 | "build": "tree-sitter generate", 8 | "build-wasm": "tree-sitter build-wasm", 9 | "test": "tree-sitter test", 10 | "playground": "tree-sitter generate && tree-sitter build-wasm && tree-sitter playground" 11 | }, 12 | "repository": { 13 | "type": "git", 14 | "url": "git+https://github.com/AndroidIDEOfficial/tree-sitter-xml.git" 15 | }, 16 | "keywords": [ 17 | "androidide", 18 | "treesitter", 19 | "grammar", 20 | "xml" 21 | ], 22 | "author": "Akash Yadav", 23 | "license": "GPL-3.0-only", 24 | "bugs": { 25 | "url": "https://github.com/AndroidIDEOfficial/tree-sitter-xml/issues" 26 | }, 27 | "homepage": "https://github.com/AndroidIDEOfficial/tree-sitter-xml#readme", 28 | "tree-sitter": [ 29 | { 30 | "scope": "scope.xml", 31 | "file-types": [ 32 | "xml" 33 | ] 34 | } 35 | ], 36 | "dependencies": { 37 | "nan": "^2.17.0" 38 | }, 39 | "devDependencies": { 40 | "tree-sitter-cli": "^0.20.8" 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /queries/blocks.scm: -------------------------------------------------------------------------------- 1 | ; Query for creating code block ranges in sora-editor 2 | 3 | (xml_decl) @scope.marked 4 | 5 | (end_tag_element) @scope.marked 6 | 7 | (empty_element) @scope.marked -------------------------------------------------------------------------------- /queries/brackets.scm: -------------------------------------------------------------------------------- 1 | ; bracket pair highlights query for sora-editor 2 | 3 | ; for xml declaration, mark the opening '' as brackets close 4 | (xml_decl 5 | "" @editor.brackets.close) 7 | 8 | ; for empty element tag, mark opening '<' and closing '/>' as brackets open and close 9 | (empty_element 10 | "<" @editor.brackets.open 11 | "/>" @editor.brackets.close) 12 | 13 | ; in case of an element which has an end tag 14 | ; mark the tag name in tag_start as bracket open 15 | ; and the tag name in tag_end as bracket close 16 | (end_tag_element 17 | (tag_start 18 | tag_name: (name) @editor.brackets.open) 19 | (tag_end 20 | tag_name: (name) @editor.brackets.close) 21 | ) 22 | 23 | ; bracket pairs for CDATA sections 24 | (cdata_sect 25 | (cdata_start) @editor.brackets.open 26 | (cdata_end) @editor.brackets.close 27 | ) -------------------------------------------------------------------------------- /queries/highlights.scm: -------------------------------------------------------------------------------- 1 | (xml_decl 2 | decl: "xml" @xml_decl) 3 | 4 | (xml_version 5 | version_attr: "version" @attr.name) 6 | 7 | (xml_encoding 8 | encoding_attr: "encoding" @attr.name) 9 | 10 | (xml_version_value) @attr.value 11 | (xml_encoding_value) @attr.value 12 | 13 | (empty_element 14 | tag_name: (name) @element.tag) 15 | 16 | (tag_start 17 | tag_name: (name) @element.tag) 18 | 19 | (tag_end 20 | tag_name: (name) @element.tag) 21 | 22 | "xmlns" @ns_declarator 23 | (ns_decl 24 | xmlns_prefix: (name) @xmlns.prefix) 25 | 26 | (xml_attr 27 | ns_prefix: (name) @attr.prefix 28 | attr_name: (name) @attr.name) 29 | 30 | (attr_value) @attr.value 31 | 32 | (entity_ref) @xml.ref 33 | (char_ref) @xml.ref 34 | 35 | (comment) @comment 36 | 37 | (cdata_start) @cdata.start 38 | (cdata_end) @cdata.end 39 | (cdata) @cdata.data 40 | 41 | (eq) @operator 42 | 43 | (char_data) @text 44 | 45 | ; ["<" "" "" "/>"] @operator 46 | -------------------------------------------------------------------------------- /src/grammar.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "xml", 3 | "rules": { 4 | "xml_file": { 5 | "type": "SEQ", 6 | "members": [ 7 | { 8 | "type": "CHOICE", 9 | "members": [ 10 | { 11 | "type": "SYMBOL", 12 | "name": "xml_decl" 13 | }, 14 | { 15 | "type": "BLANK" 16 | } 17 | ] 18 | }, 19 | { 20 | "type": "SYMBOL", 21 | "name": "element" 22 | }, 23 | { 24 | "type": "REPEAT", 25 | "content": { 26 | "type": "SYMBOL", 27 | "name": "_misc" 28 | } 29 | } 30 | ] 31 | }, 32 | "pi": { 33 | "type": "SEQ", 34 | "members": [ 35 | { 36 | "type": "STRING", 37 | "value": "" 70 | } 71 | ] 72 | }, 73 | "element": { 74 | "type": "CHOICE", 75 | "members": [ 76 | { 77 | "type": "SYMBOL", 78 | "name": "empty_element" 79 | }, 80 | { 81 | "type": "SYMBOL", 82 | "name": "end_tag_element" 83 | } 84 | ] 85 | }, 86 | "end_tag_element": { 87 | "type": "SEQ", 88 | "members": [ 89 | { 90 | "type": "SYMBOL", 91 | "name": "tag_start" 92 | }, 93 | { 94 | "type": "CHOICE", 95 | "members": [ 96 | { 97 | "type": "SYMBOL", 98 | "name": "char_data" 99 | }, 100 | { 101 | "type": "BLANK" 102 | } 103 | ] 104 | }, 105 | { 106 | "type": "CHOICE", 107 | "members": [ 108 | { 109 | "type": "SYMBOL", 110 | "name": "_content" 111 | }, 112 | { 113 | "type": "BLANK" 114 | } 115 | ] 116 | }, 117 | { 118 | "type": "SYMBOL", 119 | "name": "tag_end" 120 | } 121 | ] 122 | }, 123 | "empty_element": { 124 | "type": "SEQ", 125 | "members": [ 126 | { 127 | "type": "STRING", 128 | "value": "<" 129 | }, 130 | { 131 | "type": "FIELD", 132 | "name": "tag_name", 133 | "content": { 134 | "type": "SYMBOL", 135 | "name": "name" 136 | } 137 | }, 138 | { 139 | "type": "REPEAT", 140 | "content": { 141 | "type": "SEQ", 142 | "members": [ 143 | { 144 | "type": "SYMBOL", 145 | "name": "_ws" 146 | }, 147 | { 148 | "type": "SYMBOL", 149 | "name": "attribute" 150 | } 151 | ] 152 | } 153 | }, 154 | { 155 | "type": "CHOICE", 156 | "members": [ 157 | { 158 | "type": "SYMBOL", 159 | "name": "_ws" 160 | }, 161 | { 162 | "type": "BLANK" 163 | } 164 | ] 165 | }, 166 | { 167 | "type": "STRING", 168 | "value": "/" 169 | }, 170 | { 171 | "type": "STRING", 172 | "value": ">" 173 | } 174 | ] 175 | }, 176 | "tag_start": { 177 | "type": "SEQ", 178 | "members": [ 179 | { 180 | "type": "STRING", 181 | "value": "<" 182 | }, 183 | { 184 | "type": "FIELD", 185 | "name": "tag_name", 186 | "content": { 187 | "type": "SYMBOL", 188 | "name": "name" 189 | } 190 | }, 191 | { 192 | "type": "REPEAT", 193 | "content": { 194 | "type": "SEQ", 195 | "members": [ 196 | { 197 | "type": "SYMBOL", 198 | "name": "_ws" 199 | }, 200 | { 201 | "type": "SYMBOL", 202 | "name": "attribute" 203 | } 204 | ] 205 | } 206 | }, 207 | { 208 | "type": "CHOICE", 209 | "members": [ 210 | { 211 | "type": "SYMBOL", 212 | "name": "_ws" 213 | }, 214 | { 215 | "type": "BLANK" 216 | } 217 | ] 218 | }, 219 | { 220 | "type": "STRING", 221 | "value": ">" 222 | } 223 | ] 224 | }, 225 | "tag_end": { 226 | "type": "SEQ", 227 | "members": [ 228 | { 229 | "type": "STRING", 230 | "value": "<" 231 | }, 232 | { 233 | "type": "STRING", 234 | "value": "/" 235 | }, 236 | { 237 | "type": "FIELD", 238 | "name": "tag_name", 239 | "content": { 240 | "type": "SYMBOL", 241 | "name": "name" 242 | } 243 | }, 244 | { 245 | "type": "CHOICE", 246 | "members": [ 247 | { 248 | "type": "SYMBOL", 249 | "name": "_ws" 250 | }, 251 | { 252 | "type": "BLANK" 253 | } 254 | ] 255 | }, 256 | { 257 | "type": "STRING", 258 | "value": ">" 259 | } 260 | ] 261 | }, 262 | "_content": { 263 | "type": "REPEAT1", 264 | "content": { 265 | "type": "SEQ", 266 | "members": [ 267 | { 268 | "type": "CHOICE", 269 | "members": [ 270 | { 271 | "type": "SYMBOL", 272 | "name": "element" 273 | }, 274 | { 275 | "type": "SYMBOL", 276 | "name": "_ref" 277 | }, 278 | { 279 | "type": "SYMBOL", 280 | "name": "cdata_sect" 281 | }, 282 | { 283 | "type": "SYMBOL", 284 | "name": "pi" 285 | }, 286 | { 287 | "type": "SYMBOL", 288 | "name": "comment" 289 | } 290 | ] 291 | }, 292 | { 293 | "type": "CHOICE", 294 | "members": [ 295 | { 296 | "type": "SYMBOL", 297 | "name": "char_data" 298 | }, 299 | { 300 | "type": "BLANK" 301 | } 302 | ] 303 | } 304 | ] 305 | } 306 | }, 307 | "attribute": { 308 | "type": "CHOICE", 309 | "members": [ 310 | { 311 | "type": "SYMBOL", 312 | "name": "ns_decl" 313 | }, 314 | { 315 | "type": "SYMBOL", 316 | "name": "xml_attr" 317 | } 318 | ] 319 | }, 320 | "ns_decl": { 321 | "type": "SEQ", 322 | "members": [ 323 | { 324 | "type": "STRING", 325 | "value": "xmlns" 326 | }, 327 | { 328 | "type": "STRING", 329 | "value": ":" 330 | }, 331 | { 332 | "type": "FIELD", 333 | "name": "xmlns_prefix", 334 | "content": { 335 | "type": "SYMBOL", 336 | "name": "name" 337 | } 338 | }, 339 | { 340 | "type": "SYMBOL", 341 | "name": "eq" 342 | }, 343 | { 344 | "type": "SYMBOL", 345 | "name": "attr_value" 346 | } 347 | ] 348 | }, 349 | "xml_attr": { 350 | "type": "SEQ", 351 | "members": [ 352 | { 353 | "type": "CHOICE", 354 | "members": [ 355 | { 356 | "type": "SEQ", 357 | "members": [ 358 | { 359 | "type": "FIELD", 360 | "name": "ns_prefix", 361 | "content": { 362 | "type": "SYMBOL", 363 | "name": "name" 364 | } 365 | }, 366 | { 367 | "type": "STRING", 368 | "value": ":" 369 | } 370 | ] 371 | }, 372 | { 373 | "type": "BLANK" 374 | } 375 | ] 376 | }, 377 | { 378 | "type": "FIELD", 379 | "name": "attr_name", 380 | "content": { 381 | "type": "SYMBOL", 382 | "name": "name" 383 | } 384 | }, 385 | { 386 | "type": "SYMBOL", 387 | "name": "eq" 388 | }, 389 | { 390 | "type": "SYMBOL", 391 | "name": "attr_value" 392 | } 393 | ] 394 | }, 395 | "attr_value": { 396 | "type": "SEQ", 397 | "members": [ 398 | { 399 | "type": "SYMBOL", 400 | "name": "_quote" 401 | }, 402 | { 403 | "type": "REPEAT", 404 | "content": { 405 | "type": "CHOICE", 406 | "members": [ 407 | { 408 | "type": "PATTERN", 409 | "value": "[^<&]" 410 | }, 411 | { 412 | "type": "SYMBOL", 413 | "name": "_ref" 414 | } 415 | ] 416 | } 417 | }, 418 | { 419 | "type": "SYMBOL", 420 | "name": "_quote" 421 | } 422 | ] 423 | }, 424 | "xml_decl": { 425 | "type": "SEQ", 426 | "members": [ 427 | { 428 | "type": "STRING", 429 | "value": "" 470 | } 471 | ] 472 | }, 473 | "xml_version": { 474 | "type": "SEQ", 475 | "members": [ 476 | { 477 | "type": "SYMBOL", 478 | "name": "_ws" 479 | }, 480 | { 481 | "type": "FIELD", 482 | "name": "version_attr", 483 | "content": { 484 | "type": "STRING", 485 | "value": "version" 486 | } 487 | }, 488 | { 489 | "type": "SYMBOL", 490 | "name": "eq" 491 | }, 492 | { 493 | "type": "SYMBOL", 494 | "name": "xml_version_value" 495 | } 496 | ] 497 | }, 498 | "xml_version_value": { 499 | "type": "SEQ", 500 | "members": [ 501 | { 502 | "type": "SYMBOL", 503 | "name": "_quote" 504 | }, 505 | { 506 | "type": "SYMBOL", 507 | "name": "_dec_num" 508 | }, 509 | { 510 | "type": "SYMBOL", 511 | "name": "_quote" 512 | } 513 | ] 514 | }, 515 | "xml_encoding": { 516 | "type": "SEQ", 517 | "members": [ 518 | { 519 | "type": "SYMBOL", 520 | "name": "_ws" 521 | }, 522 | { 523 | "type": "FIELD", 524 | "name": "encoding_attr", 525 | "content": { 526 | "type": "STRING", 527 | "value": "encoding" 528 | } 529 | }, 530 | { 531 | "type": "SYMBOL", 532 | "name": "eq" 533 | }, 534 | { 535 | "type": "SYMBOL", 536 | "name": "xml_encoding_value" 537 | } 538 | ] 539 | }, 540 | "xml_encoding_value": { 541 | "type": "SEQ", 542 | "members": [ 543 | { 544 | "type": "SYMBOL", 545 | "name": "_quote" 546 | }, 547 | { 548 | "type": "SYMBOL", 549 | "name": "_encoding" 550 | }, 551 | { 552 | "type": "SYMBOL", 553 | "name": "_quote" 554 | } 555 | ] 556 | }, 557 | "name": { 558 | "type": "TOKEN", 559 | "content": { 560 | "type": "PATTERN", 561 | "value": "[A-Za-z_]([A-Za-z0-9_\\-.])*" 562 | } 563 | }, 564 | "comment": { 565 | "type": "SEQ", 566 | "members": [ 567 | { 568 | "type": "STRING", 569 | "value": "" 581 | } 582 | ] 583 | }, 584 | "char_data": { 585 | "type": "PATTERN", 586 | "value": "[^<&\\s]*" 587 | }, 588 | "char_ref": { 589 | "type": "TOKEN", 590 | "content": { 591 | "type": "PATTERN", 592 | "value": "(&#[0-9]+;)|(&#x[0-9a-fA-F]+;)" 593 | } 594 | }, 595 | "cdata_sect": { 596 | "type": "SEQ", 597 | "members": [ 598 | { 599 | "type": "SYMBOL", 600 | "name": "cdata_start" 601 | }, 602 | { 603 | "type": "CHOICE", 604 | "members": [ 605 | { 606 | "type": "SYMBOL", 607 | "name": "cdata" 608 | }, 609 | { 610 | "type": "BLANK" 611 | } 612 | ] 613 | }, 614 | { 615 | "type": "SYMBOL", 616 | "name": "cdata_end" 617 | } 618 | ] 619 | }, 620 | "cdata_start": { 621 | "type": "STRING", 622 | "value": "" 634 | }, 635 | "_ref": { 636 | "type": "CHOICE", 637 | "members": [ 638 | { 639 | "type": "SYMBOL", 640 | "name": "entity_ref" 641 | }, 642 | { 643 | "type": "SYMBOL", 644 | "name": "char_ref" 645 | } 646 | ] 647 | }, 648 | "entity_ref": { 649 | "type": "SEQ", 650 | "members": [ 651 | { 652 | "type": "STRING", 653 | "value": "&" 654 | }, 655 | { 656 | "type": "SYMBOL", 657 | "name": "name" 658 | }, 659 | { 660 | "type": "STRING", 661 | "value": ";" 662 | } 663 | ] 664 | }, 665 | "eq": { 666 | "type": "STRING", 667 | "value": "=" 668 | }, 669 | "_misc": { 670 | "type": "CHOICE", 671 | "members": [ 672 | { 673 | "type": "SYMBOL", 674 | "name": "pi" 675 | }, 676 | { 677 | "type": "SYMBOL", 678 | "name": "comment" 679 | }, 680 | { 681 | "type": "SYMBOL", 682 | "name": "_char" 683 | } 684 | ] 685 | }, 686 | "_char": { 687 | "type": "PATTERN", 688 | "value": "." 689 | }, 690 | "_ws": { 691 | "type": "PATTERN", 692 | "value": "\\s" 693 | }, 694 | "_quote": { 695 | "type": "CHOICE", 696 | "members": [ 697 | { 698 | "type": "STRING", 699 | "value": "\"" 700 | }, 701 | { 702 | "type": "STRING", 703 | "value": "'" 704 | } 705 | ] 706 | }, 707 | "_dec_num": { 708 | "type": "PATTERN", 709 | "value": "[0-9]+\\.[0-9]+" 710 | }, 711 | "_encoding": { 712 | "type": "TOKEN", 713 | "content": { 714 | "type": "PATTERN", 715 | "value": "[A-Za-z]([A-Za-z0-9._\\-])*" 716 | } 717 | } 718 | }, 719 | "extras": [ 720 | { 721 | "type": "SYMBOL", 722 | "name": "_ws" 723 | } 724 | ], 725 | "conflicts": [], 726 | "precedences": [], 727 | "externals": [], 728 | "inline": [], 729 | "supertypes": [] 730 | } 731 | 732 | -------------------------------------------------------------------------------- /src/node-types.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "type": "attr_value", 4 | "named": true, 5 | "fields": {}, 6 | "children": { 7 | "multiple": true, 8 | "required": false, 9 | "types": [ 10 | { 11 | "type": "char_ref", 12 | "named": true 13 | }, 14 | { 15 | "type": "entity_ref", 16 | "named": true 17 | } 18 | ] 19 | } 20 | }, 21 | { 22 | "type": "attribute", 23 | "named": true, 24 | "fields": {}, 25 | "children": { 26 | "multiple": false, 27 | "required": true, 28 | "types": [ 29 | { 30 | "type": "ns_decl", 31 | "named": true 32 | }, 33 | { 34 | "type": "xml_attr", 35 | "named": true 36 | } 37 | ] 38 | } 39 | }, 40 | { 41 | "type": "cdata", 42 | "named": true, 43 | "fields": {} 44 | }, 45 | { 46 | "type": "cdata_sect", 47 | "named": true, 48 | "fields": {}, 49 | "children": { 50 | "multiple": true, 51 | "required": true, 52 | "types": [ 53 | { 54 | "type": "cdata", 55 | "named": true 56 | }, 57 | { 58 | "type": "cdata_end", 59 | "named": true 60 | }, 61 | { 62 | "type": "cdata_start", 63 | "named": true 64 | } 65 | ] 66 | } 67 | }, 68 | { 69 | "type": "comment", 70 | "named": true, 71 | "fields": {} 72 | }, 73 | { 74 | "type": "element", 75 | "named": true, 76 | "fields": {}, 77 | "children": { 78 | "multiple": false, 79 | "required": true, 80 | "types": [ 81 | { 82 | "type": "empty_element", 83 | "named": true 84 | }, 85 | { 86 | "type": "end_tag_element", 87 | "named": true 88 | } 89 | ] 90 | } 91 | }, 92 | { 93 | "type": "empty_element", 94 | "named": true, 95 | "fields": { 96 | "tag_name": { 97 | "multiple": false, 98 | "required": true, 99 | "types": [ 100 | { 101 | "type": "name", 102 | "named": true 103 | } 104 | ] 105 | } 106 | }, 107 | "children": { 108 | "multiple": true, 109 | "required": false, 110 | "types": [ 111 | { 112 | "type": "attribute", 113 | "named": true 114 | } 115 | ] 116 | } 117 | }, 118 | { 119 | "type": "end_tag_element", 120 | "named": true, 121 | "fields": {}, 122 | "children": { 123 | "multiple": true, 124 | "required": true, 125 | "types": [ 126 | { 127 | "type": "cdata_sect", 128 | "named": true 129 | }, 130 | { 131 | "type": "char_data", 132 | "named": true 133 | }, 134 | { 135 | "type": "char_ref", 136 | "named": true 137 | }, 138 | { 139 | "type": "comment", 140 | "named": true 141 | }, 142 | { 143 | "type": "element", 144 | "named": true 145 | }, 146 | { 147 | "type": "entity_ref", 148 | "named": true 149 | }, 150 | { 151 | "type": "pi", 152 | "named": true 153 | }, 154 | { 155 | "type": "tag_end", 156 | "named": true 157 | }, 158 | { 159 | "type": "tag_start", 160 | "named": true 161 | } 162 | ] 163 | } 164 | }, 165 | { 166 | "type": "entity_ref", 167 | "named": true, 168 | "fields": {}, 169 | "children": { 170 | "multiple": false, 171 | "required": true, 172 | "types": [ 173 | { 174 | "type": "name", 175 | "named": true 176 | } 177 | ] 178 | } 179 | }, 180 | { 181 | "type": "ns_decl", 182 | "named": true, 183 | "fields": { 184 | "xmlns_prefix": { 185 | "multiple": false, 186 | "required": true, 187 | "types": [ 188 | { 189 | "type": "name", 190 | "named": true 191 | } 192 | ] 193 | } 194 | }, 195 | "children": { 196 | "multiple": true, 197 | "required": true, 198 | "types": [ 199 | { 200 | "type": "attr_value", 201 | "named": true 202 | }, 203 | { 204 | "type": "eq", 205 | "named": true 206 | } 207 | ] 208 | } 209 | }, 210 | { 211 | "type": "pi", 212 | "named": true, 213 | "fields": {}, 214 | "children": { 215 | "multiple": false, 216 | "required": true, 217 | "types": [ 218 | { 219 | "type": "name", 220 | "named": true 221 | } 222 | ] 223 | } 224 | }, 225 | { 226 | "type": "tag_end", 227 | "named": true, 228 | "fields": { 229 | "tag_name": { 230 | "multiple": false, 231 | "required": true, 232 | "types": [ 233 | { 234 | "type": "name", 235 | "named": true 236 | } 237 | ] 238 | } 239 | } 240 | }, 241 | { 242 | "type": "tag_start", 243 | "named": true, 244 | "fields": { 245 | "tag_name": { 246 | "multiple": false, 247 | "required": true, 248 | "types": [ 249 | { 250 | "type": "name", 251 | "named": true 252 | } 253 | ] 254 | } 255 | }, 256 | "children": { 257 | "multiple": true, 258 | "required": false, 259 | "types": [ 260 | { 261 | "type": "attribute", 262 | "named": true 263 | } 264 | ] 265 | } 266 | }, 267 | { 268 | "type": "xml_attr", 269 | "named": true, 270 | "fields": { 271 | "attr_name": { 272 | "multiple": false, 273 | "required": true, 274 | "types": [ 275 | { 276 | "type": "name", 277 | "named": true 278 | } 279 | ] 280 | }, 281 | "ns_prefix": { 282 | "multiple": false, 283 | "required": false, 284 | "types": [ 285 | { 286 | "type": "name", 287 | "named": true 288 | } 289 | ] 290 | } 291 | }, 292 | "children": { 293 | "multiple": true, 294 | "required": true, 295 | "types": [ 296 | { 297 | "type": "attr_value", 298 | "named": true 299 | }, 300 | { 301 | "type": "eq", 302 | "named": true 303 | } 304 | ] 305 | } 306 | }, 307 | { 308 | "type": "xml_decl", 309 | "named": true, 310 | "fields": { 311 | "decl": { 312 | "multiple": false, 313 | "required": true, 314 | "types": [ 315 | { 316 | "type": "xml", 317 | "named": false 318 | } 319 | ] 320 | } 321 | }, 322 | "children": { 323 | "multiple": true, 324 | "required": true, 325 | "types": [ 326 | { 327 | "type": "xml_encoding", 328 | "named": true 329 | }, 330 | { 331 | "type": "xml_version", 332 | "named": true 333 | } 334 | ] 335 | } 336 | }, 337 | { 338 | "type": "xml_encoding", 339 | "named": true, 340 | "fields": { 341 | "encoding_attr": { 342 | "multiple": false, 343 | "required": true, 344 | "types": [ 345 | { 346 | "type": "encoding", 347 | "named": false 348 | } 349 | ] 350 | } 351 | }, 352 | "children": { 353 | "multiple": true, 354 | "required": true, 355 | "types": [ 356 | { 357 | "type": "eq", 358 | "named": true 359 | }, 360 | { 361 | "type": "xml_encoding_value", 362 | "named": true 363 | } 364 | ] 365 | } 366 | }, 367 | { 368 | "type": "xml_encoding_value", 369 | "named": true, 370 | "fields": {} 371 | }, 372 | { 373 | "type": "xml_file", 374 | "named": true, 375 | "fields": {}, 376 | "children": { 377 | "multiple": true, 378 | "required": true, 379 | "types": [ 380 | { 381 | "type": "comment", 382 | "named": true 383 | }, 384 | { 385 | "type": "element", 386 | "named": true 387 | }, 388 | { 389 | "type": "pi", 390 | "named": true 391 | }, 392 | { 393 | "type": "xml_decl", 394 | "named": true 395 | } 396 | ] 397 | } 398 | }, 399 | { 400 | "type": "xml_version", 401 | "named": true, 402 | "fields": { 403 | "version_attr": { 404 | "multiple": false, 405 | "required": true, 406 | "types": [ 407 | { 408 | "type": "version", 409 | "named": false 410 | } 411 | ] 412 | } 413 | }, 414 | "children": { 415 | "multiple": true, 416 | "required": true, 417 | "types": [ 418 | { 419 | "type": "eq", 420 | "named": true 421 | }, 422 | { 423 | "type": "xml_version_value", 424 | "named": true 425 | } 426 | ] 427 | } 428 | }, 429 | { 430 | "type": "xml_version_value", 431 | "named": true, 432 | "fields": {} 433 | }, 434 | { 435 | "type": "\"", 436 | "named": false 437 | }, 438 | { 439 | "type": "&", 440 | "named": false 441 | }, 442 | { 443 | "type": "'", 444 | "named": false 445 | }, 446 | { 447 | "type": "-->", 448 | "named": false 449 | }, 450 | { 451 | "type": "/", 452 | "named": false 453 | }, 454 | { 455 | "type": ":", 456 | "named": false 457 | }, 458 | { 459 | "type": ";", 460 | "named": false 461 | }, 462 | { 463 | "type": "<", 464 | "named": false 465 | }, 466 | { 467 | "type": "", 93 | [sym_char_data] = "char_data", 94 | [sym_char_ref] = "char_ref", 95 | [sym_cdata_start] = "cdata_start", 96 | [sym_cdata_end] = "cdata_end", 97 | [anon_sym_AMP] = "&", 98 | [anon_sym_SEMI] = ";", 99 | [sym_eq] = "eq", 100 | [sym__char] = "_char", 101 | [sym__ws] = "_ws", 102 | [anon_sym_DQUOTE] = "\"", 103 | [anon_sym_SQUOTE] = "'", 104 | [sym__dec_num] = "_dec_num", 105 | [sym__encoding] = "_encoding", 106 | [sym_xml_file] = "xml_file", 107 | [sym_pi] = "pi", 108 | [sym_element] = "element", 109 | [sym_end_tag_element] = "end_tag_element", 110 | [sym_empty_element] = "empty_element", 111 | [sym_tag_start] = "tag_start", 112 | [sym_tag_end] = "tag_end", 113 | [aux_sym__content] = "_content", 114 | [sym_attribute] = "attribute", 115 | [sym_ns_decl] = "ns_decl", 116 | [sym_xml_attr] = "xml_attr", 117 | [sym_attr_value] = "attr_value", 118 | [sym_xml_decl] = "xml_decl", 119 | [sym_xml_version] = "xml_version", 120 | [sym_xml_version_value] = "xml_version_value", 121 | [sym_xml_encoding] = "xml_encoding", 122 | [sym_xml_encoding_value] = "xml_encoding_value", 123 | [sym_comment] = "comment", 124 | [sym_cdata_sect] = "cdata_sect", 125 | [sym_cdata] = "cdata", 126 | [sym__ref] = "_ref", 127 | [sym_entity_ref] = "entity_ref", 128 | [sym__misc] = "_misc", 129 | [sym__quote] = "_quote", 130 | [aux_sym_xml_file_repeat1] = "xml_file_repeat1", 131 | [aux_sym_pi_repeat1] = "pi_repeat1", 132 | [aux_sym_empty_element_repeat1] = "empty_element_repeat1", 133 | [aux_sym_attr_value_repeat1] = "attr_value_repeat1", 134 | }; 135 | 136 | static const TSSymbol ts_symbol_map[] = { 137 | [ts_builtin_sym_end] = ts_builtin_sym_end, 138 | [anon_sym_LT_QMARK] = anon_sym_LT_QMARK, 139 | [anon_sym_QMARK_GT] = anon_sym_QMARK_GT, 140 | [anon_sym_LT] = anon_sym_LT, 141 | [anon_sym_SLASH] = anon_sym_SLASH, 142 | [anon_sym_GT] = anon_sym_GT, 143 | [anon_sym_xmlns] = anon_sym_xmlns, 144 | [anon_sym_COLON] = anon_sym_COLON, 145 | [aux_sym_attr_value_token1] = aux_sym_attr_value_token1, 146 | [anon_sym_xml] = anon_sym_xml, 147 | [anon_sym_version] = anon_sym_version, 148 | [anon_sym_encoding] = anon_sym_encoding, 149 | [sym_name] = sym_name, 150 | [anon_sym_LT_BANG_DASH_DASH] = anon_sym_LT_BANG_DASH_DASH, 151 | [anon_sym_DASH_DASH_GT] = anon_sym_DASH_DASH_GT, 152 | [sym_char_data] = sym_char_data, 153 | [sym_char_ref] = sym_char_ref, 154 | [sym_cdata_start] = sym_cdata_start, 155 | [sym_cdata_end] = sym_cdata_end, 156 | [anon_sym_AMP] = anon_sym_AMP, 157 | [anon_sym_SEMI] = anon_sym_SEMI, 158 | [sym_eq] = sym_eq, 159 | [sym__char] = sym__char, 160 | [sym__ws] = sym__ws, 161 | [anon_sym_DQUOTE] = anon_sym_DQUOTE, 162 | [anon_sym_SQUOTE] = anon_sym_SQUOTE, 163 | [sym__dec_num] = sym__dec_num, 164 | [sym__encoding] = sym__encoding, 165 | [sym_xml_file] = sym_xml_file, 166 | [sym_pi] = sym_pi, 167 | [sym_element] = sym_element, 168 | [sym_end_tag_element] = sym_end_tag_element, 169 | [sym_empty_element] = sym_empty_element, 170 | [sym_tag_start] = sym_tag_start, 171 | [sym_tag_end] = sym_tag_end, 172 | [aux_sym__content] = aux_sym__content, 173 | [sym_attribute] = sym_attribute, 174 | [sym_ns_decl] = sym_ns_decl, 175 | [sym_xml_attr] = sym_xml_attr, 176 | [sym_attr_value] = sym_attr_value, 177 | [sym_xml_decl] = sym_xml_decl, 178 | [sym_xml_version] = sym_xml_version, 179 | [sym_xml_version_value] = sym_xml_version_value, 180 | [sym_xml_encoding] = sym_xml_encoding, 181 | [sym_xml_encoding_value] = sym_xml_encoding_value, 182 | [sym_comment] = sym_comment, 183 | [sym_cdata_sect] = sym_cdata_sect, 184 | [sym_cdata] = sym_cdata, 185 | [sym__ref] = sym__ref, 186 | [sym_entity_ref] = sym_entity_ref, 187 | [sym__misc] = sym__misc, 188 | [sym__quote] = sym__quote, 189 | [aux_sym_xml_file_repeat1] = aux_sym_xml_file_repeat1, 190 | [aux_sym_pi_repeat1] = aux_sym_pi_repeat1, 191 | [aux_sym_empty_element_repeat1] = aux_sym_empty_element_repeat1, 192 | [aux_sym_attr_value_repeat1] = aux_sym_attr_value_repeat1, 193 | }; 194 | 195 | static const TSSymbolMetadata ts_symbol_metadata[] = { 196 | [ts_builtin_sym_end] = { 197 | .visible = false, 198 | .named = true, 199 | }, 200 | [anon_sym_LT_QMARK] = { 201 | .visible = true, 202 | .named = false, 203 | }, 204 | [anon_sym_QMARK_GT] = { 205 | .visible = true, 206 | .named = false, 207 | }, 208 | [anon_sym_LT] = { 209 | .visible = true, 210 | .named = false, 211 | }, 212 | [anon_sym_SLASH] = { 213 | .visible = true, 214 | .named = false, 215 | }, 216 | [anon_sym_GT] = { 217 | .visible = true, 218 | .named = false, 219 | }, 220 | [anon_sym_xmlns] = { 221 | .visible = true, 222 | .named = false, 223 | }, 224 | [anon_sym_COLON] = { 225 | .visible = true, 226 | .named = false, 227 | }, 228 | [aux_sym_attr_value_token1] = { 229 | .visible = false, 230 | .named = false, 231 | }, 232 | [anon_sym_xml] = { 233 | .visible = true, 234 | .named = false, 235 | }, 236 | [anon_sym_version] = { 237 | .visible = true, 238 | .named = false, 239 | }, 240 | [anon_sym_encoding] = { 241 | .visible = true, 242 | .named = false, 243 | }, 244 | [sym_name] = { 245 | .visible = true, 246 | .named = true, 247 | }, 248 | [anon_sym_LT_BANG_DASH_DASH] = { 249 | .visible = true, 250 | .named = false, 251 | }, 252 | [anon_sym_DASH_DASH_GT] = { 253 | .visible = true, 254 | .named = false, 255 | }, 256 | [sym_char_data] = { 257 | .visible = true, 258 | .named = true, 259 | }, 260 | [sym_char_ref] = { 261 | .visible = true, 262 | .named = true, 263 | }, 264 | [sym_cdata_start] = { 265 | .visible = true, 266 | .named = true, 267 | }, 268 | [sym_cdata_end] = { 269 | .visible = true, 270 | .named = true, 271 | }, 272 | [anon_sym_AMP] = { 273 | .visible = true, 274 | .named = false, 275 | }, 276 | [anon_sym_SEMI] = { 277 | .visible = true, 278 | .named = false, 279 | }, 280 | [sym_eq] = { 281 | .visible = true, 282 | .named = true, 283 | }, 284 | [sym__char] = { 285 | .visible = false, 286 | .named = true, 287 | }, 288 | [sym__ws] = { 289 | .visible = false, 290 | .named = true, 291 | }, 292 | [anon_sym_DQUOTE] = { 293 | .visible = true, 294 | .named = false, 295 | }, 296 | [anon_sym_SQUOTE] = { 297 | .visible = true, 298 | .named = false, 299 | }, 300 | [sym__dec_num] = { 301 | .visible = false, 302 | .named = true, 303 | }, 304 | [sym__encoding] = { 305 | .visible = false, 306 | .named = true, 307 | }, 308 | [sym_xml_file] = { 309 | .visible = true, 310 | .named = true, 311 | }, 312 | [sym_pi] = { 313 | .visible = true, 314 | .named = true, 315 | }, 316 | [sym_element] = { 317 | .visible = true, 318 | .named = true, 319 | }, 320 | [sym_end_tag_element] = { 321 | .visible = true, 322 | .named = true, 323 | }, 324 | [sym_empty_element] = { 325 | .visible = true, 326 | .named = true, 327 | }, 328 | [sym_tag_start] = { 329 | .visible = true, 330 | .named = true, 331 | }, 332 | [sym_tag_end] = { 333 | .visible = true, 334 | .named = true, 335 | }, 336 | [aux_sym__content] = { 337 | .visible = false, 338 | .named = false, 339 | }, 340 | [sym_attribute] = { 341 | .visible = true, 342 | .named = true, 343 | }, 344 | [sym_ns_decl] = { 345 | .visible = true, 346 | .named = true, 347 | }, 348 | [sym_xml_attr] = { 349 | .visible = true, 350 | .named = true, 351 | }, 352 | [sym_attr_value] = { 353 | .visible = true, 354 | .named = true, 355 | }, 356 | [sym_xml_decl] = { 357 | .visible = true, 358 | .named = true, 359 | }, 360 | [sym_xml_version] = { 361 | .visible = true, 362 | .named = true, 363 | }, 364 | [sym_xml_version_value] = { 365 | .visible = true, 366 | .named = true, 367 | }, 368 | [sym_xml_encoding] = { 369 | .visible = true, 370 | .named = true, 371 | }, 372 | [sym_xml_encoding_value] = { 373 | .visible = true, 374 | .named = true, 375 | }, 376 | [sym_comment] = { 377 | .visible = true, 378 | .named = true, 379 | }, 380 | [sym_cdata_sect] = { 381 | .visible = true, 382 | .named = true, 383 | }, 384 | [sym_cdata] = { 385 | .visible = true, 386 | .named = true, 387 | }, 388 | [sym__ref] = { 389 | .visible = false, 390 | .named = true, 391 | }, 392 | [sym_entity_ref] = { 393 | .visible = true, 394 | .named = true, 395 | }, 396 | [sym__misc] = { 397 | .visible = false, 398 | .named = true, 399 | }, 400 | [sym__quote] = { 401 | .visible = false, 402 | .named = true, 403 | }, 404 | [aux_sym_xml_file_repeat1] = { 405 | .visible = false, 406 | .named = false, 407 | }, 408 | [aux_sym_pi_repeat1] = { 409 | .visible = false, 410 | .named = false, 411 | }, 412 | [aux_sym_empty_element_repeat1] = { 413 | .visible = false, 414 | .named = false, 415 | }, 416 | [aux_sym_attr_value_repeat1] = { 417 | .visible = false, 418 | .named = false, 419 | }, 420 | }; 421 | 422 | enum { 423 | field_attr_name = 1, 424 | field_decl = 2, 425 | field_encoding_attr = 3, 426 | field_ns_prefix = 4, 427 | field_tag_name = 5, 428 | field_version_attr = 6, 429 | field_xmlns_prefix = 7, 430 | }; 431 | 432 | static const char * const ts_field_names[] = { 433 | [0] = NULL, 434 | [field_attr_name] = "attr_name", 435 | [field_decl] = "decl", 436 | [field_encoding_attr] = "encoding_attr", 437 | [field_ns_prefix] = "ns_prefix", 438 | [field_tag_name] = "tag_name", 439 | [field_version_attr] = "version_attr", 440 | [field_xmlns_prefix] = "xmlns_prefix", 441 | }; 442 | 443 | static const TSFieldMapSlice ts_field_map_slices[PRODUCTION_ID_COUNT] = { 444 | [1] = {.index = 0, .length = 1}, 445 | [2] = {.index = 1, .length = 1}, 446 | [3] = {.index = 2, .length = 1}, 447 | [4] = {.index = 3, .length = 1}, 448 | [5] = {.index = 4, .length = 1}, 449 | [6] = {.index = 5, .length = 1}, 450 | [7] = {.index = 6, .length = 1}, 451 | [8] = {.index = 7, .length = 2}, 452 | }; 453 | 454 | static const TSFieldMapEntry ts_field_map_entries[] = { 455 | [0] = 456 | {field_tag_name, 1}, 457 | [1] = 458 | {field_decl, 1}, 459 | [2] = 460 | {field_tag_name, 2}, 461 | [3] = 462 | {field_version_attr, 1}, 463 | [4] = 464 | {field_attr_name, 0}, 465 | [5] = 466 | {field_encoding_attr, 1}, 467 | [6] = 468 | {field_xmlns_prefix, 2}, 469 | [7] = 470 | {field_attr_name, 2}, 471 | {field_ns_prefix, 0}, 472 | }; 473 | 474 | static const TSSymbol ts_alias_sequences[PRODUCTION_ID_COUNT][MAX_ALIAS_SEQUENCE_LENGTH] = { 475 | [0] = {0}, 476 | }; 477 | 478 | static const uint16_t ts_non_terminal_alias_map[] = { 479 | 0, 480 | }; 481 | 482 | static const TSStateId ts_primary_state_ids[STATE_COUNT] = { 483 | [0] = 0, 484 | [1] = 1, 485 | [2] = 2, 486 | [3] = 2, 487 | [4] = 4, 488 | [5] = 5, 489 | [6] = 6, 490 | [7] = 4, 491 | [8] = 6, 492 | [9] = 5, 493 | [10] = 10, 494 | [11] = 11, 495 | [12] = 12, 496 | [13] = 13, 497 | [14] = 14, 498 | [15] = 15, 499 | [16] = 16, 500 | [17] = 17, 501 | [18] = 18, 502 | [19] = 19, 503 | [20] = 20, 504 | [21] = 21, 505 | [22] = 22, 506 | [23] = 23, 507 | [24] = 24, 508 | [25] = 25, 509 | [26] = 26, 510 | [27] = 27, 511 | [28] = 28, 512 | [29] = 29, 513 | [30] = 30, 514 | [31] = 31, 515 | [32] = 32, 516 | [33] = 33, 517 | [34] = 34, 518 | [35] = 35, 519 | [36] = 36, 520 | [37] = 37, 521 | [38] = 38, 522 | [39] = 39, 523 | [40] = 40, 524 | [41] = 26, 525 | [42] = 31, 526 | [43] = 43, 527 | [44] = 44, 528 | [45] = 45, 529 | [46] = 46, 530 | [47] = 43, 531 | [48] = 34, 532 | [49] = 27, 533 | [50] = 36, 534 | [51] = 24, 535 | [52] = 52, 536 | [53] = 30, 537 | [54] = 40, 538 | [55] = 55, 539 | [56] = 56, 540 | [57] = 23, 541 | [58] = 29, 542 | [59] = 22, 543 | [60] = 19, 544 | [61] = 33, 545 | [62] = 21, 546 | [63] = 63, 547 | [64] = 28, 548 | [65] = 20, 549 | [66] = 66, 550 | [67] = 67, 551 | [68] = 68, 552 | [69] = 69, 553 | [70] = 70, 554 | [71] = 71, 555 | [72] = 69, 556 | [73] = 73, 557 | [74] = 71, 558 | [75] = 70, 559 | [76] = 76, 560 | [77] = 77, 561 | [78] = 71, 562 | [79] = 79, 563 | [80] = 76, 564 | [81] = 81, 565 | [82] = 73, 566 | [83] = 83, 567 | [84] = 77, 568 | [85] = 85, 569 | [86] = 68, 570 | [87] = 87, 571 | [88] = 88, 572 | [89] = 89, 573 | [90] = 90, 574 | [91] = 91, 575 | [92] = 92, 576 | [93] = 93, 577 | [94] = 94, 578 | [95] = 89, 579 | [96] = 96, 580 | [97] = 97, 581 | [98] = 98, 582 | [99] = 99, 583 | [100] = 100, 584 | [101] = 101, 585 | [102] = 102, 586 | [103] = 103, 587 | [104] = 104, 588 | [105] = 105, 589 | [106] = 106, 590 | [107] = 107, 591 | [108] = 108, 592 | [109] = 109, 593 | [110] = 110, 594 | [111] = 111, 595 | [112] = 112, 596 | [113] = 113, 597 | [114] = 114, 598 | [115] = 115, 599 | [116] = 116, 600 | [117] = 117, 601 | [118] = 118, 602 | [119] = 119, 603 | [120] = 120, 604 | [121] = 121, 605 | [122] = 122, 606 | [123] = 123, 607 | [124] = 109, 608 | [125] = 107, 609 | [126] = 126, 610 | [127] = 127, 611 | [128] = 108, 612 | [129] = 129, 613 | [130] = 130, 614 | [131] = 121, 615 | [132] = 112, 616 | [133] = 129, 617 | [134] = 106, 618 | [135] = 135, 619 | [136] = 118, 620 | [137] = 114, 621 | [138] = 138, 622 | [139] = 139, 623 | [140] = 104, 624 | [141] = 141, 625 | [142] = 141, 626 | [143] = 143, 627 | }; 628 | 629 | static bool ts_lex(TSLexer *lexer, TSStateId state) { 630 | START_LEXER(); 631 | eof = lexer->eof(lexer); 632 | switch (state) { 633 | case 0: 634 | if (eof) ADVANCE(44); 635 | if (lookahead == '\n') ADVANCE(52); 636 | if (lookahead == '"') ADVANCE(100); 637 | if (lookahead == '&') ADVANCE(91); 638 | if (lookahead == '\'') ADVANCE(101); 639 | if (lookahead == '-') ADVANCE(53); 640 | if (lookahead == '/') ADVANCE(48); 641 | if (lookahead == ':') ADVANCE(51); 642 | if (lookahead == ';') ADVANCE(92); 643 | if (lookahead == '<') ADVANCE(47); 644 | if (lookahead == '=') ADVANCE(93); 645 | if (lookahead == '>') ADVANCE(49); 646 | if (lookahead == '?') ADVANCE(55); 647 | if (lookahead == ']') ADVANCE(56); 648 | if (lookahead == '_') ADVANCE(60); 649 | if (lookahead == 'e') ADVANCE(59); 650 | if (lookahead == 'v') ADVANCE(57); 651 | if (lookahead == 'x') ADVANCE(58); 652 | if (lookahead == '\t' || 653 | lookahead == '\r' || 654 | lookahead == ' ') ADVANCE(52); 655 | if (('0' <= lookahead && lookahead <= '9')) ADVANCE(54); 656 | if (('A' <= lookahead && lookahead <= 'Z') || 657 | ('a' <= lookahead && lookahead <= 'z')) ADVANCE(60); 658 | if (lookahead != 0) ADVANCE(52); 659 | END_STATE(); 660 | case 1: 661 | if (lookahead == '\n') ADVANCE(99); 662 | if (lookahead == '-') ADVANCE(96); 663 | if (lookahead == '\t' || 664 | lookahead == '\r' || 665 | lookahead == ' ') ADVANCE(94); 666 | if (lookahead != 0) ADVANCE(94); 667 | END_STATE(); 668 | case 2: 669 | if (lookahead == '\n') ADVANCE(99); 670 | if (lookahead == '?') ADVANCE(97); 671 | if (lookahead == '\t' || 672 | lookahead == '\r' || 673 | lookahead == ' ') ADVANCE(94); 674 | if (lookahead != 0) ADVANCE(94); 675 | END_STATE(); 676 | case 3: 677 | if (lookahead == '\n') ADVANCE(99); 678 | if (lookahead == ']') ADVANCE(98); 679 | if (lookahead == '\t' || 680 | lookahead == '\r' || 681 | lookahead == ' ') ADVANCE(94); 682 | if (lookahead != 0) ADVANCE(94); 683 | END_STATE(); 684 | case 4: 685 | if (lookahead == '"') ADVANCE(100); 686 | if (lookahead == '&') ADVANCE(91); 687 | if (lookahead == '\'') ADVANCE(101); 688 | if (lookahead == '\t' || 689 | lookahead == '\n' || 690 | lookahead == '\r' || 691 | lookahead == ' ') ADVANCE(52); 692 | if (lookahead != 0 && 693 | lookahead != '<') ADVANCE(52); 694 | END_STATE(); 695 | case 5: 696 | if (lookahead == '"') ADVANCE(100); 697 | if (lookahead == '\'') ADVANCE(101); 698 | if (lookahead == '/') ADVANCE(48); 699 | if (lookahead == ':') ADVANCE(51); 700 | if (lookahead == ';') ADVANCE(92); 701 | if (lookahead == '=') ADVANCE(93); 702 | if (lookahead == '>') ADVANCE(49); 703 | if (lookahead == '?') ADVANCE(13); 704 | if (lookahead == ']') ADVANCE(23); 705 | if (lookahead == 'x') ADVANCE(74); 706 | if (lookahead == '\t' || 707 | lookahead == '\n' || 708 | lookahead == '\r' || 709 | lookahead == ' ') ADVANCE(99); 710 | if (('0' <= lookahead && lookahead <= '9')) ADVANCE(9); 711 | if (('A' <= lookahead && lookahead <= 'Z') || 712 | lookahead == '_' || 713 | ('a' <= lookahead && lookahead <= 'z')) ADVANCE(83); 714 | END_STATE(); 715 | case 6: 716 | if (lookahead == '-') ADVANCE(8); 717 | END_STATE(); 718 | case 7: 719 | if (lookahead == '-') ADVANCE(8); 720 | if (lookahead == '[') ADVANCE(19); 721 | END_STATE(); 722 | case 8: 723 | if (lookahead == '-') ADVANCE(84); 724 | END_STATE(); 725 | case 9: 726 | if (lookahead == '.') ADVANCE(41); 727 | if (('0' <= lookahead && lookahead <= '9')) ADVANCE(9); 728 | END_STATE(); 729 | case 10: 730 | if (lookahead == '/') ADVANCE(48); 731 | if (lookahead == '\t' || 732 | lookahead == '\n' || 733 | lookahead == '\r' || 734 | lookahead == ' ') ADVANCE(99); 735 | if (('A' <= lookahead && lookahead <= 'Z') || 736 | lookahead == '_' || 737 | ('a' <= lookahead && lookahead <= 'z')) ADVANCE(83); 738 | END_STATE(); 739 | case 11: 740 | if (lookahead == ';') ADVANCE(88); 741 | if (('0' <= lookahead && lookahead <= '9')) ADVANCE(11); 742 | END_STATE(); 743 | case 12: 744 | if (lookahead == ';') ADVANCE(88); 745 | if (('0' <= lookahead && lookahead <= '9') || 746 | ('A' <= lookahead && lookahead <= 'F') || 747 | ('a' <= lookahead && lookahead <= 'f')) ADVANCE(12); 748 | END_STATE(); 749 | case 13: 750 | if (lookahead == '>') ADVANCE(46); 751 | END_STATE(); 752 | case 14: 753 | if (lookahead == '>') ADVANCE(85); 754 | END_STATE(); 755 | case 15: 756 | if (lookahead == '>') ADVANCE(90); 757 | END_STATE(); 758 | case 16: 759 | if (lookahead == '?') ADVANCE(13); 760 | if (lookahead == 'e') ADVANCE(32); 761 | if (lookahead == 'v') ADVANCE(26); 762 | if (lookahead == 'x') ADVANCE(31); 763 | if (lookahead == '\t' || 764 | lookahead == '\n' || 765 | lookahead == '\r' || 766 | lookahead == ' ') ADVANCE(99); 767 | END_STATE(); 768 | case 17: 769 | if (lookahead == 'A') ADVANCE(21); 770 | END_STATE(); 771 | case 18: 772 | if (lookahead == 'A') ADVANCE(22); 773 | END_STATE(); 774 | case 19: 775 | if (lookahead == 'C') ADVANCE(20); 776 | END_STATE(); 777 | case 20: 778 | if (lookahead == 'D') ADVANCE(17); 779 | END_STATE(); 780 | case 21: 781 | if (lookahead == 'T') ADVANCE(18); 782 | END_STATE(); 783 | case 22: 784 | if (lookahead == '[') ADVANCE(89); 785 | END_STATE(); 786 | case 23: 787 | if (lookahead == ']') ADVANCE(15); 788 | END_STATE(); 789 | case 24: 790 | if (lookahead == 'c') ADVANCE(35); 791 | END_STATE(); 792 | case 25: 793 | if (lookahead == 'd') ADVANCE(28); 794 | END_STATE(); 795 | case 26: 796 | if (lookahead == 'e') ADVANCE(37); 797 | END_STATE(); 798 | case 27: 799 | if (lookahead == 'g') ADVANCE(65); 800 | END_STATE(); 801 | case 28: 802 | if (lookahead == 'i') ADVANCE(33); 803 | END_STATE(); 804 | case 29: 805 | if (lookahead == 'i') ADVANCE(36); 806 | END_STATE(); 807 | case 30: 808 | if (lookahead == 'l') ADVANCE(61); 809 | END_STATE(); 810 | case 31: 811 | if (lookahead == 'm') ADVANCE(30); 812 | END_STATE(); 813 | case 32: 814 | if (lookahead == 'n') ADVANCE(24); 815 | END_STATE(); 816 | case 33: 817 | if (lookahead == 'n') ADVANCE(27); 818 | END_STATE(); 819 | case 34: 820 | if (lookahead == 'n') ADVANCE(63); 821 | END_STATE(); 822 | case 35: 823 | if (lookahead == 'o') ADVANCE(25); 824 | END_STATE(); 825 | case 36: 826 | if (lookahead == 'o') ADVANCE(34); 827 | END_STATE(); 828 | case 37: 829 | if (lookahead == 'r') ADVANCE(38); 830 | END_STATE(); 831 | case 38: 832 | if (lookahead == 's') ADVANCE(29); 833 | END_STATE(); 834 | case 39: 835 | if (lookahead == 'x') ADVANCE(42); 836 | if (('0' <= lookahead && lookahead <= '9')) ADVANCE(11); 837 | END_STATE(); 838 | case 40: 839 | if (lookahead == '\t' || 840 | lookahead == '\n' || 841 | lookahead == '\r' || 842 | lookahead == ' ') ADVANCE(99); 843 | if (('A' <= lookahead && lookahead <= 'Z') || 844 | ('a' <= lookahead && lookahead <= 'z')) ADVANCE(103); 845 | END_STATE(); 846 | case 41: 847 | if (('0' <= lookahead && lookahead <= '9')) ADVANCE(102); 848 | END_STATE(); 849 | case 42: 850 | if (('0' <= lookahead && lookahead <= '9') || 851 | ('A' <= lookahead && lookahead <= 'F') || 852 | ('a' <= lookahead && lookahead <= 'f')) ADVANCE(12); 853 | END_STATE(); 854 | case 43: 855 | if (eof) ADVANCE(44); 856 | if (lookahead == '\n') ADVANCE(99); 857 | if (lookahead == '<') ADVANCE(95); 858 | if (lookahead == '\t' || 859 | lookahead == '\r' || 860 | lookahead == ' ') ADVANCE(94); 861 | if (lookahead != 0) ADVANCE(94); 862 | END_STATE(); 863 | case 44: 864 | ACCEPT_TOKEN(ts_builtin_sym_end); 865 | END_STATE(); 866 | case 45: 867 | ACCEPT_TOKEN(anon_sym_LT_QMARK); 868 | END_STATE(); 869 | case 46: 870 | ACCEPT_TOKEN(anon_sym_QMARK_GT); 871 | END_STATE(); 872 | case 47: 873 | ACCEPT_TOKEN(anon_sym_LT); 874 | if (lookahead == '!') ADVANCE(7); 875 | if (lookahead == '?') ADVANCE(45); 876 | END_STATE(); 877 | case 48: 878 | ACCEPT_TOKEN(anon_sym_SLASH); 879 | END_STATE(); 880 | case 49: 881 | ACCEPT_TOKEN(anon_sym_GT); 882 | END_STATE(); 883 | case 50: 884 | ACCEPT_TOKEN(anon_sym_xmlns); 885 | if (lookahead == '-' || 886 | lookahead == '.' || 887 | ('0' <= lookahead && lookahead <= '9') || 888 | ('A' <= lookahead && lookahead <= 'Z') || 889 | lookahead == '_' || 890 | ('a' <= lookahead && lookahead <= 'z')) ADVANCE(83); 891 | END_STATE(); 892 | case 51: 893 | ACCEPT_TOKEN(anon_sym_COLON); 894 | END_STATE(); 895 | case 52: 896 | ACCEPT_TOKEN(aux_sym_attr_value_token1); 897 | END_STATE(); 898 | case 53: 899 | ACCEPT_TOKEN(aux_sym_attr_value_token1); 900 | if (lookahead == '-') ADVANCE(14); 901 | END_STATE(); 902 | case 54: 903 | ACCEPT_TOKEN(aux_sym_attr_value_token1); 904 | if (lookahead == '.') ADVANCE(41); 905 | if (('0' <= lookahead && lookahead <= '9')) ADVANCE(9); 906 | END_STATE(); 907 | case 55: 908 | ACCEPT_TOKEN(aux_sym_attr_value_token1); 909 | if (lookahead == '>') ADVANCE(46); 910 | END_STATE(); 911 | case 56: 912 | ACCEPT_TOKEN(aux_sym_attr_value_token1); 913 | if (lookahead == ']') ADVANCE(15); 914 | END_STATE(); 915 | case 57: 916 | ACCEPT_TOKEN(aux_sym_attr_value_token1); 917 | if (lookahead == 'e') ADVANCE(80); 918 | if (lookahead == '-' || 919 | lookahead == '.' || 920 | ('0' <= lookahead && lookahead <= '9') || 921 | ('A' <= lookahead && lookahead <= 'Z') || 922 | lookahead == '_' || 923 | ('a' <= lookahead && lookahead <= 'z')) ADVANCE(83); 924 | END_STATE(); 925 | case 58: 926 | ACCEPT_TOKEN(aux_sym_attr_value_token1); 927 | if (lookahead == 'm') ADVANCE(72); 928 | if (lookahead == '-' || 929 | lookahead == '.' || 930 | ('0' <= lookahead && lookahead <= '9') || 931 | ('A' <= lookahead && lookahead <= 'Z') || 932 | lookahead == '_' || 933 | ('a' <= lookahead && lookahead <= 'z')) ADVANCE(83); 934 | END_STATE(); 935 | case 59: 936 | ACCEPT_TOKEN(aux_sym_attr_value_token1); 937 | if (lookahead == 'n') ADVANCE(67); 938 | if (lookahead == '-' || 939 | lookahead == '.' || 940 | ('0' <= lookahead && lookahead <= '9') || 941 | ('A' <= lookahead && lookahead <= 'Z') || 942 | lookahead == '_' || 943 | ('a' <= lookahead && lookahead <= 'z')) ADVANCE(83); 944 | END_STATE(); 945 | case 60: 946 | ACCEPT_TOKEN(aux_sym_attr_value_token1); 947 | if (lookahead == '-' || 948 | lookahead == '.' || 949 | ('0' <= lookahead && lookahead <= '9') || 950 | ('A' <= lookahead && lookahead <= 'Z') || 951 | lookahead == '_' || 952 | ('a' <= lookahead && lookahead <= 'z')) ADVANCE(83); 953 | END_STATE(); 954 | case 61: 955 | ACCEPT_TOKEN(anon_sym_xml); 956 | END_STATE(); 957 | case 62: 958 | ACCEPT_TOKEN(anon_sym_xml); 959 | if (lookahead == 'n') ADVANCE(82); 960 | if (lookahead == '-' || 961 | lookahead == '.' || 962 | ('0' <= lookahead && lookahead <= '9') || 963 | ('A' <= lookahead && lookahead <= 'Z') || 964 | lookahead == '_' || 965 | ('a' <= lookahead && lookahead <= 'z')) ADVANCE(83); 966 | END_STATE(); 967 | case 63: 968 | ACCEPT_TOKEN(anon_sym_version); 969 | END_STATE(); 970 | case 64: 971 | ACCEPT_TOKEN(anon_sym_version); 972 | if (lookahead == '-' || 973 | lookahead == '.' || 974 | ('0' <= lookahead && lookahead <= '9') || 975 | ('A' <= lookahead && lookahead <= 'Z') || 976 | lookahead == '_' || 977 | ('a' <= lookahead && lookahead <= 'z')) ADVANCE(83); 978 | END_STATE(); 979 | case 65: 980 | ACCEPT_TOKEN(anon_sym_encoding); 981 | END_STATE(); 982 | case 66: 983 | ACCEPT_TOKEN(anon_sym_encoding); 984 | if (lookahead == '-' || 985 | lookahead == '.' || 986 | ('0' <= lookahead && lookahead <= '9') || 987 | ('A' <= lookahead && lookahead <= 'Z') || 988 | lookahead == '_' || 989 | ('a' <= lookahead && lookahead <= 'z')) ADVANCE(83); 990 | END_STATE(); 991 | case 67: 992 | ACCEPT_TOKEN(sym_name); 993 | if (lookahead == 'c') ADVANCE(78); 994 | if (lookahead == '-' || 995 | lookahead == '.' || 996 | ('0' <= lookahead && lookahead <= '9') || 997 | ('A' <= lookahead && lookahead <= 'Z') || 998 | lookahead == '_' || 999 | ('a' <= lookahead && lookahead <= 'z')) ADVANCE(83); 1000 | END_STATE(); 1001 | case 68: 1002 | ACCEPT_TOKEN(sym_name); 1003 | if (lookahead == 'd') ADVANCE(70); 1004 | if (lookahead == '-' || 1005 | lookahead == '.' || 1006 | ('0' <= lookahead && lookahead <= '9') || 1007 | ('A' <= lookahead && lookahead <= 'Z') || 1008 | lookahead == '_' || 1009 | ('a' <= lookahead && lookahead <= 'z')) ADVANCE(83); 1010 | END_STATE(); 1011 | case 69: 1012 | ACCEPT_TOKEN(sym_name); 1013 | if (lookahead == 'g') ADVANCE(66); 1014 | if (lookahead == '-' || 1015 | lookahead == '.' || 1016 | ('0' <= lookahead && lookahead <= '9') || 1017 | ('A' <= lookahead && lookahead <= 'Z') || 1018 | lookahead == '_' || 1019 | ('a' <= lookahead && lookahead <= 'z')) ADVANCE(83); 1020 | END_STATE(); 1021 | case 70: 1022 | ACCEPT_TOKEN(sym_name); 1023 | if (lookahead == 'i') ADVANCE(75); 1024 | if (lookahead == '-' || 1025 | lookahead == '.' || 1026 | ('0' <= lookahead && lookahead <= '9') || 1027 | ('A' <= lookahead && lookahead <= 'Z') || 1028 | lookahead == '_' || 1029 | ('a' <= lookahead && lookahead <= 'z')) ADVANCE(83); 1030 | END_STATE(); 1031 | case 71: 1032 | ACCEPT_TOKEN(sym_name); 1033 | if (lookahead == 'i') ADVANCE(79); 1034 | if (lookahead == '-' || 1035 | lookahead == '.' || 1036 | ('0' <= lookahead && lookahead <= '9') || 1037 | ('A' <= lookahead && lookahead <= 'Z') || 1038 | lookahead == '_' || 1039 | ('a' <= lookahead && lookahead <= 'z')) ADVANCE(83); 1040 | END_STATE(); 1041 | case 72: 1042 | ACCEPT_TOKEN(sym_name); 1043 | if (lookahead == 'l') ADVANCE(62); 1044 | if (lookahead == '-' || 1045 | lookahead == '.' || 1046 | ('0' <= lookahead && lookahead <= '9') || 1047 | ('A' <= lookahead && lookahead <= 'Z') || 1048 | lookahead == '_' || 1049 | ('a' <= lookahead && lookahead <= 'z')) ADVANCE(83); 1050 | END_STATE(); 1051 | case 73: 1052 | ACCEPT_TOKEN(sym_name); 1053 | if (lookahead == 'l') ADVANCE(77); 1054 | if (lookahead == '-' || 1055 | lookahead == '.' || 1056 | ('0' <= lookahead && lookahead <= '9') || 1057 | ('A' <= lookahead && lookahead <= 'Z') || 1058 | lookahead == '_' || 1059 | ('a' <= lookahead && lookahead <= 'z')) ADVANCE(83); 1060 | END_STATE(); 1061 | case 74: 1062 | ACCEPT_TOKEN(sym_name); 1063 | if (lookahead == 'm') ADVANCE(73); 1064 | if (lookahead == '-' || 1065 | lookahead == '.' || 1066 | ('0' <= lookahead && lookahead <= '9') || 1067 | ('A' <= lookahead && lookahead <= 'Z') || 1068 | lookahead == '_' || 1069 | ('a' <= lookahead && lookahead <= 'z')) ADVANCE(83); 1070 | END_STATE(); 1071 | case 75: 1072 | ACCEPT_TOKEN(sym_name); 1073 | if (lookahead == 'n') ADVANCE(69); 1074 | if (lookahead == '-' || 1075 | lookahead == '.' || 1076 | ('0' <= lookahead && lookahead <= '9') || 1077 | ('A' <= lookahead && lookahead <= 'Z') || 1078 | lookahead == '_' || 1079 | ('a' <= lookahead && lookahead <= 'z')) ADVANCE(83); 1080 | END_STATE(); 1081 | case 76: 1082 | ACCEPT_TOKEN(sym_name); 1083 | if (lookahead == 'n') ADVANCE(64); 1084 | if (lookahead == '-' || 1085 | lookahead == '.' || 1086 | ('0' <= lookahead && lookahead <= '9') || 1087 | ('A' <= lookahead && lookahead <= 'Z') || 1088 | lookahead == '_' || 1089 | ('a' <= lookahead && lookahead <= 'z')) ADVANCE(83); 1090 | END_STATE(); 1091 | case 77: 1092 | ACCEPT_TOKEN(sym_name); 1093 | if (lookahead == 'n') ADVANCE(82); 1094 | if (lookahead == '-' || 1095 | lookahead == '.' || 1096 | ('0' <= lookahead && lookahead <= '9') || 1097 | ('A' <= lookahead && lookahead <= 'Z') || 1098 | lookahead == '_' || 1099 | ('a' <= lookahead && lookahead <= 'z')) ADVANCE(83); 1100 | END_STATE(); 1101 | case 78: 1102 | ACCEPT_TOKEN(sym_name); 1103 | if (lookahead == 'o') ADVANCE(68); 1104 | if (lookahead == '-' || 1105 | lookahead == '.' || 1106 | ('0' <= lookahead && lookahead <= '9') || 1107 | ('A' <= lookahead && lookahead <= 'Z') || 1108 | lookahead == '_' || 1109 | ('a' <= lookahead && lookahead <= 'z')) ADVANCE(83); 1110 | END_STATE(); 1111 | case 79: 1112 | ACCEPT_TOKEN(sym_name); 1113 | if (lookahead == 'o') ADVANCE(76); 1114 | if (lookahead == '-' || 1115 | lookahead == '.' || 1116 | ('0' <= lookahead && lookahead <= '9') || 1117 | ('A' <= lookahead && lookahead <= 'Z') || 1118 | lookahead == '_' || 1119 | ('a' <= lookahead && lookahead <= 'z')) ADVANCE(83); 1120 | END_STATE(); 1121 | case 80: 1122 | ACCEPT_TOKEN(sym_name); 1123 | if (lookahead == 'r') ADVANCE(81); 1124 | if (lookahead == '-' || 1125 | lookahead == '.' || 1126 | ('0' <= lookahead && lookahead <= '9') || 1127 | ('A' <= lookahead && lookahead <= 'Z') || 1128 | lookahead == '_' || 1129 | ('a' <= lookahead && lookahead <= 'z')) ADVANCE(83); 1130 | END_STATE(); 1131 | case 81: 1132 | ACCEPT_TOKEN(sym_name); 1133 | if (lookahead == 's') ADVANCE(71); 1134 | if (lookahead == '-' || 1135 | lookahead == '.' || 1136 | ('0' <= lookahead && lookahead <= '9') || 1137 | ('A' <= lookahead && lookahead <= 'Z') || 1138 | lookahead == '_' || 1139 | ('a' <= lookahead && lookahead <= 'z')) ADVANCE(83); 1140 | END_STATE(); 1141 | case 82: 1142 | ACCEPT_TOKEN(sym_name); 1143 | if (lookahead == 's') ADVANCE(50); 1144 | if (lookahead == '-' || 1145 | lookahead == '.' || 1146 | ('0' <= lookahead && lookahead <= '9') || 1147 | ('A' <= lookahead && lookahead <= 'Z') || 1148 | lookahead == '_' || 1149 | ('a' <= lookahead && lookahead <= 'z')) ADVANCE(83); 1150 | END_STATE(); 1151 | case 83: 1152 | ACCEPT_TOKEN(sym_name); 1153 | if (lookahead == '-' || 1154 | lookahead == '.' || 1155 | ('0' <= lookahead && lookahead <= '9') || 1156 | ('A' <= lookahead && lookahead <= 'Z') || 1157 | lookahead == '_' || 1158 | ('a' <= lookahead && lookahead <= 'z')) ADVANCE(83); 1159 | END_STATE(); 1160 | case 84: 1161 | ACCEPT_TOKEN(anon_sym_LT_BANG_DASH_DASH); 1162 | END_STATE(); 1163 | case 85: 1164 | ACCEPT_TOKEN(anon_sym_DASH_DASH_GT); 1165 | END_STATE(); 1166 | case 86: 1167 | ACCEPT_TOKEN(sym_char_data); 1168 | if (lookahead != 0 && 1169 | lookahead != '\t' && 1170 | lookahead != '\n' && 1171 | lookahead != '\r' && 1172 | lookahead != ' ' && 1173 | lookahead != '&' && 1174 | lookahead != '<') ADVANCE(86); 1175 | END_STATE(); 1176 | case 87: 1177 | ACCEPT_TOKEN(sym_char_data); 1178 | if (eof) ADVANCE(44); 1179 | if (lookahead == '&') ADVANCE(91); 1180 | if (lookahead == '<') ADVANCE(47); 1181 | if (lookahead == '\t' || 1182 | lookahead == '\n' || 1183 | lookahead == '\r' || 1184 | lookahead == ' ') ADVANCE(99); 1185 | if (lookahead != 0) ADVANCE(86); 1186 | END_STATE(); 1187 | case 88: 1188 | ACCEPT_TOKEN(sym_char_ref); 1189 | END_STATE(); 1190 | case 89: 1191 | ACCEPT_TOKEN(sym_cdata_start); 1192 | END_STATE(); 1193 | case 90: 1194 | ACCEPT_TOKEN(sym_cdata_end); 1195 | END_STATE(); 1196 | case 91: 1197 | ACCEPT_TOKEN(anon_sym_AMP); 1198 | if (lookahead == '#') ADVANCE(39); 1199 | END_STATE(); 1200 | case 92: 1201 | ACCEPT_TOKEN(anon_sym_SEMI); 1202 | END_STATE(); 1203 | case 93: 1204 | ACCEPT_TOKEN(sym_eq); 1205 | END_STATE(); 1206 | case 94: 1207 | ACCEPT_TOKEN(sym__char); 1208 | END_STATE(); 1209 | case 95: 1210 | ACCEPT_TOKEN(sym__char); 1211 | if (lookahead == '!') ADVANCE(6); 1212 | if (lookahead == '?') ADVANCE(45); 1213 | END_STATE(); 1214 | case 96: 1215 | ACCEPT_TOKEN(sym__char); 1216 | if (lookahead == '-') ADVANCE(14); 1217 | END_STATE(); 1218 | case 97: 1219 | ACCEPT_TOKEN(sym__char); 1220 | if (lookahead == '>') ADVANCE(46); 1221 | END_STATE(); 1222 | case 98: 1223 | ACCEPT_TOKEN(sym__char); 1224 | if (lookahead == ']') ADVANCE(15); 1225 | END_STATE(); 1226 | case 99: 1227 | ACCEPT_TOKEN(sym__ws); 1228 | END_STATE(); 1229 | case 100: 1230 | ACCEPT_TOKEN(anon_sym_DQUOTE); 1231 | END_STATE(); 1232 | case 101: 1233 | ACCEPT_TOKEN(anon_sym_SQUOTE); 1234 | END_STATE(); 1235 | case 102: 1236 | ACCEPT_TOKEN(sym__dec_num); 1237 | if (('0' <= lookahead && lookahead <= '9')) ADVANCE(102); 1238 | END_STATE(); 1239 | case 103: 1240 | ACCEPT_TOKEN(sym__encoding); 1241 | if (lookahead == '-' || 1242 | lookahead == '.' || 1243 | ('0' <= lookahead && lookahead <= '9') || 1244 | ('A' <= lookahead && lookahead <= 'Z') || 1245 | lookahead == '_' || 1246 | ('a' <= lookahead && lookahead <= 'z')) ADVANCE(103); 1247 | END_STATE(); 1248 | default: 1249 | return false; 1250 | } 1251 | } 1252 | 1253 | static const TSLexMode ts_lex_modes[STATE_COUNT] = { 1254 | [0] = {.lex_state = 0}, 1255 | [1] = {.lex_state = 87}, 1256 | [2] = {.lex_state = 87}, 1257 | [3] = {.lex_state = 87}, 1258 | [4] = {.lex_state = 87}, 1259 | [5] = {.lex_state = 87}, 1260 | [6] = {.lex_state = 87}, 1261 | [7] = {.lex_state = 87}, 1262 | [8] = {.lex_state = 87}, 1263 | [9] = {.lex_state = 87}, 1264 | [10] = {.lex_state = 87}, 1265 | [11] = {.lex_state = 4}, 1266 | [12] = {.lex_state = 4}, 1267 | [13] = {.lex_state = 43}, 1268 | [14] = {.lex_state = 43}, 1269 | [15] = {.lex_state = 43}, 1270 | [16] = {.lex_state = 43}, 1271 | [17] = {.lex_state = 4}, 1272 | [18] = {.lex_state = 43}, 1273 | [19] = {.lex_state = 87}, 1274 | [20] = {.lex_state = 87}, 1275 | [21] = {.lex_state = 87}, 1276 | [22] = {.lex_state = 87}, 1277 | [23] = {.lex_state = 87}, 1278 | [24] = {.lex_state = 87}, 1279 | [25] = {.lex_state = 87}, 1280 | [26] = {.lex_state = 5}, 1281 | [27] = {.lex_state = 87}, 1282 | [28] = {.lex_state = 87}, 1283 | [29] = {.lex_state = 87}, 1284 | [30] = {.lex_state = 87}, 1285 | [31] = {.lex_state = 5}, 1286 | [32] = {.lex_state = 87}, 1287 | [33] = {.lex_state = 87}, 1288 | [34] = {.lex_state = 87}, 1289 | [35] = {.lex_state = 87}, 1290 | [36] = {.lex_state = 87}, 1291 | [37] = {.lex_state = 87}, 1292 | [38] = {.lex_state = 87}, 1293 | [39] = {.lex_state = 87}, 1294 | [40] = {.lex_state = 87}, 1295 | [41] = {.lex_state = 5}, 1296 | [42] = {.lex_state = 5}, 1297 | [43] = {.lex_state = 87}, 1298 | [44] = {.lex_state = 87}, 1299 | [45] = {.lex_state = 5}, 1300 | [46] = {.lex_state = 87}, 1301 | [47] = {.lex_state = 4}, 1302 | [48] = {.lex_state = 43}, 1303 | [49] = {.lex_state = 43}, 1304 | [50] = {.lex_state = 43}, 1305 | [51] = {.lex_state = 43}, 1306 | [52] = {.lex_state = 5}, 1307 | [53] = {.lex_state = 43}, 1308 | [54] = {.lex_state = 43}, 1309 | [55] = {.lex_state = 3}, 1310 | [56] = {.lex_state = 5}, 1311 | [57] = {.lex_state = 43}, 1312 | [58] = {.lex_state = 43}, 1313 | [59] = {.lex_state = 43}, 1314 | [60] = {.lex_state = 43}, 1315 | [61] = {.lex_state = 43}, 1316 | [62] = {.lex_state = 43}, 1317 | [63] = {.lex_state = 5}, 1318 | [64] = {.lex_state = 43}, 1319 | [65] = {.lex_state = 43}, 1320 | [66] = {.lex_state = 5}, 1321 | [67] = {.lex_state = 5}, 1322 | [68] = {.lex_state = 2}, 1323 | [69] = {.lex_state = 5}, 1324 | [70] = {.lex_state = 2}, 1325 | [71] = {.lex_state = 3}, 1326 | [72] = {.lex_state = 5}, 1327 | [73] = {.lex_state = 1}, 1328 | [74] = {.lex_state = 2}, 1329 | [75] = {.lex_state = 2}, 1330 | [76] = {.lex_state = 5}, 1331 | [77] = {.lex_state = 1}, 1332 | [78] = {.lex_state = 1}, 1333 | [79] = {.lex_state = 5}, 1334 | [80] = {.lex_state = 5}, 1335 | [81] = {.lex_state = 5}, 1336 | [82] = {.lex_state = 1}, 1337 | [83] = {.lex_state = 5}, 1338 | [84] = {.lex_state = 1}, 1339 | [85] = {.lex_state = 3}, 1340 | [86] = {.lex_state = 2}, 1341 | [87] = {.lex_state = 5}, 1342 | [88] = {.lex_state = 5}, 1343 | [89] = {.lex_state = 10}, 1344 | [90] = {.lex_state = 5}, 1345 | [91] = {.lex_state = 16}, 1346 | [92] = {.lex_state = 5}, 1347 | [93] = {.lex_state = 5}, 1348 | [94] = {.lex_state = 5}, 1349 | [95] = {.lex_state = 10}, 1350 | [96] = {.lex_state = 5}, 1351 | [97] = {.lex_state = 5}, 1352 | [98] = {.lex_state = 5}, 1353 | [99] = {.lex_state = 10}, 1354 | [100] = {.lex_state = 87}, 1355 | [101] = {.lex_state = 87}, 1356 | [102] = {.lex_state = 5}, 1357 | [103] = {.lex_state = 5}, 1358 | [104] = {.lex_state = 10}, 1359 | [105] = {.lex_state = 5}, 1360 | [106] = {.lex_state = 5}, 1361 | [107] = {.lex_state = 5}, 1362 | [108] = {.lex_state = 5}, 1363 | [109] = {.lex_state = 5}, 1364 | [110] = {.lex_state = 16}, 1365 | [111] = {.lex_state = 16}, 1366 | [112] = {.lex_state = 5}, 1367 | [113] = {.lex_state = 10}, 1368 | [114] = {.lex_state = 10}, 1369 | [115] = {.lex_state = 5}, 1370 | [116] = {.lex_state = 5}, 1371 | [117] = {.lex_state = 5}, 1372 | [118] = {.lex_state = 10}, 1373 | [119] = {.lex_state = 5}, 1374 | [120] = {.lex_state = 87}, 1375 | [121] = {.lex_state = 5}, 1376 | [122] = {.lex_state = 5}, 1377 | [123] = {.lex_state = 5}, 1378 | [124] = {.lex_state = 5}, 1379 | [125] = {.lex_state = 5}, 1380 | [126] = {.lex_state = 5}, 1381 | [127] = {.lex_state = 87}, 1382 | [128] = {.lex_state = 5}, 1383 | [129] = {.lex_state = 5}, 1384 | [130] = {.lex_state = 5}, 1385 | [131] = {.lex_state = 5}, 1386 | [132] = {.lex_state = 5}, 1387 | [133] = {.lex_state = 5}, 1388 | [134] = {.lex_state = 5}, 1389 | [135] = {.lex_state = 5}, 1390 | [136] = {.lex_state = 10}, 1391 | [137] = {.lex_state = 10}, 1392 | [138] = {.lex_state = 87}, 1393 | [139] = {.lex_state = 40}, 1394 | [140] = {.lex_state = 10}, 1395 | [141] = {.lex_state = 10}, 1396 | [142] = {.lex_state = 10}, 1397 | [143] = {.lex_state = 5}, 1398 | }; 1399 | 1400 | static const uint16_t ts_parse_table[LARGE_STATE_COUNT][SYMBOL_COUNT] = { 1401 | [0] = { 1402 | [ts_builtin_sym_end] = ACTIONS(1), 1403 | [anon_sym_LT_QMARK] = ACTIONS(1), 1404 | [anon_sym_QMARK_GT] = ACTIONS(1), 1405 | [anon_sym_LT] = ACTIONS(1), 1406 | [anon_sym_SLASH] = ACTIONS(1), 1407 | [anon_sym_GT] = ACTIONS(1), 1408 | [anon_sym_xmlns] = ACTIONS(1), 1409 | [anon_sym_COLON] = ACTIONS(1), 1410 | [aux_sym_attr_value_token1] = ACTIONS(1), 1411 | [anon_sym_xml] = ACTIONS(1), 1412 | [anon_sym_version] = ACTIONS(1), 1413 | [anon_sym_encoding] = ACTIONS(1), 1414 | [sym_name] = ACTIONS(1), 1415 | [anon_sym_LT_BANG_DASH_DASH] = ACTIONS(1), 1416 | [anon_sym_DASH_DASH_GT] = ACTIONS(1), 1417 | [sym_char_ref] = ACTIONS(1), 1418 | [sym_cdata_start] = ACTIONS(1), 1419 | [sym_cdata_end] = ACTIONS(1), 1420 | [anon_sym_AMP] = ACTIONS(1), 1421 | [anon_sym_SEMI] = ACTIONS(1), 1422 | [sym_eq] = ACTIONS(1), 1423 | [sym__char] = ACTIONS(1), 1424 | [sym__ws] = ACTIONS(3), 1425 | [anon_sym_DQUOTE] = ACTIONS(1), 1426 | [anon_sym_SQUOTE] = ACTIONS(1), 1427 | [sym__dec_num] = ACTIONS(1), 1428 | [sym__encoding] = ACTIONS(1), 1429 | }, 1430 | [1] = { 1431 | [sym_xml_file] = STATE(138), 1432 | [sym_element] = STATE(15), 1433 | [sym_end_tag_element] = STATE(53), 1434 | [sym_empty_element] = STATE(53), 1435 | [sym_tag_start] = STATE(2), 1436 | [sym_xml_decl] = STATE(46), 1437 | [anon_sym_LT_QMARK] = ACTIONS(5), 1438 | [anon_sym_LT] = ACTIONS(7), 1439 | [sym__ws] = ACTIONS(9), 1440 | }, 1441 | }; 1442 | 1443 | static const uint16_t ts_small_parse_table[] = { 1444 | [0] = 13, 1445 | ACTIONS(9), 1, 1446 | sym__ws, 1447 | ACTIONS(11), 1, 1448 | anon_sym_LT_QMARK, 1449 | ACTIONS(13), 1, 1450 | anon_sym_LT, 1451 | ACTIONS(15), 1, 1452 | anon_sym_LT_BANG_DASH_DASH, 1453 | ACTIONS(17), 1, 1454 | sym_char_data, 1455 | ACTIONS(19), 1, 1456 | sym_char_ref, 1457 | ACTIONS(21), 1, 1458 | sym_cdata_start, 1459 | ACTIONS(23), 1, 1460 | anon_sym_AMP, 1461 | STATE(3), 1, 1462 | sym_tag_start, 1463 | STATE(9), 1, 1464 | aux_sym__content, 1465 | STATE(58), 1, 1466 | sym_tag_end, 1467 | STATE(30), 2, 1468 | sym_end_tag_element, 1469 | sym_empty_element, 1470 | STATE(32), 6, 1471 | sym_pi, 1472 | sym_element, 1473 | sym_comment, 1474 | sym_cdata_sect, 1475 | sym__ref, 1476 | sym_entity_ref, 1477 | [46] = 13, 1478 | ACTIONS(9), 1, 1479 | sym__ws, 1480 | ACTIONS(11), 1, 1481 | anon_sym_LT_QMARK, 1482 | ACTIONS(15), 1, 1483 | anon_sym_LT_BANG_DASH_DASH, 1484 | ACTIONS(19), 1, 1485 | sym_char_ref, 1486 | ACTIONS(21), 1, 1487 | sym_cdata_start, 1488 | ACTIONS(23), 1, 1489 | anon_sym_AMP, 1490 | ACTIONS(25), 1, 1491 | anon_sym_LT, 1492 | ACTIONS(27), 1, 1493 | sym_char_data, 1494 | STATE(3), 1, 1495 | sym_tag_start, 1496 | STATE(5), 1, 1497 | aux_sym__content, 1498 | STATE(29), 1, 1499 | sym_tag_end, 1500 | STATE(30), 2, 1501 | sym_end_tag_element, 1502 | sym_empty_element, 1503 | STATE(32), 6, 1504 | sym_pi, 1505 | sym_element, 1506 | sym_comment, 1507 | sym_cdata_sect, 1508 | sym__ref, 1509 | sym_entity_ref, 1510 | [92] = 12, 1511 | ACTIONS(9), 1, 1512 | sym__ws, 1513 | ACTIONS(11), 1, 1514 | anon_sym_LT_QMARK, 1515 | ACTIONS(15), 1, 1516 | anon_sym_LT_BANG_DASH_DASH, 1517 | ACTIONS(19), 1, 1518 | sym_char_ref, 1519 | ACTIONS(21), 1, 1520 | sym_cdata_start, 1521 | ACTIONS(23), 1, 1522 | anon_sym_AMP, 1523 | ACTIONS(25), 1, 1524 | anon_sym_LT, 1525 | STATE(3), 1, 1526 | sym_tag_start, 1527 | STATE(10), 1, 1528 | aux_sym__content, 1529 | STATE(21), 1, 1530 | sym_tag_end, 1531 | STATE(30), 2, 1532 | sym_end_tag_element, 1533 | sym_empty_element, 1534 | STATE(32), 6, 1535 | sym_pi, 1536 | sym_element, 1537 | sym_comment, 1538 | sym_cdata_sect, 1539 | sym__ref, 1540 | sym_entity_ref, 1541 | [135] = 12, 1542 | ACTIONS(9), 1, 1543 | sym__ws, 1544 | ACTIONS(11), 1, 1545 | anon_sym_LT_QMARK, 1546 | ACTIONS(15), 1, 1547 | anon_sym_LT_BANG_DASH_DASH, 1548 | ACTIONS(19), 1, 1549 | sym_char_ref, 1550 | ACTIONS(21), 1, 1551 | sym_cdata_start, 1552 | ACTIONS(23), 1, 1553 | anon_sym_AMP, 1554 | ACTIONS(25), 1, 1555 | anon_sym_LT, 1556 | STATE(3), 1, 1557 | sym_tag_start, 1558 | STATE(10), 1, 1559 | aux_sym__content, 1560 | STATE(27), 1, 1561 | sym_tag_end, 1562 | STATE(30), 2, 1563 | sym_end_tag_element, 1564 | sym_empty_element, 1565 | STATE(32), 6, 1566 | sym_pi, 1567 | sym_element, 1568 | sym_comment, 1569 | sym_cdata_sect, 1570 | sym__ref, 1571 | sym_entity_ref, 1572 | [178] = 12, 1573 | ACTIONS(9), 1, 1574 | sym__ws, 1575 | ACTIONS(11), 1, 1576 | anon_sym_LT_QMARK, 1577 | ACTIONS(15), 1, 1578 | anon_sym_LT_BANG_DASH_DASH, 1579 | ACTIONS(19), 1, 1580 | sym_char_ref, 1581 | ACTIONS(21), 1, 1582 | sym_cdata_start, 1583 | ACTIONS(23), 1, 1584 | anon_sym_AMP, 1585 | ACTIONS(25), 1, 1586 | anon_sym_LT, 1587 | STATE(3), 1, 1588 | sym_tag_start, 1589 | STATE(4), 1, 1590 | aux_sym__content, 1591 | STATE(27), 1, 1592 | sym_tag_end, 1593 | STATE(30), 2, 1594 | sym_end_tag_element, 1595 | sym_empty_element, 1596 | STATE(32), 6, 1597 | sym_pi, 1598 | sym_element, 1599 | sym_comment, 1600 | sym_cdata_sect, 1601 | sym__ref, 1602 | sym_entity_ref, 1603 | [221] = 12, 1604 | ACTIONS(9), 1, 1605 | sym__ws, 1606 | ACTIONS(11), 1, 1607 | anon_sym_LT_QMARK, 1608 | ACTIONS(13), 1, 1609 | anon_sym_LT, 1610 | ACTIONS(15), 1, 1611 | anon_sym_LT_BANG_DASH_DASH, 1612 | ACTIONS(19), 1, 1613 | sym_char_ref, 1614 | ACTIONS(21), 1, 1615 | sym_cdata_start, 1616 | ACTIONS(23), 1, 1617 | anon_sym_AMP, 1618 | STATE(3), 1, 1619 | sym_tag_start, 1620 | STATE(10), 1, 1621 | aux_sym__content, 1622 | STATE(62), 1, 1623 | sym_tag_end, 1624 | STATE(30), 2, 1625 | sym_end_tag_element, 1626 | sym_empty_element, 1627 | STATE(32), 6, 1628 | sym_pi, 1629 | sym_element, 1630 | sym_comment, 1631 | sym_cdata_sect, 1632 | sym__ref, 1633 | sym_entity_ref, 1634 | [264] = 12, 1635 | ACTIONS(9), 1, 1636 | sym__ws, 1637 | ACTIONS(11), 1, 1638 | anon_sym_LT_QMARK, 1639 | ACTIONS(13), 1, 1640 | anon_sym_LT, 1641 | ACTIONS(15), 1, 1642 | anon_sym_LT_BANG_DASH_DASH, 1643 | ACTIONS(19), 1, 1644 | sym_char_ref, 1645 | ACTIONS(21), 1, 1646 | sym_cdata_start, 1647 | ACTIONS(23), 1, 1648 | anon_sym_AMP, 1649 | STATE(3), 1, 1650 | sym_tag_start, 1651 | STATE(7), 1, 1652 | aux_sym__content, 1653 | STATE(49), 1, 1654 | sym_tag_end, 1655 | STATE(30), 2, 1656 | sym_end_tag_element, 1657 | sym_empty_element, 1658 | STATE(32), 6, 1659 | sym_pi, 1660 | sym_element, 1661 | sym_comment, 1662 | sym_cdata_sect, 1663 | sym__ref, 1664 | sym_entity_ref, 1665 | [307] = 12, 1666 | ACTIONS(9), 1, 1667 | sym__ws, 1668 | ACTIONS(11), 1, 1669 | anon_sym_LT_QMARK, 1670 | ACTIONS(13), 1, 1671 | anon_sym_LT, 1672 | ACTIONS(15), 1, 1673 | anon_sym_LT_BANG_DASH_DASH, 1674 | ACTIONS(19), 1, 1675 | sym_char_ref, 1676 | ACTIONS(21), 1, 1677 | sym_cdata_start, 1678 | ACTIONS(23), 1, 1679 | anon_sym_AMP, 1680 | STATE(3), 1, 1681 | sym_tag_start, 1682 | STATE(10), 1, 1683 | aux_sym__content, 1684 | STATE(49), 1, 1685 | sym_tag_end, 1686 | STATE(30), 2, 1687 | sym_end_tag_element, 1688 | sym_empty_element, 1689 | STATE(32), 6, 1690 | sym_pi, 1691 | sym_element, 1692 | sym_comment, 1693 | sym_cdata_sect, 1694 | sym__ref, 1695 | sym_entity_ref, 1696 | [350] = 11, 1697 | ACTIONS(9), 1, 1698 | sym__ws, 1699 | ACTIONS(29), 1, 1700 | anon_sym_LT_QMARK, 1701 | ACTIONS(32), 1, 1702 | anon_sym_LT, 1703 | ACTIONS(35), 1, 1704 | anon_sym_LT_BANG_DASH_DASH, 1705 | ACTIONS(38), 1, 1706 | sym_char_ref, 1707 | ACTIONS(41), 1, 1708 | sym_cdata_start, 1709 | ACTIONS(44), 1, 1710 | anon_sym_AMP, 1711 | STATE(3), 1, 1712 | sym_tag_start, 1713 | STATE(10), 1, 1714 | aux_sym__content, 1715 | STATE(30), 2, 1716 | sym_end_tag_element, 1717 | sym_empty_element, 1718 | STATE(32), 6, 1719 | sym_pi, 1720 | sym_element, 1721 | sym_comment, 1722 | sym_cdata_sect, 1723 | sym__ref, 1724 | sym_entity_ref, 1725 | [390] = 7, 1726 | ACTIONS(3), 1, 1727 | sym__ws, 1728 | ACTIONS(47), 1, 1729 | aux_sym_attr_value_token1, 1730 | ACTIONS(49), 1, 1731 | sym_char_ref, 1732 | ACTIONS(51), 1, 1733 | anon_sym_AMP, 1734 | STATE(87), 1, 1735 | sym__quote, 1736 | ACTIONS(53), 2, 1737 | anon_sym_DQUOTE, 1738 | anon_sym_SQUOTE, 1739 | STATE(12), 3, 1740 | sym__ref, 1741 | sym_entity_ref, 1742 | aux_sym_attr_value_repeat1, 1743 | [415] = 7, 1744 | ACTIONS(3), 1, 1745 | sym__ws, 1746 | ACTIONS(51), 1, 1747 | anon_sym_AMP, 1748 | ACTIONS(55), 1, 1749 | aux_sym_attr_value_token1, 1750 | ACTIONS(57), 1, 1751 | sym_char_ref, 1752 | STATE(96), 1, 1753 | sym__quote, 1754 | ACTIONS(59), 2, 1755 | anon_sym_DQUOTE, 1756 | anon_sym_SQUOTE, 1757 | STATE(17), 3, 1758 | sym__ref, 1759 | sym_entity_ref, 1760 | aux_sym_attr_value_repeat1, 1761 | [440] = 6, 1762 | ACTIONS(3), 1, 1763 | sym__ws, 1764 | ACTIONS(61), 1, 1765 | ts_builtin_sym_end, 1766 | ACTIONS(63), 1, 1767 | anon_sym_LT_QMARK, 1768 | ACTIONS(65), 1, 1769 | anon_sym_LT_BANG_DASH_DASH, 1770 | ACTIONS(67), 1, 1771 | sym__char, 1772 | STATE(14), 4, 1773 | sym_pi, 1774 | sym_comment, 1775 | sym__misc, 1776 | aux_sym_xml_file_repeat1, 1777 | [462] = 6, 1778 | ACTIONS(3), 1, 1779 | sym__ws, 1780 | ACTIONS(63), 1, 1781 | anon_sym_LT_QMARK, 1782 | ACTIONS(65), 1, 1783 | anon_sym_LT_BANG_DASH_DASH, 1784 | ACTIONS(69), 1, 1785 | ts_builtin_sym_end, 1786 | ACTIONS(71), 1, 1787 | sym__char, 1788 | STATE(18), 4, 1789 | sym_pi, 1790 | sym_comment, 1791 | sym__misc, 1792 | aux_sym_xml_file_repeat1, 1793 | [484] = 6, 1794 | ACTIONS(3), 1, 1795 | sym__ws, 1796 | ACTIONS(63), 1, 1797 | anon_sym_LT_QMARK, 1798 | ACTIONS(65), 1, 1799 | anon_sym_LT_BANG_DASH_DASH, 1800 | ACTIONS(73), 1, 1801 | ts_builtin_sym_end, 1802 | ACTIONS(75), 1, 1803 | sym__char, 1804 | STATE(16), 4, 1805 | sym_pi, 1806 | sym_comment, 1807 | sym__misc, 1808 | aux_sym_xml_file_repeat1, 1809 | [506] = 6, 1810 | ACTIONS(3), 1, 1811 | sym__ws, 1812 | ACTIONS(61), 1, 1813 | ts_builtin_sym_end, 1814 | ACTIONS(63), 1, 1815 | anon_sym_LT_QMARK, 1816 | ACTIONS(65), 1, 1817 | anon_sym_LT_BANG_DASH_DASH, 1818 | ACTIONS(71), 1, 1819 | sym__char, 1820 | STATE(18), 4, 1821 | sym_pi, 1822 | sym_comment, 1823 | sym__misc, 1824 | aux_sym_xml_file_repeat1, 1825 | [528] = 6, 1826 | ACTIONS(3), 1, 1827 | sym__ws, 1828 | ACTIONS(77), 1, 1829 | aux_sym_attr_value_token1, 1830 | ACTIONS(80), 1, 1831 | sym_char_ref, 1832 | ACTIONS(83), 1, 1833 | anon_sym_AMP, 1834 | ACTIONS(86), 2, 1835 | anon_sym_DQUOTE, 1836 | anon_sym_SQUOTE, 1837 | STATE(17), 3, 1838 | sym__ref, 1839 | sym_entity_ref, 1840 | aux_sym_attr_value_repeat1, 1841 | [550] = 6, 1842 | ACTIONS(3), 1, 1843 | sym__ws, 1844 | ACTIONS(88), 1, 1845 | ts_builtin_sym_end, 1846 | ACTIONS(90), 1, 1847 | anon_sym_LT_QMARK, 1848 | ACTIONS(93), 1, 1849 | anon_sym_LT_BANG_DASH_DASH, 1850 | ACTIONS(96), 1, 1851 | sym__char, 1852 | STATE(18), 4, 1853 | sym_pi, 1854 | sym_comment, 1855 | sym__misc, 1856 | aux_sym_xml_file_repeat1, 1857 | [572] = 3, 1858 | ACTIONS(9), 1, 1859 | sym__ws, 1860 | ACTIONS(101), 3, 1861 | anon_sym_LT, 1862 | sym_char_data, 1863 | anon_sym_AMP, 1864 | ACTIONS(99), 4, 1865 | anon_sym_LT_QMARK, 1866 | anon_sym_LT_BANG_DASH_DASH, 1867 | sym_char_ref, 1868 | sym_cdata_start, 1869 | [587] = 3, 1870 | ACTIONS(9), 1, 1871 | sym__ws, 1872 | ACTIONS(105), 3, 1873 | anon_sym_LT, 1874 | sym_char_data, 1875 | anon_sym_AMP, 1876 | ACTIONS(103), 4, 1877 | anon_sym_LT_QMARK, 1878 | anon_sym_LT_BANG_DASH_DASH, 1879 | sym_char_ref, 1880 | sym_cdata_start, 1881 | [602] = 3, 1882 | ACTIONS(9), 1, 1883 | sym__ws, 1884 | ACTIONS(109), 3, 1885 | anon_sym_LT, 1886 | sym_char_data, 1887 | anon_sym_AMP, 1888 | ACTIONS(107), 4, 1889 | anon_sym_LT_QMARK, 1890 | anon_sym_LT_BANG_DASH_DASH, 1891 | sym_char_ref, 1892 | sym_cdata_start, 1893 | [617] = 3, 1894 | ACTIONS(9), 1, 1895 | sym__ws, 1896 | ACTIONS(113), 3, 1897 | anon_sym_LT, 1898 | sym_char_data, 1899 | anon_sym_AMP, 1900 | ACTIONS(111), 4, 1901 | anon_sym_LT_QMARK, 1902 | anon_sym_LT_BANG_DASH_DASH, 1903 | sym_char_ref, 1904 | sym_cdata_start, 1905 | [632] = 3, 1906 | ACTIONS(9), 1, 1907 | sym__ws, 1908 | ACTIONS(117), 3, 1909 | anon_sym_LT, 1910 | sym_char_data, 1911 | anon_sym_AMP, 1912 | ACTIONS(115), 4, 1913 | anon_sym_LT_QMARK, 1914 | anon_sym_LT_BANG_DASH_DASH, 1915 | sym_char_ref, 1916 | sym_cdata_start, 1917 | [647] = 3, 1918 | ACTIONS(9), 1, 1919 | sym__ws, 1920 | ACTIONS(121), 3, 1921 | anon_sym_LT, 1922 | sym_char_data, 1923 | anon_sym_AMP, 1924 | ACTIONS(119), 4, 1925 | anon_sym_LT_QMARK, 1926 | anon_sym_LT_BANG_DASH_DASH, 1927 | sym_char_ref, 1928 | sym_cdata_start, 1929 | [662] = 3, 1930 | ACTIONS(9), 1, 1931 | sym__ws, 1932 | ACTIONS(125), 3, 1933 | anon_sym_LT, 1934 | sym_char_data, 1935 | anon_sym_AMP, 1936 | ACTIONS(123), 4, 1937 | anon_sym_LT_QMARK, 1938 | anon_sym_LT_BANG_DASH_DASH, 1939 | sym_char_ref, 1940 | sym_cdata_start, 1941 | [677] = 7, 1942 | ACTIONS(9), 1, 1943 | sym__ws, 1944 | ACTIONS(127), 1, 1945 | anon_sym_SLASH, 1946 | ACTIONS(129), 1, 1947 | anon_sym_GT, 1948 | ACTIONS(131), 1, 1949 | anon_sym_xmlns, 1950 | ACTIONS(133), 1, 1951 | sym_name, 1952 | STATE(93), 1, 1953 | sym_attribute, 1954 | STATE(94), 2, 1955 | sym_ns_decl, 1956 | sym_xml_attr, 1957 | [700] = 3, 1958 | ACTIONS(9), 1, 1959 | sym__ws, 1960 | ACTIONS(137), 3, 1961 | anon_sym_LT, 1962 | sym_char_data, 1963 | anon_sym_AMP, 1964 | ACTIONS(135), 4, 1965 | anon_sym_LT_QMARK, 1966 | anon_sym_LT_BANG_DASH_DASH, 1967 | sym_char_ref, 1968 | sym_cdata_start, 1969 | [715] = 3, 1970 | ACTIONS(9), 1, 1971 | sym__ws, 1972 | ACTIONS(141), 3, 1973 | anon_sym_LT, 1974 | sym_char_data, 1975 | anon_sym_AMP, 1976 | ACTIONS(139), 4, 1977 | anon_sym_LT_QMARK, 1978 | anon_sym_LT_BANG_DASH_DASH, 1979 | sym_char_ref, 1980 | sym_cdata_start, 1981 | [730] = 3, 1982 | ACTIONS(9), 1, 1983 | sym__ws, 1984 | ACTIONS(145), 3, 1985 | anon_sym_LT, 1986 | sym_char_data, 1987 | anon_sym_AMP, 1988 | ACTIONS(143), 4, 1989 | anon_sym_LT_QMARK, 1990 | anon_sym_LT_BANG_DASH_DASH, 1991 | sym_char_ref, 1992 | sym_cdata_start, 1993 | [745] = 3, 1994 | ACTIONS(9), 1, 1995 | sym__ws, 1996 | ACTIONS(149), 3, 1997 | anon_sym_LT, 1998 | sym_char_data, 1999 | anon_sym_AMP, 2000 | ACTIONS(147), 4, 2001 | anon_sym_LT_QMARK, 2002 | anon_sym_LT_BANG_DASH_DASH, 2003 | sym_char_ref, 2004 | sym_cdata_start, 2005 | [760] = 7, 2006 | ACTIONS(9), 1, 2007 | sym__ws, 2008 | ACTIONS(131), 1, 2009 | anon_sym_xmlns, 2010 | ACTIONS(133), 1, 2011 | sym_name, 2012 | ACTIONS(151), 1, 2013 | anon_sym_SLASH, 2014 | ACTIONS(153), 1, 2015 | anon_sym_GT, 2016 | STATE(93), 1, 2017 | sym_attribute, 2018 | STATE(94), 2, 2019 | sym_ns_decl, 2020 | sym_xml_attr, 2021 | [783] = 4, 2022 | ACTIONS(9), 1, 2023 | sym__ws, 2024 | ACTIONS(159), 1, 2025 | sym_char_data, 2026 | ACTIONS(157), 2, 2027 | anon_sym_LT, 2028 | anon_sym_AMP, 2029 | ACTIONS(155), 4, 2030 | anon_sym_LT_QMARK, 2031 | anon_sym_LT_BANG_DASH_DASH, 2032 | sym_char_ref, 2033 | sym_cdata_start, 2034 | [800] = 3, 2035 | ACTIONS(9), 1, 2036 | sym__ws, 2037 | ACTIONS(163), 3, 2038 | anon_sym_LT, 2039 | sym_char_data, 2040 | anon_sym_AMP, 2041 | ACTIONS(161), 4, 2042 | anon_sym_LT_QMARK, 2043 | anon_sym_LT_BANG_DASH_DASH, 2044 | sym_char_ref, 2045 | sym_cdata_start, 2046 | [815] = 3, 2047 | ACTIONS(9), 1, 2048 | sym__ws, 2049 | ACTIONS(167), 3, 2050 | anon_sym_LT, 2051 | sym_char_data, 2052 | anon_sym_AMP, 2053 | ACTIONS(165), 4, 2054 | anon_sym_LT_QMARK, 2055 | anon_sym_LT_BANG_DASH_DASH, 2056 | sym_char_ref, 2057 | sym_cdata_start, 2058 | [830] = 3, 2059 | ACTIONS(9), 1, 2060 | sym__ws, 2061 | ACTIONS(171), 3, 2062 | anon_sym_LT, 2063 | sym_char_data, 2064 | anon_sym_AMP, 2065 | ACTIONS(169), 4, 2066 | anon_sym_LT_QMARK, 2067 | anon_sym_LT_BANG_DASH_DASH, 2068 | sym_char_ref, 2069 | sym_cdata_start, 2070 | [845] = 3, 2071 | ACTIONS(9), 1, 2072 | sym__ws, 2073 | ACTIONS(175), 3, 2074 | anon_sym_LT, 2075 | sym_char_data, 2076 | anon_sym_AMP, 2077 | ACTIONS(173), 4, 2078 | anon_sym_LT_QMARK, 2079 | anon_sym_LT_BANG_DASH_DASH, 2080 | sym_char_ref, 2081 | sym_cdata_start, 2082 | [860] = 3, 2083 | ACTIONS(9), 1, 2084 | sym__ws, 2085 | ACTIONS(179), 3, 2086 | anon_sym_LT, 2087 | sym_char_data, 2088 | anon_sym_AMP, 2089 | ACTIONS(177), 4, 2090 | anon_sym_LT_QMARK, 2091 | anon_sym_LT_BANG_DASH_DASH, 2092 | sym_char_ref, 2093 | sym_cdata_start, 2094 | [875] = 3, 2095 | ACTIONS(9), 1, 2096 | sym__ws, 2097 | ACTIONS(183), 3, 2098 | anon_sym_LT, 2099 | sym_char_data, 2100 | anon_sym_AMP, 2101 | ACTIONS(181), 4, 2102 | anon_sym_LT_QMARK, 2103 | anon_sym_LT_BANG_DASH_DASH, 2104 | sym_char_ref, 2105 | sym_cdata_start, 2106 | [890] = 3, 2107 | ACTIONS(9), 1, 2108 | sym__ws, 2109 | ACTIONS(187), 3, 2110 | anon_sym_LT, 2111 | sym_char_data, 2112 | anon_sym_AMP, 2113 | ACTIONS(185), 4, 2114 | anon_sym_LT_QMARK, 2115 | anon_sym_LT_BANG_DASH_DASH, 2116 | sym_char_ref, 2117 | sym_cdata_start, 2118 | [905] = 3, 2119 | ACTIONS(9), 1, 2120 | sym__ws, 2121 | ACTIONS(191), 3, 2122 | anon_sym_LT, 2123 | sym_char_data, 2124 | anon_sym_AMP, 2125 | ACTIONS(189), 4, 2126 | anon_sym_LT_QMARK, 2127 | anon_sym_LT_BANG_DASH_DASH, 2128 | sym_char_ref, 2129 | sym_cdata_start, 2130 | [920] = 7, 2131 | ACTIONS(9), 1, 2132 | sym__ws, 2133 | ACTIONS(129), 1, 2134 | anon_sym_GT, 2135 | ACTIONS(131), 1, 2136 | anon_sym_xmlns, 2137 | ACTIONS(133), 1, 2138 | sym_name, 2139 | ACTIONS(193), 1, 2140 | anon_sym_SLASH, 2141 | STATE(93), 1, 2142 | sym_attribute, 2143 | STATE(94), 2, 2144 | sym_ns_decl, 2145 | sym_xml_attr, 2146 | [943] = 7, 2147 | ACTIONS(9), 1, 2148 | sym__ws, 2149 | ACTIONS(131), 1, 2150 | anon_sym_xmlns, 2151 | ACTIONS(133), 1, 2152 | sym_name, 2153 | ACTIONS(153), 1, 2154 | anon_sym_GT, 2155 | ACTIONS(195), 1, 2156 | anon_sym_SLASH, 2157 | STATE(93), 1, 2158 | sym_attribute, 2159 | STATE(94), 2, 2160 | sym_ns_decl, 2161 | sym_xml_attr, 2162 | [966] = 3, 2163 | ACTIONS(9), 1, 2164 | sym__ws, 2165 | ACTIONS(199), 3, 2166 | anon_sym_LT, 2167 | sym_char_data, 2168 | anon_sym_AMP, 2169 | ACTIONS(197), 4, 2170 | anon_sym_LT_QMARK, 2171 | anon_sym_LT_BANG_DASH_DASH, 2172 | sym_char_ref, 2173 | sym_cdata_start, 2174 | [981] = 3, 2175 | ACTIONS(9), 1, 2176 | sym__ws, 2177 | ACTIONS(203), 2, 2178 | anon_sym_LT, 2179 | anon_sym_AMP, 2180 | ACTIONS(201), 4, 2181 | anon_sym_LT_QMARK, 2182 | anon_sym_LT_BANG_DASH_DASH, 2183 | sym_char_ref, 2184 | sym_cdata_start, 2185 | [995] = 5, 2186 | ACTIONS(9), 1, 2187 | sym__ws, 2188 | ACTIONS(131), 1, 2189 | anon_sym_xmlns, 2190 | ACTIONS(133), 1, 2191 | sym_name, 2192 | STATE(93), 1, 2193 | sym_attribute, 2194 | STATE(94), 2, 2195 | sym_ns_decl, 2196 | sym_xml_attr, 2197 | [1012] = 5, 2198 | ACTIONS(9), 1, 2199 | sym__ws, 2200 | ACTIONS(205), 1, 2201 | anon_sym_LT, 2202 | STATE(2), 1, 2203 | sym_tag_start, 2204 | STATE(13), 1, 2205 | sym_element, 2206 | STATE(53), 2, 2207 | sym_end_tag_element, 2208 | sym_empty_element, 2209 | [1029] = 3, 2210 | ACTIONS(3), 1, 2211 | sym__ws, 2212 | ACTIONS(199), 2, 2213 | aux_sym_attr_value_token1, 2214 | anon_sym_AMP, 2215 | ACTIONS(197), 3, 2216 | sym_char_ref, 2217 | anon_sym_DQUOTE, 2218 | anon_sym_SQUOTE, 2219 | [1042] = 3, 2220 | ACTIONS(3), 1, 2221 | sym__ws, 2222 | ACTIONS(167), 1, 2223 | sym__char, 2224 | ACTIONS(165), 3, 2225 | ts_builtin_sym_end, 2226 | anon_sym_LT_QMARK, 2227 | anon_sym_LT_BANG_DASH_DASH, 2228 | [1054] = 3, 2229 | ACTIONS(3), 1, 2230 | sym__ws, 2231 | ACTIONS(137), 1, 2232 | sym__char, 2233 | ACTIONS(135), 3, 2234 | ts_builtin_sym_end, 2235 | anon_sym_LT_QMARK, 2236 | anon_sym_LT_BANG_DASH_DASH, 2237 | [1066] = 3, 2238 | ACTIONS(3), 1, 2239 | sym__ws, 2240 | ACTIONS(175), 1, 2241 | sym__char, 2242 | ACTIONS(173), 3, 2243 | ts_builtin_sym_end, 2244 | anon_sym_LT_QMARK, 2245 | anon_sym_LT_BANG_DASH_DASH, 2246 | [1078] = 3, 2247 | ACTIONS(3), 1, 2248 | sym__ws, 2249 | ACTIONS(121), 1, 2250 | sym__char, 2251 | ACTIONS(119), 3, 2252 | ts_builtin_sym_end, 2253 | anon_sym_LT_QMARK, 2254 | anon_sym_LT_BANG_DASH_DASH, 2255 | [1090] = 4, 2256 | ACTIONS(9), 1, 2257 | sym__ws, 2258 | STATE(11), 1, 2259 | sym__quote, 2260 | STATE(98), 1, 2261 | sym_attr_value, 2262 | ACTIONS(207), 2, 2263 | anon_sym_DQUOTE, 2264 | anon_sym_SQUOTE, 2265 | [1104] = 3, 2266 | ACTIONS(3), 1, 2267 | sym__ws, 2268 | ACTIONS(149), 1, 2269 | sym__char, 2270 | ACTIONS(147), 3, 2271 | ts_builtin_sym_end, 2272 | anon_sym_LT_QMARK, 2273 | anon_sym_LT_BANG_DASH_DASH, 2274 | [1116] = 3, 2275 | ACTIONS(3), 1, 2276 | sym__ws, 2277 | ACTIONS(191), 1, 2278 | sym__char, 2279 | ACTIONS(189), 3, 2280 | ts_builtin_sym_end, 2281 | anon_sym_LT_QMARK, 2282 | anon_sym_LT_BANG_DASH_DASH, 2283 | [1128] = 5, 2284 | ACTIONS(3), 1, 2285 | sym__ws, 2286 | ACTIONS(209), 1, 2287 | sym_cdata_end, 2288 | ACTIONS(211), 1, 2289 | sym__char, 2290 | STATE(85), 1, 2291 | aux_sym_pi_repeat1, 2292 | STATE(123), 1, 2293 | sym_cdata, 2294 | [1144] = 4, 2295 | ACTIONS(9), 1, 2296 | sym__ws, 2297 | STATE(139), 1, 2298 | sym__quote, 2299 | STATE(143), 1, 2300 | sym_xml_encoding_value, 2301 | ACTIONS(213), 2, 2302 | anon_sym_DQUOTE, 2303 | anon_sym_SQUOTE, 2304 | [1158] = 3, 2305 | ACTIONS(3), 1, 2306 | sym__ws, 2307 | ACTIONS(117), 1, 2308 | sym__char, 2309 | ACTIONS(115), 3, 2310 | ts_builtin_sym_end, 2311 | anon_sym_LT_QMARK, 2312 | anon_sym_LT_BANG_DASH_DASH, 2313 | [1170] = 3, 2314 | ACTIONS(3), 1, 2315 | sym__ws, 2316 | ACTIONS(145), 1, 2317 | sym__char, 2318 | ACTIONS(143), 3, 2319 | ts_builtin_sym_end, 2320 | anon_sym_LT_QMARK, 2321 | anon_sym_LT_BANG_DASH_DASH, 2322 | [1182] = 3, 2323 | ACTIONS(3), 1, 2324 | sym__ws, 2325 | ACTIONS(113), 1, 2326 | sym__char, 2327 | ACTIONS(111), 3, 2328 | ts_builtin_sym_end, 2329 | anon_sym_LT_QMARK, 2330 | anon_sym_LT_BANG_DASH_DASH, 2331 | [1194] = 3, 2332 | ACTIONS(3), 1, 2333 | sym__ws, 2334 | ACTIONS(101), 1, 2335 | sym__char, 2336 | ACTIONS(99), 3, 2337 | ts_builtin_sym_end, 2338 | anon_sym_LT_QMARK, 2339 | anon_sym_LT_BANG_DASH_DASH, 2340 | [1206] = 3, 2341 | ACTIONS(3), 1, 2342 | sym__ws, 2343 | ACTIONS(163), 1, 2344 | sym__char, 2345 | ACTIONS(161), 3, 2346 | ts_builtin_sym_end, 2347 | anon_sym_LT_QMARK, 2348 | anon_sym_LT_BANG_DASH_DASH, 2349 | [1218] = 3, 2350 | ACTIONS(3), 1, 2351 | sym__ws, 2352 | ACTIONS(109), 1, 2353 | sym__char, 2354 | ACTIONS(107), 3, 2355 | ts_builtin_sym_end, 2356 | anon_sym_LT_QMARK, 2357 | anon_sym_LT_BANG_DASH_DASH, 2358 | [1230] = 4, 2359 | ACTIONS(9), 1, 2360 | sym__ws, 2361 | STATE(102), 1, 2362 | sym__quote, 2363 | STATE(105), 1, 2364 | sym_xml_version_value, 2365 | ACTIONS(215), 2, 2366 | anon_sym_DQUOTE, 2367 | anon_sym_SQUOTE, 2368 | [1244] = 3, 2369 | ACTIONS(3), 1, 2370 | sym__ws, 2371 | ACTIONS(141), 1, 2372 | sym__char, 2373 | ACTIONS(139), 3, 2374 | ts_builtin_sym_end, 2375 | anon_sym_LT_QMARK, 2376 | anon_sym_LT_BANG_DASH_DASH, 2377 | [1256] = 3, 2378 | ACTIONS(3), 1, 2379 | sym__ws, 2380 | ACTIONS(105), 1, 2381 | sym__char, 2382 | ACTIONS(103), 3, 2383 | ts_builtin_sym_end, 2384 | anon_sym_LT_QMARK, 2385 | anon_sym_LT_BANG_DASH_DASH, 2386 | [1268] = 4, 2387 | ACTIONS(9), 1, 2388 | sym__ws, 2389 | STATE(11), 1, 2390 | sym__quote, 2391 | STATE(88), 1, 2392 | sym_attr_value, 2393 | ACTIONS(207), 2, 2394 | anon_sym_DQUOTE, 2395 | anon_sym_SQUOTE, 2396 | [1282] = 4, 2397 | ACTIONS(9), 1, 2398 | sym__ws, 2399 | STATE(11), 1, 2400 | sym__quote, 2401 | STATE(90), 1, 2402 | sym_attr_value, 2403 | ACTIONS(207), 2, 2404 | anon_sym_DQUOTE, 2405 | anon_sym_SQUOTE, 2406 | [1296] = 4, 2407 | ACTIONS(3), 1, 2408 | sym__ws, 2409 | ACTIONS(217), 1, 2410 | anon_sym_QMARK_GT, 2411 | ACTIONS(219), 1, 2412 | sym__char, 2413 | STATE(75), 1, 2414 | aux_sym_pi_repeat1, 2415 | [1309] = 4, 2416 | ACTIONS(129), 1, 2417 | anon_sym_GT, 2418 | ACTIONS(193), 1, 2419 | anon_sym_SLASH, 2420 | ACTIONS(221), 1, 2421 | sym__ws, 2422 | STATE(81), 1, 2423 | aux_sym_empty_element_repeat1, 2424 | [1322] = 4, 2425 | ACTIONS(3), 1, 2426 | sym__ws, 2427 | ACTIONS(223), 1, 2428 | anon_sym_QMARK_GT, 2429 | ACTIONS(225), 1, 2430 | sym__char, 2431 | STATE(74), 1, 2432 | aux_sym_pi_repeat1, 2433 | [1335] = 4, 2434 | ACTIONS(3), 1, 2435 | sym__ws, 2436 | ACTIONS(227), 1, 2437 | sym_cdata_end, 2438 | ACTIONS(229), 1, 2439 | sym__char, 2440 | STATE(71), 1, 2441 | aux_sym_pi_repeat1, 2442 | [1348] = 4, 2443 | ACTIONS(127), 1, 2444 | anon_sym_SLASH, 2445 | ACTIONS(129), 1, 2446 | anon_sym_GT, 2447 | ACTIONS(232), 1, 2448 | sym__ws, 2449 | STATE(81), 1, 2450 | aux_sym_empty_element_repeat1, 2451 | [1361] = 4, 2452 | ACTIONS(3), 1, 2453 | sym__ws, 2454 | ACTIONS(234), 1, 2455 | anon_sym_DASH_DASH_GT, 2456 | ACTIONS(236), 1, 2457 | sym__char, 2458 | STATE(77), 1, 2459 | aux_sym_pi_repeat1, 2460 | [1374] = 4, 2461 | ACTIONS(3), 1, 2462 | sym__ws, 2463 | ACTIONS(227), 1, 2464 | anon_sym_QMARK_GT, 2465 | ACTIONS(238), 1, 2466 | sym__char, 2467 | STATE(74), 1, 2468 | aux_sym_pi_repeat1, 2469 | [1387] = 4, 2470 | ACTIONS(3), 1, 2471 | sym__ws, 2472 | ACTIONS(225), 1, 2473 | sym__char, 2474 | ACTIONS(241), 1, 2475 | anon_sym_QMARK_GT, 2476 | STATE(74), 1, 2477 | aux_sym_pi_repeat1, 2478 | [1400] = 4, 2479 | ACTIONS(243), 1, 2480 | anon_sym_SLASH, 2481 | ACTIONS(245), 1, 2482 | anon_sym_GT, 2483 | ACTIONS(247), 1, 2484 | sym__ws, 2485 | STATE(72), 1, 2486 | aux_sym_empty_element_repeat1, 2487 | [1413] = 4, 2488 | ACTIONS(3), 1, 2489 | sym__ws, 2490 | ACTIONS(249), 1, 2491 | anon_sym_DASH_DASH_GT, 2492 | ACTIONS(251), 1, 2493 | sym__char, 2494 | STATE(78), 1, 2495 | aux_sym_pi_repeat1, 2496 | [1426] = 4, 2497 | ACTIONS(3), 1, 2498 | sym__ws, 2499 | ACTIONS(227), 1, 2500 | anon_sym_DASH_DASH_GT, 2501 | ACTIONS(253), 1, 2502 | sym__char, 2503 | STATE(78), 1, 2504 | aux_sym_pi_repeat1, 2505 | [1439] = 3, 2506 | ACTIONS(9), 1, 2507 | sym__ws, 2508 | STATE(103), 1, 2509 | sym__quote, 2510 | ACTIONS(256), 2, 2511 | anon_sym_DQUOTE, 2512 | anon_sym_SQUOTE, 2513 | [1450] = 4, 2514 | ACTIONS(245), 1, 2515 | anon_sym_GT, 2516 | ACTIONS(258), 1, 2517 | anon_sym_SLASH, 2518 | ACTIONS(260), 1, 2519 | sym__ws, 2520 | STATE(69), 1, 2521 | aux_sym_empty_element_repeat1, 2522 | [1463] = 3, 2523 | ACTIONS(264), 1, 2524 | sym__ws, 2525 | STATE(81), 1, 2526 | aux_sym_empty_element_repeat1, 2527 | ACTIONS(262), 2, 2528 | anon_sym_SLASH, 2529 | anon_sym_GT, 2530 | [1474] = 4, 2531 | ACTIONS(3), 1, 2532 | sym__ws, 2533 | ACTIONS(267), 1, 2534 | anon_sym_DASH_DASH_GT, 2535 | ACTIONS(269), 1, 2536 | sym__char, 2537 | STATE(84), 1, 2538 | aux_sym_pi_repeat1, 2539 | [1487] = 3, 2540 | ACTIONS(9), 1, 2541 | sym__ws, 2542 | STATE(122), 1, 2543 | sym__quote, 2544 | ACTIONS(271), 2, 2545 | anon_sym_DQUOTE, 2546 | anon_sym_SQUOTE, 2547 | [1498] = 4, 2548 | ACTIONS(3), 1, 2549 | sym__ws, 2550 | ACTIONS(251), 1, 2551 | sym__char, 2552 | ACTIONS(273), 1, 2553 | anon_sym_DASH_DASH_GT, 2554 | STATE(78), 1, 2555 | aux_sym_pi_repeat1, 2556 | [1511] = 4, 2557 | ACTIONS(3), 1, 2558 | sym__ws, 2559 | ACTIONS(275), 1, 2560 | sym_cdata_end, 2561 | ACTIONS(277), 1, 2562 | sym__char, 2563 | STATE(71), 1, 2564 | aux_sym_pi_repeat1, 2565 | [1524] = 4, 2566 | ACTIONS(3), 1, 2567 | sym__ws, 2568 | ACTIONS(279), 1, 2569 | anon_sym_QMARK_GT, 2570 | ACTIONS(281), 1, 2571 | sym__char, 2572 | STATE(70), 1, 2573 | aux_sym_pi_repeat1, 2574 | [1537] = 1, 2575 | ACTIONS(283), 3, 2576 | anon_sym_SLASH, 2577 | anon_sym_GT, 2578 | sym__ws, 2579 | [1543] = 1, 2580 | ACTIONS(285), 3, 2581 | anon_sym_SLASH, 2582 | anon_sym_GT, 2583 | sym__ws, 2584 | [1549] = 3, 2585 | ACTIONS(9), 1, 2586 | sym__ws, 2587 | ACTIONS(287), 1, 2588 | anon_sym_SLASH, 2589 | ACTIONS(289), 1, 2590 | sym_name, 2591 | [1559] = 1, 2592 | ACTIONS(291), 3, 2593 | anon_sym_SLASH, 2594 | anon_sym_GT, 2595 | sym__ws, 2596 | [1565] = 3, 2597 | ACTIONS(9), 1, 2598 | sym__ws, 2599 | ACTIONS(293), 1, 2600 | anon_sym_QMARK_GT, 2601 | ACTIONS(295), 1, 2602 | anon_sym_encoding, 2603 | [1575] = 3, 2604 | ACTIONS(9), 1, 2605 | sym__ws, 2606 | ACTIONS(297), 1, 2607 | anon_sym_COLON, 2608 | ACTIONS(299), 1, 2609 | sym_eq, 2610 | [1585] = 1, 2611 | ACTIONS(262), 3, 2612 | anon_sym_SLASH, 2613 | anon_sym_GT, 2614 | sym__ws, 2615 | [1591] = 1, 2616 | ACTIONS(301), 3, 2617 | anon_sym_SLASH, 2618 | anon_sym_GT, 2619 | sym__ws, 2620 | [1597] = 3, 2621 | ACTIONS(9), 1, 2622 | sym__ws, 2623 | ACTIONS(289), 1, 2624 | sym_name, 2625 | ACTIONS(303), 1, 2626 | anon_sym_SLASH, 2627 | [1607] = 1, 2628 | ACTIONS(305), 3, 2629 | anon_sym_SLASH, 2630 | anon_sym_GT, 2631 | sym__ws, 2632 | [1613] = 3, 2633 | ACTIONS(307), 1, 2634 | anon_sym_QMARK_GT, 2635 | ACTIONS(309), 1, 2636 | sym__ws, 2637 | STATE(135), 1, 2638 | sym_xml_encoding, 2639 | [1623] = 1, 2640 | ACTIONS(311), 3, 2641 | anon_sym_SLASH, 2642 | anon_sym_GT, 2643 | sym__ws, 2644 | [1629] = 2, 2645 | ACTIONS(9), 1, 2646 | sym__ws, 2647 | ACTIONS(313), 1, 2648 | sym_name, 2649 | [1636] = 2, 2650 | ACTIONS(315), 1, 2651 | sym__ws, 2652 | STATE(97), 1, 2653 | sym_xml_version, 2654 | [1643] = 2, 2655 | ACTIONS(9), 1, 2656 | sym__ws, 2657 | ACTIONS(317), 1, 2658 | anon_sym_LT, 2659 | [1650] = 2, 2660 | ACTIONS(9), 1, 2661 | sym__ws, 2662 | ACTIONS(319), 1, 2663 | sym__dec_num, 2664 | [1657] = 1, 2665 | ACTIONS(321), 2, 2666 | anon_sym_QMARK_GT, 2667 | sym__ws, 2668 | [1662] = 2, 2669 | ACTIONS(9), 1, 2670 | sym__ws, 2671 | ACTIONS(323), 1, 2672 | sym_name, 2673 | [1669] = 1, 2674 | ACTIONS(325), 2, 2675 | anon_sym_QMARK_GT, 2676 | sym__ws, 2677 | [1674] = 2, 2678 | ACTIONS(9), 1, 2679 | sym__ws, 2680 | ACTIONS(327), 1, 2681 | anon_sym_GT, 2682 | [1681] = 2, 2683 | ACTIONS(329), 1, 2684 | anon_sym_QMARK_GT, 2685 | ACTIONS(331), 1, 2686 | sym__ws, 2687 | [1688] = 2, 2688 | ACTIONS(9), 1, 2689 | sym__ws, 2690 | ACTIONS(333), 1, 2691 | anon_sym_SEMI, 2692 | [1695] = 2, 2693 | ACTIONS(9), 1, 2694 | sym__ws, 2695 | ACTIONS(335), 1, 2696 | anon_sym_GT, 2697 | [1702] = 2, 2698 | ACTIONS(9), 1, 2699 | sym__ws, 2700 | ACTIONS(337), 1, 2701 | anon_sym_xml, 2702 | [1709] = 2, 2703 | ACTIONS(9), 1, 2704 | sym__ws, 2705 | ACTIONS(339), 1, 2706 | anon_sym_version, 2707 | [1716] = 2, 2708 | ACTIONS(9), 1, 2709 | sym__ws, 2710 | ACTIONS(341), 1, 2711 | anon_sym_GT, 2712 | [1723] = 2, 2713 | ACTIONS(9), 1, 2714 | sym__ws, 2715 | ACTIONS(343), 1, 2716 | sym_name, 2717 | [1730] = 2, 2718 | ACTIONS(9), 1, 2719 | sym__ws, 2720 | ACTIONS(345), 1, 2721 | sym_name, 2722 | [1737] = 2, 2723 | ACTIONS(9), 1, 2724 | sym__ws, 2725 | ACTIONS(347), 1, 2726 | sym_eq, 2727 | [1744] = 2, 2728 | ACTIONS(9), 1, 2729 | sym__ws, 2730 | ACTIONS(349), 1, 2731 | sym_eq, 2732 | [1751] = 2, 2733 | ACTIONS(9), 1, 2734 | sym__ws, 2735 | ACTIONS(351), 1, 2736 | anon_sym_QMARK_GT, 2737 | [1758] = 2, 2738 | ACTIONS(9), 1, 2739 | sym__ws, 2740 | ACTIONS(353), 1, 2741 | sym_name, 2742 | [1765] = 2, 2743 | ACTIONS(9), 1, 2744 | sym__ws, 2745 | ACTIONS(355), 1, 2746 | sym_eq, 2747 | [1772] = 2, 2748 | ACTIONS(9), 1, 2749 | sym__ws, 2750 | ACTIONS(357), 1, 2751 | anon_sym_LT, 2752 | [1779] = 2, 2753 | ACTIONS(359), 1, 2754 | anon_sym_GT, 2755 | ACTIONS(361), 1, 2756 | sym__ws, 2757 | [1786] = 1, 2758 | ACTIONS(363), 2, 2759 | anon_sym_QMARK_GT, 2760 | sym__ws, 2761 | [1791] = 2, 2762 | ACTIONS(9), 1, 2763 | sym__ws, 2764 | ACTIONS(365), 1, 2765 | sym_cdata_end, 2766 | [1798] = 2, 2767 | ACTIONS(9), 1, 2768 | sym__ws, 2769 | ACTIONS(367), 1, 2770 | anon_sym_GT, 2771 | [1805] = 2, 2772 | ACTIONS(369), 1, 2773 | anon_sym_QMARK_GT, 2774 | ACTIONS(371), 1, 2775 | sym__ws, 2776 | [1812] = 2, 2777 | ACTIONS(9), 1, 2778 | sym__ws, 2779 | ACTIONS(373), 1, 2780 | sym_eq, 2781 | [1819] = 2, 2782 | ACTIONS(9), 1, 2783 | sym__ws, 2784 | ACTIONS(375), 1, 2785 | anon_sym_LT, 2786 | [1826] = 2, 2787 | ACTIONS(9), 1, 2788 | sym__ws, 2789 | ACTIONS(377), 1, 2790 | anon_sym_SEMI, 2791 | [1833] = 2, 2792 | ACTIONS(9), 1, 2793 | sym__ws, 2794 | ACTIONS(379), 1, 2795 | anon_sym_GT, 2796 | [1840] = 2, 2797 | ACTIONS(9), 1, 2798 | sym__ws, 2799 | ACTIONS(381), 1, 2800 | anon_sym_COLON, 2801 | [1847] = 2, 2802 | ACTIONS(383), 1, 2803 | anon_sym_GT, 2804 | ACTIONS(385), 1, 2805 | sym__ws, 2806 | [1854] = 2, 2807 | ACTIONS(9), 1, 2808 | sym__ws, 2809 | ACTIONS(387), 1, 2810 | anon_sym_GT, 2811 | [1861] = 2, 2812 | ACTIONS(9), 1, 2813 | sym__ws, 2814 | ACTIONS(389), 1, 2815 | anon_sym_GT, 2816 | [1868] = 2, 2817 | ACTIONS(9), 1, 2818 | sym__ws, 2819 | ACTIONS(391), 1, 2820 | anon_sym_GT, 2821 | [1875] = 2, 2822 | ACTIONS(293), 1, 2823 | anon_sym_QMARK_GT, 2824 | ACTIONS(393), 1, 2825 | sym__ws, 2826 | [1882] = 2, 2827 | ACTIONS(9), 1, 2828 | sym__ws, 2829 | ACTIONS(395), 1, 2830 | sym_name, 2831 | [1889] = 2, 2832 | ACTIONS(9), 1, 2833 | sym__ws, 2834 | ACTIONS(397), 1, 2835 | sym_name, 2836 | [1896] = 2, 2837 | ACTIONS(9), 1, 2838 | sym__ws, 2839 | ACTIONS(399), 1, 2840 | ts_builtin_sym_end, 2841 | [1903] = 2, 2842 | ACTIONS(9), 1, 2843 | sym__ws, 2844 | ACTIONS(401), 1, 2845 | sym__encoding, 2846 | [1910] = 2, 2847 | ACTIONS(9), 1, 2848 | sym__ws, 2849 | ACTIONS(403), 1, 2850 | sym_name, 2851 | [1917] = 2, 2852 | ACTIONS(9), 1, 2853 | sym__ws, 2854 | ACTIONS(405), 1, 2855 | sym_name, 2856 | [1924] = 2, 2857 | ACTIONS(9), 1, 2858 | sym__ws, 2859 | ACTIONS(289), 1, 2860 | sym_name, 2861 | [1931] = 1, 2862 | ACTIONS(407), 2, 2863 | anon_sym_QMARK_GT, 2864 | sym__ws, 2865 | }; 2866 | 2867 | static const uint32_t ts_small_parse_table_map[] = { 2868 | [SMALL_STATE(2)] = 0, 2869 | [SMALL_STATE(3)] = 46, 2870 | [SMALL_STATE(4)] = 92, 2871 | [SMALL_STATE(5)] = 135, 2872 | [SMALL_STATE(6)] = 178, 2873 | [SMALL_STATE(7)] = 221, 2874 | [SMALL_STATE(8)] = 264, 2875 | [SMALL_STATE(9)] = 307, 2876 | [SMALL_STATE(10)] = 350, 2877 | [SMALL_STATE(11)] = 390, 2878 | [SMALL_STATE(12)] = 415, 2879 | [SMALL_STATE(13)] = 440, 2880 | [SMALL_STATE(14)] = 462, 2881 | [SMALL_STATE(15)] = 484, 2882 | [SMALL_STATE(16)] = 506, 2883 | [SMALL_STATE(17)] = 528, 2884 | [SMALL_STATE(18)] = 550, 2885 | [SMALL_STATE(19)] = 572, 2886 | [SMALL_STATE(20)] = 587, 2887 | [SMALL_STATE(21)] = 602, 2888 | [SMALL_STATE(22)] = 617, 2889 | [SMALL_STATE(23)] = 632, 2890 | [SMALL_STATE(24)] = 647, 2891 | [SMALL_STATE(25)] = 662, 2892 | [SMALL_STATE(26)] = 677, 2893 | [SMALL_STATE(27)] = 700, 2894 | [SMALL_STATE(28)] = 715, 2895 | [SMALL_STATE(29)] = 730, 2896 | [SMALL_STATE(30)] = 745, 2897 | [SMALL_STATE(31)] = 760, 2898 | [SMALL_STATE(32)] = 783, 2899 | [SMALL_STATE(33)] = 800, 2900 | [SMALL_STATE(34)] = 815, 2901 | [SMALL_STATE(35)] = 830, 2902 | [SMALL_STATE(36)] = 845, 2903 | [SMALL_STATE(37)] = 860, 2904 | [SMALL_STATE(38)] = 875, 2905 | [SMALL_STATE(39)] = 890, 2906 | [SMALL_STATE(40)] = 905, 2907 | [SMALL_STATE(41)] = 920, 2908 | [SMALL_STATE(42)] = 943, 2909 | [SMALL_STATE(43)] = 966, 2910 | [SMALL_STATE(44)] = 981, 2911 | [SMALL_STATE(45)] = 995, 2912 | [SMALL_STATE(46)] = 1012, 2913 | [SMALL_STATE(47)] = 1029, 2914 | [SMALL_STATE(48)] = 1042, 2915 | [SMALL_STATE(49)] = 1054, 2916 | [SMALL_STATE(50)] = 1066, 2917 | [SMALL_STATE(51)] = 1078, 2918 | [SMALL_STATE(52)] = 1090, 2919 | [SMALL_STATE(53)] = 1104, 2920 | [SMALL_STATE(54)] = 1116, 2921 | [SMALL_STATE(55)] = 1128, 2922 | [SMALL_STATE(56)] = 1144, 2923 | [SMALL_STATE(57)] = 1158, 2924 | [SMALL_STATE(58)] = 1170, 2925 | [SMALL_STATE(59)] = 1182, 2926 | [SMALL_STATE(60)] = 1194, 2927 | [SMALL_STATE(61)] = 1206, 2928 | [SMALL_STATE(62)] = 1218, 2929 | [SMALL_STATE(63)] = 1230, 2930 | [SMALL_STATE(64)] = 1244, 2931 | [SMALL_STATE(65)] = 1256, 2932 | [SMALL_STATE(66)] = 1268, 2933 | [SMALL_STATE(67)] = 1282, 2934 | [SMALL_STATE(68)] = 1296, 2935 | [SMALL_STATE(69)] = 1309, 2936 | [SMALL_STATE(70)] = 1322, 2937 | [SMALL_STATE(71)] = 1335, 2938 | [SMALL_STATE(72)] = 1348, 2939 | [SMALL_STATE(73)] = 1361, 2940 | [SMALL_STATE(74)] = 1374, 2941 | [SMALL_STATE(75)] = 1387, 2942 | [SMALL_STATE(76)] = 1400, 2943 | [SMALL_STATE(77)] = 1413, 2944 | [SMALL_STATE(78)] = 1426, 2945 | [SMALL_STATE(79)] = 1439, 2946 | [SMALL_STATE(80)] = 1450, 2947 | [SMALL_STATE(81)] = 1463, 2948 | [SMALL_STATE(82)] = 1474, 2949 | [SMALL_STATE(83)] = 1487, 2950 | [SMALL_STATE(84)] = 1498, 2951 | [SMALL_STATE(85)] = 1511, 2952 | [SMALL_STATE(86)] = 1524, 2953 | [SMALL_STATE(87)] = 1537, 2954 | [SMALL_STATE(88)] = 1543, 2955 | [SMALL_STATE(89)] = 1549, 2956 | [SMALL_STATE(90)] = 1559, 2957 | [SMALL_STATE(91)] = 1565, 2958 | [SMALL_STATE(92)] = 1575, 2959 | [SMALL_STATE(93)] = 1585, 2960 | [SMALL_STATE(94)] = 1591, 2961 | [SMALL_STATE(95)] = 1597, 2962 | [SMALL_STATE(96)] = 1607, 2963 | [SMALL_STATE(97)] = 1613, 2964 | [SMALL_STATE(98)] = 1623, 2965 | [SMALL_STATE(99)] = 1629, 2966 | [SMALL_STATE(100)] = 1636, 2967 | [SMALL_STATE(101)] = 1643, 2968 | [SMALL_STATE(102)] = 1650, 2969 | [SMALL_STATE(103)] = 1657, 2970 | [SMALL_STATE(104)] = 1662, 2971 | [SMALL_STATE(105)] = 1669, 2972 | [SMALL_STATE(106)] = 1674, 2973 | [SMALL_STATE(107)] = 1681, 2974 | [SMALL_STATE(108)] = 1688, 2975 | [SMALL_STATE(109)] = 1695, 2976 | [SMALL_STATE(110)] = 1702, 2977 | [SMALL_STATE(111)] = 1709, 2978 | [SMALL_STATE(112)] = 1716, 2979 | [SMALL_STATE(113)] = 1723, 2980 | [SMALL_STATE(114)] = 1730, 2981 | [SMALL_STATE(115)] = 1737, 2982 | [SMALL_STATE(116)] = 1744, 2983 | [SMALL_STATE(117)] = 1751, 2984 | [SMALL_STATE(118)] = 1758, 2985 | [SMALL_STATE(119)] = 1765, 2986 | [SMALL_STATE(120)] = 1772, 2987 | [SMALL_STATE(121)] = 1779, 2988 | [SMALL_STATE(122)] = 1786, 2989 | [SMALL_STATE(123)] = 1791, 2990 | [SMALL_STATE(124)] = 1798, 2991 | [SMALL_STATE(125)] = 1805, 2992 | [SMALL_STATE(126)] = 1812, 2993 | [SMALL_STATE(127)] = 1819, 2994 | [SMALL_STATE(128)] = 1826, 2995 | [SMALL_STATE(129)] = 1833, 2996 | [SMALL_STATE(130)] = 1840, 2997 | [SMALL_STATE(131)] = 1847, 2998 | [SMALL_STATE(132)] = 1854, 2999 | [SMALL_STATE(133)] = 1861, 3000 | [SMALL_STATE(134)] = 1868, 3001 | [SMALL_STATE(135)] = 1875, 3002 | [SMALL_STATE(136)] = 1882, 3003 | [SMALL_STATE(137)] = 1889, 3004 | [SMALL_STATE(138)] = 1896, 3005 | [SMALL_STATE(139)] = 1903, 3006 | [SMALL_STATE(140)] = 1910, 3007 | [SMALL_STATE(141)] = 1917, 3008 | [SMALL_STATE(142)] = 1924, 3009 | [SMALL_STATE(143)] = 1931, 3010 | }; 3011 | 3012 | static const TSParseActionEntry ts_parse_actions[] = { 3013 | [0] = {.entry = {.count = 0, .reusable = false}}, 3014 | [1] = {.entry = {.count = 1, .reusable = false}}, RECOVER(), 3015 | [3] = {.entry = {.count = 1, .reusable = false}}, SHIFT_EXTRA(), 3016 | [5] = {.entry = {.count = 1, .reusable = true}}, SHIFT(110), 3017 | [7] = {.entry = {.count = 1, .reusable = false}}, SHIFT(141), 3018 | [9] = {.entry = {.count = 1, .reusable = true}}, SHIFT_EXTRA(), 3019 | [11] = {.entry = {.count = 1, .reusable = true}}, SHIFT(136), 3020 | [13] = {.entry = {.count = 1, .reusable = false}}, SHIFT(95), 3021 | [15] = {.entry = {.count = 1, .reusable = true}}, SHIFT(82), 3022 | [17] = {.entry = {.count = 1, .reusable = false}}, SHIFT(8), 3023 | [19] = {.entry = {.count = 1, .reusable = true}}, SHIFT(32), 3024 | [21] = {.entry = {.count = 1, .reusable = true}}, SHIFT(55), 3025 | [23] = {.entry = {.count = 1, .reusable = false}}, SHIFT(114), 3026 | [25] = {.entry = {.count = 1, .reusable = false}}, SHIFT(89), 3027 | [27] = {.entry = {.count = 1, .reusable = false}}, SHIFT(6), 3028 | [29] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym__content, 2), SHIFT_REPEAT(136), 3029 | [32] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym__content, 2), SHIFT_REPEAT(142), 3030 | [35] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym__content, 2), SHIFT_REPEAT(82), 3031 | [38] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym__content, 2), SHIFT_REPEAT(32), 3032 | [41] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym__content, 2), SHIFT_REPEAT(55), 3033 | [44] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym__content, 2), SHIFT_REPEAT(114), 3034 | [47] = {.entry = {.count = 1, .reusable = false}}, SHIFT(12), 3035 | [49] = {.entry = {.count = 1, .reusable = true}}, SHIFT(12), 3036 | [51] = {.entry = {.count = 1, .reusable = false}}, SHIFT(137), 3037 | [53] = {.entry = {.count = 1, .reusable = true}}, SHIFT(87), 3038 | [55] = {.entry = {.count = 1, .reusable = false}}, SHIFT(17), 3039 | [57] = {.entry = {.count = 1, .reusable = true}}, SHIFT(17), 3040 | [59] = {.entry = {.count = 1, .reusable = true}}, SHIFT(96), 3041 | [61] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_xml_file, 2), 3042 | [63] = {.entry = {.count = 1, .reusable = true}}, SHIFT(118), 3043 | [65] = {.entry = {.count = 1, .reusable = true}}, SHIFT(73), 3044 | [67] = {.entry = {.count = 1, .reusable = false}}, SHIFT(14), 3045 | [69] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_xml_file, 3), 3046 | [71] = {.entry = {.count = 1, .reusable = false}}, SHIFT(18), 3047 | [73] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_xml_file, 1), 3048 | [75] = {.entry = {.count = 1, .reusable = false}}, SHIFT(16), 3049 | [77] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_attr_value_repeat1, 2), SHIFT_REPEAT(17), 3050 | [80] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_attr_value_repeat1, 2), SHIFT_REPEAT(17), 3051 | [83] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_attr_value_repeat1, 2), SHIFT_REPEAT(137), 3052 | [86] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_attr_value_repeat1, 2), 3053 | [88] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_xml_file_repeat1, 2), 3054 | [90] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_xml_file_repeat1, 2), SHIFT_REPEAT(118), 3055 | [93] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_xml_file_repeat1, 2), SHIFT_REPEAT(73), 3056 | [96] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_xml_file_repeat1, 2), SHIFT_REPEAT(18), 3057 | [99] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_pi, 5), 3058 | [101] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_pi, 5), 3059 | [103] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_empty_element, 5, .production_id = 1), 3060 | [105] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_empty_element, 5, .production_id = 1), 3061 | [107] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_end_tag_element, 4), 3062 | [109] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_end_tag_element, 4), 3063 | [111] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_comment, 3), 3064 | [113] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_comment, 3), 3065 | [115] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_pi, 3), 3066 | [117] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_pi, 3), 3067 | [119] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_empty_element, 4, .production_id = 1), 3068 | [121] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_empty_element, 4, .production_id = 1), 3069 | [123] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_tag_start, 3, .production_id = 1), 3070 | [125] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_tag_start, 3, .production_id = 1), 3071 | [127] = {.entry = {.count = 1, .reusable = true}}, SHIFT(133), 3072 | [129] = {.entry = {.count = 1, .reusable = true}}, SHIFT(39), 3073 | [131] = {.entry = {.count = 1, .reusable = false}}, SHIFT(130), 3074 | [133] = {.entry = {.count = 1, .reusable = false}}, SHIFT(92), 3075 | [135] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_end_tag_element, 3), 3076 | [137] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_end_tag_element, 3), 3077 | [139] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_comment, 2), 3078 | [141] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_comment, 2), 3079 | [143] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_end_tag_element, 2), 3080 | [145] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_end_tag_element, 2), 3081 | [147] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_element, 1), 3082 | [149] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_element, 1), 3083 | [151] = {.entry = {.count = 1, .reusable = true}}, SHIFT(132), 3084 | [153] = {.entry = {.count = 1, .reusable = true}}, SHIFT(38), 3085 | [155] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym__content, 1), 3086 | [157] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym__content, 1), 3087 | [159] = {.entry = {.count = 1, .reusable = false}}, SHIFT(44), 3088 | [161] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_pi, 4), 3089 | [163] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_pi, 4), 3090 | [165] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_tag_end, 4, .production_id = 3), 3091 | [167] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_tag_end, 4, .production_id = 3), 3092 | [169] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_cdata_sect, 2), 3093 | [171] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_cdata_sect, 2), 3094 | [173] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_empty_element, 6, .production_id = 1), 3095 | [175] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_empty_element, 6, .production_id = 1), 3096 | [177] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_cdata_sect, 3), 3097 | [179] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_cdata_sect, 3), 3098 | [181] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_tag_start, 5, .production_id = 1), 3099 | [183] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_tag_start, 5, .production_id = 1), 3100 | [185] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_tag_start, 4, .production_id = 1), 3101 | [187] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_tag_start, 4, .production_id = 1), 3102 | [189] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_tag_end, 5, .production_id = 3), 3103 | [191] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_tag_end, 5, .production_id = 3), 3104 | [193] = {.entry = {.count = 1, .reusable = true}}, SHIFT(129), 3105 | [195] = {.entry = {.count = 1, .reusable = true}}, SHIFT(112), 3106 | [197] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_entity_ref, 3), 3107 | [199] = {.entry = {.count = 1, .reusable = false}}, REDUCE(sym_entity_ref, 3), 3108 | [201] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym__content, 2), 3109 | [203] = {.entry = {.count = 1, .reusable = false}}, REDUCE(aux_sym__content, 2), 3110 | [205] = {.entry = {.count = 1, .reusable = true}}, SHIFT(141), 3111 | [207] = {.entry = {.count = 1, .reusable = true}}, SHIFT(11), 3112 | [209] = {.entry = {.count = 1, .reusable = true}}, SHIFT(35), 3113 | [211] = {.entry = {.count = 1, .reusable = false}}, SHIFT(85), 3114 | [213] = {.entry = {.count = 1, .reusable = true}}, SHIFT(139), 3115 | [215] = {.entry = {.count = 1, .reusable = true}}, SHIFT(102), 3116 | [217] = {.entry = {.count = 1, .reusable = true}}, SHIFT(61), 3117 | [219] = {.entry = {.count = 1, .reusable = false}}, SHIFT(75), 3118 | [221] = {.entry = {.count = 1, .reusable = true}}, SHIFT(31), 3119 | [223] = {.entry = {.count = 1, .reusable = true}}, SHIFT(19), 3120 | [225] = {.entry = {.count = 1, .reusable = false}}, SHIFT(74), 3121 | [227] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_pi_repeat1, 2), 3122 | [229] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_pi_repeat1, 2), SHIFT_REPEAT(71), 3123 | [232] = {.entry = {.count = 1, .reusable = true}}, SHIFT(42), 3124 | [234] = {.entry = {.count = 1, .reusable = true}}, SHIFT(64), 3125 | [236] = {.entry = {.count = 1, .reusable = false}}, SHIFT(77), 3126 | [238] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_pi_repeat1, 2), SHIFT_REPEAT(74), 3127 | [241] = {.entry = {.count = 1, .reusable = true}}, SHIFT(60), 3128 | [243] = {.entry = {.count = 1, .reusable = true}}, SHIFT(109), 3129 | [245] = {.entry = {.count = 1, .reusable = true}}, SHIFT(25), 3130 | [247] = {.entry = {.count = 1, .reusable = true}}, SHIFT(26), 3131 | [249] = {.entry = {.count = 1, .reusable = true}}, SHIFT(59), 3132 | [251] = {.entry = {.count = 1, .reusable = false}}, SHIFT(78), 3133 | [253] = {.entry = {.count = 2, .reusable = false}}, REDUCE(aux_sym_pi_repeat1, 2), SHIFT_REPEAT(78), 3134 | [256] = {.entry = {.count = 1, .reusable = true}}, SHIFT(103), 3135 | [258] = {.entry = {.count = 1, .reusable = true}}, SHIFT(124), 3136 | [260] = {.entry = {.count = 1, .reusable = true}}, SHIFT(41), 3137 | [262] = {.entry = {.count = 1, .reusable = true}}, REDUCE(aux_sym_empty_element_repeat1, 2), 3138 | [264] = {.entry = {.count = 2, .reusable = true}}, REDUCE(aux_sym_empty_element_repeat1, 2), SHIFT_REPEAT(45), 3139 | [267] = {.entry = {.count = 1, .reusable = true}}, SHIFT(28), 3140 | [269] = {.entry = {.count = 1, .reusable = false}}, SHIFT(84), 3141 | [271] = {.entry = {.count = 1, .reusable = true}}, SHIFT(122), 3142 | [273] = {.entry = {.count = 1, .reusable = true}}, SHIFT(22), 3143 | [275] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_cdata, 1), 3144 | [277] = {.entry = {.count = 1, .reusable = false}}, SHIFT(71), 3145 | [279] = {.entry = {.count = 1, .reusable = true}}, SHIFT(33), 3146 | [281] = {.entry = {.count = 1, .reusable = false}}, SHIFT(70), 3147 | [283] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attr_value, 2), 3148 | [285] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_xml_attr, 5, .production_id = 8), 3149 | [287] = {.entry = {.count = 1, .reusable = true}}, SHIFT(140), 3150 | [289] = {.entry = {.count = 1, .reusable = true}}, SHIFT(80), 3151 | [291] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_xml_attr, 3, .production_id = 5), 3152 | [293] = {.entry = {.count = 1, .reusable = true}}, SHIFT(120), 3153 | [295] = {.entry = {.count = 1, .reusable = true}}, SHIFT(119), 3154 | [297] = {.entry = {.count = 1, .reusable = true}}, SHIFT(113), 3155 | [299] = {.entry = {.count = 1, .reusable = true}}, SHIFT(67), 3156 | [301] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attribute, 1), 3157 | [303] = {.entry = {.count = 1, .reusable = true}}, SHIFT(104), 3158 | [305] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_attr_value, 3), 3159 | [307] = {.entry = {.count = 1, .reusable = true}}, SHIFT(127), 3160 | [309] = {.entry = {.count = 1, .reusable = true}}, SHIFT(91), 3161 | [311] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_ns_decl, 5, .production_id = 7), 3162 | [313] = {.entry = {.count = 1, .reusable = true}}, SHIFT(115), 3163 | [315] = {.entry = {.count = 1, .reusable = true}}, SHIFT(111), 3164 | [317] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_xml_decl, 6, .production_id = 2), 3165 | [319] = {.entry = {.count = 1, .reusable = true}}, SHIFT(83), 3166 | [321] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_xml_encoding_value, 3), 3167 | [323] = {.entry = {.count = 1, .reusable = true}}, SHIFT(121), 3168 | [325] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_xml_version, 4, .production_id = 4), 3169 | [327] = {.entry = {.count = 1, .reusable = true}}, SHIFT(54), 3170 | [329] = {.entry = {.count = 1, .reusable = true}}, SHIFT(57), 3171 | [331] = {.entry = {.count = 1, .reusable = true}}, SHIFT(68), 3172 | [333] = {.entry = {.count = 1, .reusable = true}}, SHIFT(43), 3173 | [335] = {.entry = {.count = 1, .reusable = true}}, SHIFT(51), 3174 | [337] = {.entry = {.count = 1, .reusable = true}}, SHIFT(100), 3175 | [339] = {.entry = {.count = 1, .reusable = true}}, SHIFT(126), 3176 | [341] = {.entry = {.count = 1, .reusable = true}}, SHIFT(50), 3177 | [343] = {.entry = {.count = 1, .reusable = true}}, SHIFT(116), 3178 | [345] = {.entry = {.count = 1, .reusable = true}}, SHIFT(108), 3179 | [347] = {.entry = {.count = 1, .reusable = true}}, SHIFT(52), 3180 | [349] = {.entry = {.count = 1, .reusable = true}}, SHIFT(66), 3181 | [351] = {.entry = {.count = 1, .reusable = true}}, SHIFT(101), 3182 | [353] = {.entry = {.count = 1, .reusable = true}}, SHIFT(107), 3183 | [355] = {.entry = {.count = 1, .reusable = true}}, SHIFT(56), 3184 | [357] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_xml_decl, 5, .production_id = 2), 3185 | [359] = {.entry = {.count = 1, .reusable = true}}, SHIFT(48), 3186 | [361] = {.entry = {.count = 1, .reusable = true}}, SHIFT(106), 3187 | [363] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_xml_version_value, 3), 3188 | [365] = {.entry = {.count = 1, .reusable = true}}, SHIFT(37), 3189 | [367] = {.entry = {.count = 1, .reusable = true}}, SHIFT(24), 3190 | [369] = {.entry = {.count = 1, .reusable = true}}, SHIFT(23), 3191 | [371] = {.entry = {.count = 1, .reusable = true}}, SHIFT(86), 3192 | [373] = {.entry = {.count = 1, .reusable = true}}, SHIFT(63), 3193 | [375] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_xml_decl, 4, .production_id = 2), 3194 | [377] = {.entry = {.count = 1, .reusable = true}}, SHIFT(47), 3195 | [379] = {.entry = {.count = 1, .reusable = true}}, SHIFT(20), 3196 | [381] = {.entry = {.count = 1, .reusable = true}}, SHIFT(99), 3197 | [383] = {.entry = {.count = 1, .reusable = true}}, SHIFT(34), 3198 | [385] = {.entry = {.count = 1, .reusable = true}}, SHIFT(134), 3199 | [387] = {.entry = {.count = 1, .reusable = true}}, SHIFT(36), 3200 | [389] = {.entry = {.count = 1, .reusable = true}}, SHIFT(65), 3201 | [391] = {.entry = {.count = 1, .reusable = true}}, SHIFT(40), 3202 | [393] = {.entry = {.count = 1, .reusable = true}}, SHIFT(117), 3203 | [395] = {.entry = {.count = 1, .reusable = true}}, SHIFT(125), 3204 | [397] = {.entry = {.count = 1, .reusable = true}}, SHIFT(128), 3205 | [399] = {.entry = {.count = 1, .reusable = true}}, ACCEPT_INPUT(), 3206 | [401] = {.entry = {.count = 1, .reusable = true}}, SHIFT(79), 3207 | [403] = {.entry = {.count = 1, .reusable = true}}, SHIFT(131), 3208 | [405] = {.entry = {.count = 1, .reusable = true}}, SHIFT(76), 3209 | [407] = {.entry = {.count = 1, .reusable = true}}, REDUCE(sym_xml_encoding, 4, .production_id = 6), 3210 | }; 3211 | 3212 | #ifdef __cplusplus 3213 | extern "C" { 3214 | #endif 3215 | #ifdef _WIN32 3216 | #define extern __declspec(dllexport) 3217 | #endif 3218 | 3219 | extern const TSLanguage *tree_sitter_xml(void) { 3220 | static const TSLanguage language = { 3221 | .version = LANGUAGE_VERSION, 3222 | .symbol_count = SYMBOL_COUNT, 3223 | .alias_count = ALIAS_COUNT, 3224 | .token_count = TOKEN_COUNT, 3225 | .external_token_count = EXTERNAL_TOKEN_COUNT, 3226 | .state_count = STATE_COUNT, 3227 | .large_state_count = LARGE_STATE_COUNT, 3228 | .production_id_count = PRODUCTION_ID_COUNT, 3229 | .field_count = FIELD_COUNT, 3230 | .max_alias_sequence_length = MAX_ALIAS_SEQUENCE_LENGTH, 3231 | .parse_table = &ts_parse_table[0][0], 3232 | .small_parse_table = ts_small_parse_table, 3233 | .small_parse_table_map = ts_small_parse_table_map, 3234 | .parse_actions = ts_parse_actions, 3235 | .symbol_names = ts_symbol_names, 3236 | .field_names = ts_field_names, 3237 | .field_map_slices = ts_field_map_slices, 3238 | .field_map_entries = ts_field_map_entries, 3239 | .symbol_metadata = ts_symbol_metadata, 3240 | .public_symbol_map = ts_symbol_map, 3241 | .alias_map = ts_non_terminal_alias_map, 3242 | .alias_sequences = &ts_alias_sequences[0][0], 3243 | .lex_modes = ts_lex_modes, 3244 | .lex_fn = ts_lex, 3245 | .primary_state_ids = ts_primary_state_ids, 3246 | }; 3247 | return &language; 3248 | } 3249 | #ifdef __cplusplus 3250 | } 3251 | #endif 3252 | -------------------------------------------------------------------------------- /src/tree_sitter/parser.h: -------------------------------------------------------------------------------- 1 | #ifndef TREE_SITTER_PARSER_H_ 2 | #define TREE_SITTER_PARSER_H_ 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | #define ts_builtin_sym_error ((TSSymbol)-1) 13 | #define ts_builtin_sym_end 0 14 | #define TREE_SITTER_SERIALIZATION_BUFFER_SIZE 1024 15 | 16 | typedef uint16_t TSStateId; 17 | 18 | #ifndef TREE_SITTER_API_H_ 19 | typedef uint16_t TSSymbol; 20 | typedef uint16_t TSFieldId; 21 | typedef struct TSLanguage TSLanguage; 22 | #endif 23 | 24 | typedef struct { 25 | TSFieldId field_id; 26 | uint8_t child_index; 27 | bool inherited; 28 | } TSFieldMapEntry; 29 | 30 | typedef struct { 31 | uint16_t index; 32 | uint16_t length; 33 | } TSFieldMapSlice; 34 | 35 | typedef struct { 36 | bool visible; 37 | bool named; 38 | bool supertype; 39 | } TSSymbolMetadata; 40 | 41 | typedef struct TSLexer TSLexer; 42 | 43 | struct TSLexer { 44 | int32_t lookahead; 45 | TSSymbol result_symbol; 46 | void (*advance)(TSLexer *, bool); 47 | void (*mark_end)(TSLexer *); 48 | uint32_t (*get_column)(TSLexer *); 49 | bool (*is_at_included_range_start)(const TSLexer *); 50 | bool (*eof)(const TSLexer *); 51 | }; 52 | 53 | typedef enum { 54 | TSParseActionTypeShift, 55 | TSParseActionTypeReduce, 56 | TSParseActionTypeAccept, 57 | TSParseActionTypeRecover, 58 | } TSParseActionType; 59 | 60 | typedef union { 61 | struct { 62 | uint8_t type; 63 | TSStateId state; 64 | bool extra; 65 | bool repetition; 66 | } shift; 67 | struct { 68 | uint8_t type; 69 | uint8_t child_count; 70 | TSSymbol symbol; 71 | int16_t dynamic_precedence; 72 | uint16_t production_id; 73 | } reduce; 74 | uint8_t type; 75 | } TSParseAction; 76 | 77 | typedef struct { 78 | uint16_t lex_state; 79 | uint16_t external_lex_state; 80 | } TSLexMode; 81 | 82 | typedef union { 83 | TSParseAction action; 84 | struct { 85 | uint8_t count; 86 | bool reusable; 87 | } entry; 88 | } TSParseActionEntry; 89 | 90 | struct TSLanguage { 91 | uint32_t version; 92 | uint32_t symbol_count; 93 | uint32_t alias_count; 94 | uint32_t token_count; 95 | uint32_t external_token_count; 96 | uint32_t state_count; 97 | uint32_t large_state_count; 98 | uint32_t production_id_count; 99 | uint32_t field_count; 100 | uint16_t max_alias_sequence_length; 101 | const uint16_t *parse_table; 102 | const uint16_t *small_parse_table; 103 | const uint32_t *small_parse_table_map; 104 | const TSParseActionEntry *parse_actions; 105 | const char * const *symbol_names; 106 | const char * const *field_names; 107 | const TSFieldMapSlice *field_map_slices; 108 | const TSFieldMapEntry *field_map_entries; 109 | const TSSymbolMetadata *symbol_metadata; 110 | const TSSymbol *public_symbol_map; 111 | const uint16_t *alias_map; 112 | const TSSymbol *alias_sequences; 113 | const TSLexMode *lex_modes; 114 | bool (*lex_fn)(TSLexer *, TSStateId); 115 | bool (*keyword_lex_fn)(TSLexer *, TSStateId); 116 | TSSymbol keyword_capture_token; 117 | struct { 118 | const bool *states; 119 | const TSSymbol *symbol_map; 120 | void *(*create)(void); 121 | void (*destroy)(void *); 122 | bool (*scan)(void *, TSLexer *, const bool *symbol_whitelist); 123 | unsigned (*serialize)(void *, char *); 124 | void (*deserialize)(void *, const char *, unsigned); 125 | } external_scanner; 126 | const TSStateId *primary_state_ids; 127 | }; 128 | 129 | /* 130 | * Lexer Macros 131 | */ 132 | 133 | #define START_LEXER() \ 134 | bool result = false; \ 135 | bool skip = false; \ 136 | bool eof = false; \ 137 | int32_t lookahead; \ 138 | goto start; \ 139 | next_state: \ 140 | lexer->advance(lexer, skip); \ 141 | start: \ 142 | skip = false; \ 143 | lookahead = lexer->lookahead; 144 | 145 | #define ADVANCE(state_value) \ 146 | { \ 147 | state = state_value; \ 148 | goto next_state; \ 149 | } 150 | 151 | #define SKIP(state_value) \ 152 | { \ 153 | skip = true; \ 154 | state = state_value; \ 155 | goto next_state; \ 156 | } 157 | 158 | #define ACCEPT_TOKEN(symbol_value) \ 159 | result = true; \ 160 | lexer->result_symbol = symbol_value; \ 161 | lexer->mark_end(lexer); 162 | 163 | #define END_STATE() return result; 164 | 165 | /* 166 | * Parse Table Macros 167 | */ 168 | 169 | #define SMALL_STATE(id) id - LARGE_STATE_COUNT 170 | 171 | #define STATE(id) id 172 | 173 | #define ACTIONS(id) id 174 | 175 | #define SHIFT(state_value) \ 176 | {{ \ 177 | .shift = { \ 178 | .type = TSParseActionTypeShift, \ 179 | .state = state_value \ 180 | } \ 181 | }} 182 | 183 | #define SHIFT_REPEAT(state_value) \ 184 | {{ \ 185 | .shift = { \ 186 | .type = TSParseActionTypeShift, \ 187 | .state = state_value, \ 188 | .repetition = true \ 189 | } \ 190 | }} 191 | 192 | #define SHIFT_EXTRA() \ 193 | {{ \ 194 | .shift = { \ 195 | .type = TSParseActionTypeShift, \ 196 | .extra = true \ 197 | } \ 198 | }} 199 | 200 | #define REDUCE(symbol_val, child_count_val, ...) \ 201 | {{ \ 202 | .reduce = { \ 203 | .type = TSParseActionTypeReduce, \ 204 | .symbol = symbol_val, \ 205 | .child_count = child_count_val, \ 206 | __VA_ARGS__ \ 207 | }, \ 208 | }} 209 | 210 | #define RECOVER() \ 211 | {{ \ 212 | .type = TSParseActionTypeRecover \ 213 | }} 214 | 215 | #define ACCEPT_INPUT() \ 216 | {{ \ 217 | .type = TSParseActionTypeAccept \ 218 | }} 219 | 220 | #ifdef __cplusplus 221 | } 222 | #endif 223 | 224 | #endif // TREE_SITTER_PARSER_H_ 225 | -------------------------------------------------------------------------------- /test.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 14 | 15 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /test/corpus/basic.txt: -------------------------------------------------------------------------------- 1 | === 2 | Test empty_element 3 | === 4 | 5 | 6 | 10 | 11 | --- 12 | 13 | (xml_file 14 | (xml_decl 15 | (xml_version 16 | (eq) 17 | (xml_version_value)) 18 | (xml_encoding 19 | (eq) 20 | (xml_encoding_value))) 21 | (element 22 | (empty_element 23 | tag_name: (name) 24 | (attribute 25 | (ns_decl 26 | xmlns_prefix: (name) 27 | (eq) 28 | (attr_value))) 29 | (attribute 30 | (xml_attr 31 | ns_prefix: (name) 32 | attr_name: (name) 33 | (eq) 34 | (attr_value))) 35 | (attribute 36 | (xml_attr 37 | ns_prefix: (name) 38 | attr_name: (name) 39 | (eq) 40 | (attr_value)))))) 41 | 42 | 43 | === 44 | Test element with children 45 | === 46 | 47 | 48 | 52 | 53 | 57 | 58 |