html-to-markdown 2.24.6 → 2.25.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (231) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +2 -2
  3. data/README.md +1 -1
  4. data/ext/html-to-markdown-rb/native/Cargo.lock +9 -32
  5. data/ext/html-to-markdown-rb/native/Cargo.toml +1 -1
  6. data/lib/html_to_markdown/version.rb +1 -1
  7. data/rust-vendor/html-to-markdown-rs/Cargo.toml +0 -1
  8. data/rust-vendor/html-to-markdown-rs/src/converter/main_helpers.rs +1 -1
  9. data/rust-vendor/html-to-markdown-rs/src/hocr/converter/hierarchy.rs +20 -5
  10. data/rust-vendor/html-to-markdown-rs/src/lib.rs +1 -0
  11. data/rust-vendor/{markup5ever_rcdom/lib.rs → html-to-markdown-rs/src/rcdom.rs} +56 -91
  12. data/rust-vendor/html-to-markdown-rs/tests/hocr_compliance_test.rs +157 -0
  13. data/rust-vendor/memmap2/.cargo-checksum.json +1 -1
  14. data/rust-vendor/memmap2/.cargo_vcs_info.json +1 -1
  15. data/rust-vendor/memmap2/CHANGELOG.md +8 -0
  16. data/rust-vendor/memmap2/Cargo.lock +1 -1
  17. data/rust-vendor/memmap2/Cargo.toml +2 -1
  18. data/rust-vendor/memmap2/Cargo.toml.orig +2 -1
  19. data/rust-vendor/memmap2/src/lib.rs +25 -1
  20. data/rust-vendor/memmap2/src/stub.rs +1 -4
  21. data/rust-vendor/memmap2/src/unix.rs +14 -1
  22. data/rust-vendor/png/.cargo-checksum.json +1 -1
  23. data/rust-vendor/png/.cargo_vcs_info.json +1 -1
  24. data/rust-vendor/png/CHANGES.md +44 -0
  25. data/rust-vendor/png/Cargo.lock +124 -171
  26. data/rust-vendor/png/Cargo.toml +1 -1
  27. data/rust-vendor/png/Cargo.toml.orig +1 -1
  28. data/rust-vendor/png/benches/expand_paletted.rs +5 -5
  29. data/rust-vendor/png/benches/unfilter.rs +3 -3
  30. data/rust-vendor/png/src/adam7.rs +17 -10
  31. data/rust-vendor/png/src/common.rs +8 -8
  32. data/rust-vendor/png/src/decoder/mod.rs +53 -20
  33. data/rust-vendor/png/src/decoder/stream.rs +263 -78
  34. data/rust-vendor/png/src/decoder/unfiltering_buffer.rs +210 -53
  35. data/rust-vendor/png/src/decoder/zlib.rs +130 -90
  36. data/rust-vendor/png/src/encoder.rs +4 -2
  37. data/rust-vendor/png/src/{filter.rs → filter/mod.rs} +100 -367
  38. data/rust-vendor/png/src/filter/optimization-notes.md +104 -0
  39. data/rust-vendor/png/src/filter/paeth.rs +398 -0
  40. data/rust-vendor/png/src/filter/simd.rs +308 -0
  41. data/rust-vendor/png/src/lib.rs +1 -0
  42. data/rust-vendor/syn/.cargo-checksum.json +1 -1
  43. data/rust-vendor/syn/.cargo_vcs_info.json +1 -1
  44. data/rust-vendor/syn/Cargo.lock +40 -41
  45. data/rust-vendor/syn/Cargo.toml +1 -1
  46. data/rust-vendor/syn/Cargo.toml.orig +1 -1
  47. data/rust-vendor/syn/src/item.rs +61 -40
  48. data/rust-vendor/syn/src/lib.rs +2 -1
  49. data/rust-vendor/syn/tests/test_item.rs +54 -0
  50. data/rust-vendor/unicode-ident/.cargo-checksum.json +1 -1
  51. data/rust-vendor/unicode-ident/.cargo_vcs_info.json +1 -1
  52. data/rust-vendor/unicode-ident/Cargo.lock +21 -21
  53. data/rust-vendor/unicode-ident/Cargo.toml +1 -1
  54. data/rust-vendor/unicode-ident/Cargo.toml.orig +1 -1
  55. data/rust-vendor/unicode-ident/src/lib.rs +1 -1
  56. data/rust-vendor/unicode-ident/src/tables.rs +87 -97
  57. data/rust-vendor/unicode-ident/tests/static_size.rs +1 -1
  58. metadata +7 -177
  59. data/rust-vendor/markup5ever_rcdom/.cargo-checksum.json +0 -1
  60. data/rust-vendor/markup5ever_rcdom/.cargo_vcs_info.json +0 -7
  61. data/rust-vendor/markup5ever_rcdom/Cargo.lock +0 -658
  62. data/rust-vendor/markup5ever_rcdom/Cargo.toml +0 -109
  63. data/rust-vendor/markup5ever_rcdom/Cargo.toml.orig +0 -42
  64. data/rust-vendor/markup5ever_rcdom/LICENSE-APACHE +0 -201
  65. data/rust-vendor/markup5ever_rcdom/LICENSE-MIT +0 -25
  66. data/rust-vendor/markup5ever_rcdom/README.md +0 -7
  67. data/rust-vendor/markup5ever_rcdom/custom-html5lib-tokenizer-tests/regression.test +0 -69
  68. data/rust-vendor/markup5ever_rcdom/data/test/ignore +0 -1
  69. data/rust-vendor/markup5ever_rcdom/examples/hello_xml.rs +0 -39
  70. data/rust-vendor/markup5ever_rcdom/examples/html2html.rs +0 -51
  71. data/rust-vendor/markup5ever_rcdom/examples/print-rcdom.rs +0 -78
  72. data/rust-vendor/markup5ever_rcdom/examples/xml_tree_printer.rs +0 -67
  73. data/rust-vendor/markup5ever_rcdom/html5lib-tests/.gitattributes +0 -2
  74. data/rust-vendor/markup5ever_rcdom/html5lib-tests/.github/workflows/downstream.yml +0 -76
  75. data/rust-vendor/markup5ever_rcdom/html5lib-tests/.github/workflows/lint.yml +0 -25
  76. data/rust-vendor/markup5ever_rcdom/html5lib-tests/.gitignore +0 -79
  77. data/rust-vendor/markup5ever_rcdom/html5lib-tests/AUTHORS.rst +0 -34
  78. data/rust-vendor/markup5ever_rcdom/html5lib-tests/LICENSE +0 -21
  79. data/rust-vendor/markup5ever_rcdom/html5lib-tests/encoding/chardet/test_big5.txt +0 -51
  80. data/rust-vendor/markup5ever_rcdom/html5lib-tests/encoding/scripted/tests1.dat +0 -5
  81. data/rust-vendor/markup5ever_rcdom/html5lib-tests/encoding/test-yahoo-jp.dat +0 -10
  82. data/rust-vendor/markup5ever_rcdom/html5lib-tests/encoding/tests1.dat +0 -388
  83. data/rust-vendor/markup5ever_rcdom/html5lib-tests/encoding/tests2.dat +0 -115
  84. data/rust-vendor/markup5ever_rcdom/html5lib-tests/lint +0 -6
  85. data/rust-vendor/markup5ever_rcdom/html5lib-tests/lint_lib/__init__.py +0 -0
  86. data/rust-vendor/markup5ever_rcdom/html5lib-tests/lint_lib/_vendor/__init__.py +0 -0
  87. data/rust-vendor/markup5ever_rcdom/html5lib-tests/lint_lib/_vendor/funcparserlib/LICENSE +0 -18
  88. data/rust-vendor/markup5ever_rcdom/html5lib-tests/lint_lib/_vendor/funcparserlib/__init__.py +0 -0
  89. data/rust-vendor/markup5ever_rcdom/html5lib-tests/lint_lib/_vendor/funcparserlib/lexer.py +0 -211
  90. data/rust-vendor/markup5ever_rcdom/html5lib-tests/lint_lib/_vendor/funcparserlib/lexer.pyi +0 -34
  91. data/rust-vendor/markup5ever_rcdom/html5lib-tests/lint_lib/_vendor/funcparserlib/parser.py +0 -872
  92. data/rust-vendor/markup5ever_rcdom/html5lib-tests/lint_lib/_vendor/funcparserlib/parser.pyi +0 -83
  93. data/rust-vendor/markup5ever_rcdom/html5lib-tests/lint_lib/_vendor/funcparserlib/py.typed +0 -0
  94. data/rust-vendor/markup5ever_rcdom/html5lib-tests/lint_lib/_vendor/funcparserlib/util.py +0 -72
  95. data/rust-vendor/markup5ever_rcdom/html5lib-tests/lint_lib/_vendor/funcparserlib/util.pyi +0 -7
  96. data/rust-vendor/markup5ever_rcdom/html5lib-tests/lint_lib/_vendor/vendor.txt +0 -1
  97. data/rust-vendor/markup5ever_rcdom/html5lib-tests/lint_lib/_vendor-patches/funcparserlib.patch +0 -24
  98. data/rust-vendor/markup5ever_rcdom/html5lib-tests/lint_lib/lint.py +0 -280
  99. data/rust-vendor/markup5ever_rcdom/html5lib-tests/lint_lib/parser.py +0 -177
  100. data/rust-vendor/markup5ever_rcdom/html5lib-tests/pyproject.toml +0 -7
  101. data/rust-vendor/markup5ever_rcdom/html5lib-tests/serializer/core.test +0 -125
  102. data/rust-vendor/markup5ever_rcdom/html5lib-tests/serializer/injectmeta.test +0 -66
  103. data/rust-vendor/markup5ever_rcdom/html5lib-tests/serializer/optionaltags.test +0 -965
  104. data/rust-vendor/markup5ever_rcdom/html5lib-tests/serializer/options.test +0 -60
  105. data/rust-vendor/markup5ever_rcdom/html5lib-tests/serializer/whitespace.test +0 -51
  106. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tokenizer/README.md +0 -107
  107. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tokenizer/contentModelFlags.test +0 -93
  108. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tokenizer/domjs.test +0 -335
  109. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tokenizer/entities.test +0 -542
  110. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tokenizer/escapeFlag.test +0 -36
  111. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tokenizer/namedEntities.test +0 -42422
  112. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tokenizer/numericEntities.test +0 -1677
  113. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tokenizer/pendingSpecChanges.test +0 -9
  114. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tokenizer/test1.test +0 -353
  115. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tokenizer/test2.test +0 -275
  116. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tokenizer/test3.test +0 -11233
  117. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tokenizer/test4.test +0 -532
  118. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tokenizer/unicodeChars.test +0 -1577
  119. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tokenizer/unicodeCharsProblematic.test +0 -41
  120. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tokenizer/xmlViolation.test +0 -20
  121. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/README.md +0 -108
  122. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/adoption01.dat +0 -354
  123. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/adoption02.dat +0 -39
  124. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/blocks.dat +0 -695
  125. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/comments01.dat +0 -217
  126. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/doctype01.dat +0 -474
  127. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/domjs-unsafe.dat +0 -0
  128. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/entities01.dat +0 -943
  129. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/entities02.dat +0 -309
  130. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/foreign-fragment.dat +0 -645
  131. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/html5test-com.dat +0 -301
  132. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/inbody01.dat +0 -54
  133. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/isindex.dat +0 -49
  134. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/main-element.dat +0 -46
  135. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/math.dat +0 -104
  136. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/menuitem-element.dat +0 -240
  137. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/namespace-sensitivity.dat +0 -22
  138. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/noscript01.dat +0 -237
  139. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/pending-spec-changes-plain-text-unsafe.dat +0 -0
  140. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/pending-spec-changes.dat +0 -46
  141. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/plain-text-unsafe.dat +0 -0
  142. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/quirks01.dat +0 -53
  143. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/ruby.dat +0 -302
  144. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/scriptdata01.dat +0 -372
  145. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/scripted/adoption01.dat +0 -16
  146. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/scripted/ark.dat +0 -27
  147. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/scripted/webkit01.dat +0 -30
  148. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/search-element.dat +0 -46
  149. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/svg.dat +0 -104
  150. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/tables01.dat +0 -322
  151. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/template.dat +0 -1673
  152. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/tests1.dat +0 -1956
  153. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/tests10.dat +0 -849
  154. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/tests11.dat +0 -523
  155. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/tests12.dat +0 -62
  156. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/tests14.dat +0 -75
  157. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/tests15.dat +0 -216
  158. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/tests16.dat +0 -2602
  159. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/tests17.dat +0 -179
  160. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/tests18.dat +0 -558
  161. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/tests19.dat +0 -1398
  162. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/tests2.dat +0 -831
  163. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/tests20.dat +0 -842
  164. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/tests21.dat +0 -306
  165. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/tests22.dat +0 -190
  166. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/tests23.dat +0 -168
  167. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/tests24.dat +0 -79
  168. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/tests25.dat +0 -288
  169. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/tests26.dat +0 -453
  170. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/tests3.dat +0 -305
  171. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/tests4.dat +0 -74
  172. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/tests5.dat +0 -210
  173. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/tests6.dat +0 -663
  174. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/tests7.dat +0 -453
  175. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/tests8.dat +0 -165
  176. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/tests9.dat +0 -472
  177. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/tests_innerHTML_1.dat +0 -843
  178. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/tricky01.dat +0 -336
  179. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/webkit01.dat +0 -785
  180. data/rust-vendor/markup5ever_rcdom/html5lib-tests/tree-construction/webkit02.dat +0 -554
  181. data/rust-vendor/markup5ever_rcdom/tests/foreach_html5lib_test/mod.rs +0 -41
  182. data/rust-vendor/markup5ever_rcdom/tests/html-driver.rs +0 -29
  183. data/rust-vendor/markup5ever_rcdom/tests/html-serializer.rs +0 -265
  184. data/rust-vendor/markup5ever_rcdom/tests/html-tokenizer.rs +0 -487
  185. data/rust-vendor/markup5ever_rcdom/tests/html-tree-builder.rs +0 -298
  186. data/rust-vendor/markup5ever_rcdom/tests/html-tree-sink.rs +0 -141
  187. data/rust-vendor/markup5ever_rcdom/tests/util/find_tests.rs +0 -34
  188. data/rust-vendor/markup5ever_rcdom/tests/util/runner.rs +0 -48
  189. data/rust-vendor/markup5ever_rcdom/tests/xml-driver.rs +0 -101
  190. data/rust-vendor/markup5ever_rcdom/tests/xml-tokenizer.rs +0 -374
  191. data/rust-vendor/markup5ever_rcdom/tests/xml-tree-builder.rs +0 -237
  192. data/rust-vendor/markup5ever_rcdom/xml5lib-tests/AUTHORS.rst +0 -9
  193. data/rust-vendor/markup5ever_rcdom/xml5lib-tests/LICENSE +0 -21
  194. data/rust-vendor/markup5ever_rcdom/xml5lib-tests/tokenizer/README.md +0 -92
  195. data/rust-vendor/markup5ever_rcdom/xml5lib-tests/tokenizer/comments.test +0 -274
  196. data/rust-vendor/markup5ever_rcdom/xml5lib-tests/tokenizer/doctype.test +0 -3232
  197. data/rust-vendor/markup5ever_rcdom/xml5lib-tests/tokenizer/entities.test +0 -283
  198. data/rust-vendor/markup5ever_rcdom/xml5lib-tests/tokenizer/eof.test +0 -113
  199. data/rust-vendor/markup5ever_rcdom/xml5lib-tests/tokenizer/namedEntities.test +0 -42210
  200. data/rust-vendor/markup5ever_rcdom/xml5lib-tests/tokenizer/numericEntities.test +0 -1349
  201. data/rust-vendor/markup5ever_rcdom/xml5lib-tests/tokenizer/test1.test +0 -162
  202. data/rust-vendor/markup5ever_rcdom/xml5lib-tests/tokenizer/test2.test +0 -64
  203. data/rust-vendor/markup5ever_rcdom/xml5lib-tests/tokenizer/unicodeChars.test +0 -1295
  204. data/rust-vendor/markup5ever_rcdom/xml5lib-tests/tree-construction/README.md +0 -104
  205. data/rust-vendor/markup5ever_rcdom/xml5lib-tests/tree-construction/namespace.dat +0 -119
  206. data/rust-vendor/markup5ever_rcdom/xml5lib-tests/tree-construction/test1.dat +0 -124
  207. data/rust-vendor/xml5ever/.cargo-checksum.json +0 -1
  208. data/rust-vendor/xml5ever/.cargo_vcs_info.json +0 -6
  209. data/rust-vendor/xml5ever/Cargo.lock +0 -752
  210. data/rust-vendor/xml5ever/Cargo.toml +0 -69
  211. data/rust-vendor/xml5ever/Cargo.toml.orig +0 -29
  212. data/rust-vendor/xml5ever/LICENSE-APACHE +0 -201
  213. data/rust-vendor/xml5ever/LICENSE-MIT +0 -25
  214. data/rust-vendor/xml5ever/README.md +0 -72
  215. data/rust-vendor/xml5ever/benches/xml5ever.rs +0 -77
  216. data/rust-vendor/xml5ever/data/bench/strong.xml +0 -1
  217. data/rust-vendor/xml5ever/examples/README.md +0 -223
  218. data/rust-vendor/xml5ever/examples/example.xml +0 -3
  219. data/rust-vendor/xml5ever/examples/simple_xml_tokenizer.rs +0 -81
  220. data/rust-vendor/xml5ever/examples/xml_tokenizer.rs +0 -115
  221. data/rust-vendor/xml5ever/src/driver.rs +0 -90
  222. data/rust-vendor/xml5ever/src/lib.rs +0 -47
  223. data/rust-vendor/xml5ever/src/macros.rs +0 -18
  224. data/rust-vendor/xml5ever/src/serialize/mod.rs +0 -216
  225. data/rust-vendor/xml5ever/src/tokenizer/char_ref/mod.rs +0 -456
  226. data/rust-vendor/xml5ever/src/tokenizer/interface.rs +0 -116
  227. data/rust-vendor/xml5ever/src/tokenizer/mod.rs +0 -1344
  228. data/rust-vendor/xml5ever/src/tokenizer/qname.rs +0 -84
  229. data/rust-vendor/xml5ever/src/tokenizer/states.rs +0 -167
  230. data/rust-vendor/xml5ever/src/tree_builder/mod.rs +0 -774
  231. data/rust-vendor/xml5ever/src/tree_builder/types.rs +0 -37
@@ -1607,8 +1607,9 @@ pub(crate) mod parsing {
1607
1607
  allow_variadic: bool,
1608
1608
  ) -> Result<FnArgOrVariadic> {
1609
1609
  let ahead = input.fork();
1610
- if let Ok(mut receiver) = ahead.parse::<Receiver>() {
1610
+ if let Ok((reference, mutability, self_token)) = parse_receiver_begin(&ahead) {
1611
1611
  input.advance_to(&ahead);
1612
+ let mut receiver = parse_rest_of_receiver(reference, mutability, self_token, input)?;
1612
1613
  receiver.attrs = attrs;
1613
1614
  return Ok(FnArgOrVariadic::FnArg(FnArg::Receiver(receiver)));
1614
1615
  }
@@ -1654,48 +1655,68 @@ pub(crate) mod parsing {
1654
1655
  #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))]
1655
1656
  impl Parse for Receiver {
1656
1657
  fn parse(input: ParseStream) -> Result<Self> {
1657
- let reference = if input.peek(Token![&]) {
1658
- let ampersand: Token![&] = input.parse()?;
1659
- let lifetime: Option<Lifetime> = input.parse()?;
1660
- Some((ampersand, lifetime))
1661
- } else {
1662
- None
1663
- };
1664
- let mutability: Option<Token![mut]> = input.parse()?;
1665
- let self_token: Token![self] = input.parse()?;
1666
- let colon_token: Option<Token![:]> = if reference.is_some() {
1667
- None
1668
- } else {
1669
- input.parse()?
1670
- };
1671
- let ty: Type = if colon_token.is_some() {
1672
- input.parse()?
1673
- } else {
1674
- let mut ty = Type::Path(TypePath {
1675
- qself: None,
1676
- path: Path::from(Ident::new("Self", self_token.span)),
1677
- });
1678
- if let Some((ampersand, lifetime)) = reference.as_ref() {
1679
- ty = Type::Reference(TypeReference {
1680
- and_token: Token![&](ampersand.span),
1681
- lifetime: lifetime.clone(),
1682
- mutability: mutability.as_ref().map(|m| Token![mut](m.span)),
1683
- elem: Box::new(ty),
1684
- });
1685
- }
1686
- ty
1687
- };
1688
- Ok(Receiver {
1689
- attrs: Vec::new(),
1690
- reference,
1691
- mutability,
1692
- self_token,
1693
- colon_token,
1694
- ty: Box::new(ty),
1695
- })
1658
+ let (reference, mutability, self_token) = parse_receiver_begin(input)?;
1659
+ parse_rest_of_receiver(reference, mutability, self_token, input)
1696
1660
  }
1697
1661
  }
1698
1662
 
1663
+ fn parse_receiver_begin(
1664
+ input: ParseStream,
1665
+ ) -> Result<(
1666
+ Option<(Token![&], Option<Lifetime>)>,
1667
+ Option<Token![mut]>,
1668
+ Token![self],
1669
+ )> {
1670
+ let reference = if input.peek(Token![&]) {
1671
+ let ampersand: Token![&] = input.parse()?;
1672
+ let lifetime: Option<Lifetime> = input.parse()?;
1673
+ Some((ampersand, lifetime))
1674
+ } else {
1675
+ None
1676
+ };
1677
+ let mutability: Option<Token![mut]> = input.parse()?;
1678
+ let self_token: Token![self] = input.parse()?;
1679
+ Ok((reference, mutability, self_token))
1680
+ }
1681
+
1682
+ fn parse_rest_of_receiver(
1683
+ reference: Option<(Token![&], Option<Lifetime>)>,
1684
+ mutability: Option<Token![mut]>,
1685
+ self_token: Token![self],
1686
+ input: ParseStream,
1687
+ ) -> Result<Receiver> {
1688
+ let colon_token: Option<Token![:]> = if reference.is_some() {
1689
+ None
1690
+ } else {
1691
+ input.parse()?
1692
+ };
1693
+ let ty: Type = if colon_token.is_some() {
1694
+ input.parse()?
1695
+ } else {
1696
+ let mut ty = Type::Path(TypePath {
1697
+ qself: None,
1698
+ path: Path::from(Ident::new("Self", self_token.span)),
1699
+ });
1700
+ if let Some((ampersand, lifetime)) = reference.as_ref() {
1701
+ ty = Type::Reference(TypeReference {
1702
+ and_token: Token![&](ampersand.span),
1703
+ lifetime: lifetime.clone(),
1704
+ mutability: mutability.as_ref().map(|m| Token![mut](m.span)),
1705
+ elem: Box::new(ty),
1706
+ });
1707
+ }
1708
+ ty
1709
+ };
1710
+ Ok(Receiver {
1711
+ attrs: Vec::new(),
1712
+ reference,
1713
+ mutability,
1714
+ self_token,
1715
+ colon_token,
1716
+ ty: Box::new(ty),
1717
+ })
1718
+ }
1719
+
1699
1720
  fn parse_fn_args(
1700
1721
  input: ParseStream,
1701
1722
  ) -> Result<(Punctuated<FnArg, Token![,]>, Option<Variadic>)> {
@@ -249,7 +249,7 @@
249
249
  //! dynamic library libproc_macro from rustc toolchain.
250
250
 
251
251
  #![no_std]
252
- #![doc(html_root_url = "https://docs.rs/syn/2.0.115")]
252
+ #![doc(html_root_url = "https://docs.rs/syn/2.0.116")]
253
253
  #![cfg_attr(docsrs, feature(doc_cfg), doc(auto_cfg = false))]
254
254
  #![deny(unsafe_op_in_unsafe_fn)]
255
255
  #![allow(non_camel_case_types)]
@@ -300,6 +300,7 @@
300
300
  clippy::too_many_arguments,
301
301
  clippy::too_many_lines,
302
302
  clippy::trivially_copy_pass_by_ref,
303
+ clippy::type_complexity,
303
304
  clippy::unconditional_recursion, // https://github.com/rust-lang/rust-clippy/issues/12133
304
305
  clippy::uninhabited_references,
305
306
  clippy::uninlined_format_args,
@@ -1,3 +1,4 @@
1
+ #![recursion_limit = "256"]
1
2
  #![allow(
2
3
  clippy::elidable_lifetime_names,
3
4
  clippy::needless_lifetimes,
@@ -314,3 +315,56 @@ fn test_impl_trait_trailing_plus() {
314
315
  }
315
316
  "#);
316
317
  }
318
+
319
+ // Regression test for issue https://github.com/dtolnay/syn/issues/1967
320
+ #[test]
321
+ fn test_nested_receiver_classification() {
322
+ let tokens = quote! {
323
+ fn foo(
324
+ self: foo<{ fn foo(
325
+ self: foo<{ fn foo(
326
+ self: foo<{ fn foo(
327
+ self: foo<{ fn foo(
328
+ self: foo<{ fn foo(
329
+ self: foo<{ fn foo(
330
+ self: foo<{ fn foo(
331
+ self: foo<{ fn foo(
332
+ self: foo<{ fn foo(
333
+ self: foo<{ fn foo(
334
+ self: foo<{ fn foo(
335
+ self: foo<{ fn foo(
336
+ self: foo<{ fn foo(
337
+ self: foo<{ fn foo(
338
+ self: foo<{ fn foo(
339
+ self: foo<{ fn foo(
340
+ self: foo<{ fn foo(
341
+ self: foo<{ fn foo(
342
+ self: foo<{ fn foo(
343
+ self: foo<{ fn foo(
344
+ self: foo<{ fn foo(
345
+ )}>
346
+ )}>
347
+ )}>
348
+ )}>
349
+ )}>
350
+ )}>
351
+ )}>
352
+ )}>
353
+ )}>
354
+ )}>
355
+ )}>
356
+ )}>
357
+ )}>
358
+ )}>
359
+ )}>
360
+ )}>
361
+ )}>
362
+ )}>
363
+ )}>
364
+ )}>
365
+ )}>
366
+ ) {}
367
+ };
368
+
369
+ let _ = syn::parse2::<syn::File>(tokens);
370
+ }
@@ -1 +1 @@
1
- {"files":{".cargo_vcs_info.json":"202827a0da57d0f6ff4f27d12ab24ebe3add1e2f56d093bdf551c7e0ceb73b95",".github/FUNDING.yml":"b017158736b3c9751a2d21edfce7fe61c8954e2fced8da8dd3013c2f3e295bd9",".github/workflows/ci.yml":"7cd19596c9178c43f442aeeaf808592bb0c3a118ce291aa2037bd22116045e61","Cargo.lock":"babc8301fc126d3f40f11cf58ee3c2931c9b32717a3371b5841139e77d6bedcf","Cargo.toml":"534d5f09203d6cf33dd2a6ca78d14599eefdc4a00f8c55e053086d59a6d1c25c","Cargo.toml.orig":"4952f59bf9f1c28e13298484ad66d07fee5c8481ecc899a695e22eade523af5b","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","LICENSE-UNICODE":"f7db81051789b729fea528a63ec4c938fdcb93d9d61d97dc8cc2e9df6d47f2a1","README.md":"2fd3a0c6c9abd2c042fb319221f9ef2c95728a6e3725b0f067e4d315c5dbfe5a","benches/xid.rs":"7eb058c1140a253f7177af8868a95aabb1b92c52dc7eee5abbfeadb507d7845d","src/lib.rs":"83353980a66fc65387cba22c98a84736a0fb18a22dcdbab9040befad71386b14","src/tables.rs":"96d345fb3df2dc6718a6fe15cac1fcd21b7f006d5fb531dac7a5d0a0711e16bb","tests/compare.rs":"f2311271aa1db7380e5bf153ef83ee99777e14579e4f28c2b1a3e21877ffe715","tests/fst/.gitignore":"2cd419079c0a08bb15766520880998651dd1c72c55347a31f43357595b16ac10","tests/fst/mod.rs":"69a3aaf59acd8bca962ecc6234be56be8c0934ab79b253162f10eb881523901f","tests/fst/xid_continue.fst":"b58be4f0c498253e7a5ac664046096f15f249da66131347d4b822097623549a2","tests/fst/xid_start.fst":"aec7eecdacfce308d2e6210f47d28ed3aad5c8b048efbfbc11fc22e60fbf435b","tests/roaring/mod.rs":"f5c6d55463a7f53e92a493cf046d717149250fbafc0e0fe94bdb531377bf8b11","tests/static_size.rs":"52763dc203f211561d2ef150e8f970650459820bdc20ae18c6c046876b99cd2a","tests/tables/mod.rs":"e6949172d10fc4b2431ce7546269bfd4f9146454c8c3e31faf5e5d80c16a8ab6","tests/tables/tables.rs":"302d87306100b6280f8db93e167dc70c47f724045cf1312b7354683656c3f36b","tests/trie/mod.rs":"d4acbb716bcbaf80660039797f45e138ed8bbd66749fa3b19b1a971574679cc9","tests/trie/trie.rs":"f7b9edc1e8a98e3be42b653bba27bb4eb5fc48a559d6d8d1c6a4db4b5425b0d5"},"package":"537dd038a89878be9b64dd4bd1b260315c1bb94f4d784956b81e27a088d9a09e"}
1
+ {"files":{".cargo_vcs_info.json":"9900659dcf16d47a600102bbfd47cf554a0d4db40790983e570f9ecac9822c68",".github/FUNDING.yml":"b017158736b3c9751a2d21edfce7fe61c8954e2fced8da8dd3013c2f3e295bd9",".github/workflows/ci.yml":"7cd19596c9178c43f442aeeaf808592bb0c3a118ce291aa2037bd22116045e61","Cargo.lock":"dac9e67ad7272c61e7b197143b696705ce4800ea0e010b3b1f0c8924a0c9701d","Cargo.toml":"0bb9c0e006a21355cb85c7df72e78dd8ba6fffbb7dc3f1e7a4c19af53cd354da","Cargo.toml.orig":"8d0abaf7ce10cb78f26edcd613dfe5a47faa4381e6e251c7d1c123608d2e037a","LICENSE-APACHE":"62c7a1e35f56406896d7aa7ca52d0cc0d272ac022b5d2796e7d6905db8a3636a","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","LICENSE-UNICODE":"f7db81051789b729fea528a63ec4c938fdcb93d9d61d97dc8cc2e9df6d47f2a1","README.md":"2fd3a0c6c9abd2c042fb319221f9ef2c95728a6e3725b0f067e4d315c5dbfe5a","benches/xid.rs":"7eb058c1140a253f7177af8868a95aabb1b92c52dc7eee5abbfeadb507d7845d","src/lib.rs":"078912e7c64ba3ea1081b88c2610deba31eeb057c28f9d78e929db4856b7774f","src/tables.rs":"369c476ba91a39fce55563b692a3f598daf7f026cfe0a3796cfed1102fb3b190","tests/compare.rs":"f2311271aa1db7380e5bf153ef83ee99777e14579e4f28c2b1a3e21877ffe715","tests/fst/.gitignore":"2cd419079c0a08bb15766520880998651dd1c72c55347a31f43357595b16ac10","tests/fst/mod.rs":"69a3aaf59acd8bca962ecc6234be56be8c0934ab79b253162f10eb881523901f","tests/fst/xid_continue.fst":"b58be4f0c498253e7a5ac664046096f15f249da66131347d4b822097623549a2","tests/fst/xid_start.fst":"aec7eecdacfce308d2e6210f47d28ed3aad5c8b048efbfbc11fc22e60fbf435b","tests/roaring/mod.rs":"f5c6d55463a7f53e92a493cf046d717149250fbafc0e0fe94bdb531377bf8b11","tests/static_size.rs":"80c3ca7eeec2660f3f4f2efa8fecd6209b32ec8b547192cbfa37c0e67a5f14a0","tests/tables/mod.rs":"e6949172d10fc4b2431ce7546269bfd4f9146454c8c3e31faf5e5d80c16a8ab6","tests/tables/tables.rs":"302d87306100b6280f8db93e167dc70c47f724045cf1312b7354683656c3f36b","tests/trie/mod.rs":"d4acbb716bcbaf80660039797f45e138ed8bbd66749fa3b19b1a971574679cc9","tests/trie/trie.rs":"f7b9edc1e8a98e3be42b653bba27bb4eb5fc48a559d6d8d1c6a4db4b5425b0d5"},"package":"e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75"}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "git": {
3
- "sha1": "94f16bda863a04aabdcaa28c2e5979b5822800c1"
3
+ "sha1": "5b54a632702b5744a1c40ea01c127c0ac0498172"
4
4
  },
5
5
  "path_in_vcs": ""
6
6
  }
@@ -46,9 +46,9 @@ checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
46
46
 
47
47
  [[package]]
48
48
  name = "bitflags"
49
- version = "2.10.0"
49
+ version = "2.11.0"
50
50
  source = "registry+https://github.com/rust-lang/crates.io-index"
51
- checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3"
51
+ checksum = "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af"
52
52
 
53
53
  [[package]]
54
54
  name = "bytemuck"
@@ -70,9 +70,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5"
70
70
 
71
71
  [[package]]
72
72
  name = "cc"
73
- version = "1.2.55"
73
+ version = "1.2.56"
74
74
  source = "registry+https://github.com/rust-lang/crates.io-index"
75
- checksum = "47b26a0954ae34af09b50f0de26458fa95369a0d478d8236d3f93082b219bd29"
75
+ checksum = "aebf35691d1bfb0ac386a69bac2fde4dd276fb618cf8bf4f5318fe285e821bb2"
76
76
  dependencies = [
77
77
  "find-msvc-tools",
78
78
  "shlex",
@@ -124,18 +124,18 @@ dependencies = [
124
124
 
125
125
  [[package]]
126
126
  name = "clap"
127
- version = "4.5.57"
127
+ version = "4.5.58"
128
128
  source = "registry+https://github.com/rust-lang/crates.io-index"
129
- checksum = "6899ea499e3fb9305a65d5ebf6e3d2248c5fab291f300ad0a704fbe142eae31a"
129
+ checksum = "63be97961acde393029492ce0be7a1af7e323e6bae9511ebfac33751be5e6806"
130
130
  dependencies = [
131
131
  "clap_builder",
132
132
  ]
133
133
 
134
134
  [[package]]
135
135
  name = "clap_builder"
136
- version = "4.5.57"
136
+ version = "4.5.58"
137
137
  source = "registry+https://github.com/rust-lang/crates.io-index"
138
- checksum = "7b12c8b680195a62a8364d16b8447b01b6c2c8f9aaf68bee653be34d4245e238"
138
+ checksum = "7f13174bda5dfd69d7e947827e5af4b0f2f94a4a3ee92912fba07a66150f21e2"
139
139
  dependencies = [
140
140
  "anstyle",
141
141
  "clap_lex",
@@ -143,9 +143,9 @@ dependencies = [
143
143
 
144
144
  [[package]]
145
145
  name = "clap_lex"
146
- version = "0.7.7"
146
+ version = "1.0.0"
147
147
  source = "registry+https://github.com/rust-lang/crates.io-index"
148
- checksum = "c3e64b0cc0439b12df2fa678eae89a1c56a529fd067a9115f7827f1fffd22b32"
148
+ checksum = "3a822ea5bc7590f9d40f1ba12c0dc3c2760f3482c6984db1573ad11031420831"
149
149
 
150
150
  [[package]]
151
151
  name = "cpufeatures"
@@ -312,9 +312,9 @@ checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2"
312
312
 
313
313
  [[package]]
314
314
  name = "libc"
315
- version = "0.2.180"
315
+ version = "0.2.182"
316
316
  source = "registry+https://github.com/rust-lang/crates.io-index"
317
- checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc"
317
+ checksum = "6800badb6cb2082ffd7b6a67e6125bb39f18782f793520caee8cb8846be06112"
318
318
 
319
319
  [[package]]
320
320
  name = "log"
@@ -369,7 +369,7 @@ version = "1.0.106"
369
369
  source = "registry+https://github.com/rust-lang/crates.io-index"
370
370
  checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934"
371
371
  dependencies = [
372
- "unicode-ident 1.0.22",
372
+ "unicode-ident 1.0.23",
373
373
  ]
374
374
 
375
375
  [[package]]
@@ -509,13 +509,13 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
509
509
 
510
510
  [[package]]
511
511
  name = "syn"
512
- version = "2.0.114"
512
+ version = "2.0.116"
513
513
  source = "registry+https://github.com/rust-lang/crates.io-index"
514
- checksum = "d4d107df263a3013ef9b1879b0df87d706ff80f65a86ea879bd9c31f9b307c2a"
514
+ checksum = "3df424c70518695237746f84cede799c9c58fcb37450d7b23716568cc8bc69cb"
515
515
  dependencies = [
516
516
  "proc-macro2",
517
517
  "quote",
518
- "unicode-ident 1.0.22",
518
+ "unicode-ident 1.0.23",
519
519
  ]
520
520
 
521
521
  [[package]]
@@ -536,13 +536,13 @@ checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971"
536
536
 
537
537
  [[package]]
538
538
  name = "unicode-ident"
539
- version = "1.0.22"
539
+ version = "1.0.23"
540
540
  source = "registry+https://github.com/rust-lang/crates.io-index"
541
- checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5"
541
+ checksum = "537dd038a89878be9b64dd4bd1b260315c1bb94f4d784956b81e27a088d9a09e"
542
542
 
543
543
  [[package]]
544
544
  name = "unicode-ident"
545
- version = "1.0.23"
545
+ version = "1.0.24"
546
546
  dependencies = [
547
547
  "criterion",
548
548
  "fst",
@@ -776,6 +776,6 @@ dependencies = [
776
776
 
777
777
  [[package]]
778
778
  name = "zmij"
779
- version = "1.0.20"
779
+ version = "1.0.21"
780
780
  source = "registry+https://github.com/rust-lang/crates.io-index"
781
- checksum = "4de98dfa5d5b7fef4ee834d0073d560c9ca7b6c46a71d058c48db7960f8cfaf7"
781
+ checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa"
@@ -13,7 +13,7 @@
13
13
  edition = "2021"
14
14
  rust-version = "1.71"
15
15
  name = "unicode-ident"
16
- version = "1.0.23"
16
+ version = "1.0.24"
17
17
  authors = ["David Tolnay <dtolnay@gmail.com>"]
18
18
  build = false
19
19
  autolib = false
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "unicode-ident"
3
- version = "1.0.23"
3
+ version = "1.0.24"
4
4
  authors = ["David Tolnay <dtolnay@gmail.com>"]
5
5
  categories = ["development-tools::procedural-macro-helpers", "no-std", "no-std::no-alloc"]
6
6
  description = "Determine whether characters have the XID_Start or XID_Continue properties according to Unicode Standard Annex #31"
@@ -242,7 +242,7 @@
242
242
  //! this data structure is straight-line code with no need for branching.
243
243
 
244
244
  #![no_std]
245
- #![doc(html_root_url = "https://docs.rs/unicode-ident/1.0.23")]
245
+ #![doc(html_root_url = "https://docs.rs/unicode-ident/1.0.24")]
246
246
  #![allow(
247
247
  clippy::doc_markdown,
248
248
  clippy::must_use_candidate,