index.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <meta name="generator" content="rustdoc">
  7. <meta name="description" content="API documentation for the Rust `parse` mod in crate `syn`.">
  8. <meta name="keywords" content="rust, rustlang, rust-lang, parse">
  9. <title>syn::parse - Rust</title>
  10. <link rel="stylesheet" type="text/css" href="../../normalize.css">
  11. <link rel="stylesheet" type="text/css" href="../../rustdoc.css" id="mainThemeStyle">
  12. <link rel="stylesheet" type="text/css" href="../../dark.css">
  13. <link rel="stylesheet" type="text/css" href="../../main.css" id="themeStyle">
  14. <script src="../../storage.js"></script>
  15. </head>
  16. <body class="rustdoc mod">
  17. <!--[if lte IE 8]>
  18. <div class="warning">
  19. This old browser is unsupported and will most likely display funky
  20. things.
  21. </div>
  22. <![endif]-->
  23. <nav class="sidebar">
  24. <div class="sidebar-menu">&#9776;</div>
  25. <p class='location'>Module parse</p><div class="sidebar-elems"><div class="block items"><ul><li><a href="#enums">Enums</a></li><li><a href="#functions">Functions</a></li></ul></div><p class='location'><a href='../index.html'>syn</a></p><script>window.sidebarCurrent = {name: 'parse', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script></div>
  26. </nav>
  27. <div class="theme-picker">
  28. <button id="theme-picker" aria-label="Pick another theme!">
  29. <img src="../../brush.svg" width="18" alt="Pick another theme!">
  30. </button>
  31. <div id="theme-choices"></div>
  32. </div>
  33. <script src="../../theme.js"></script>
  34. <nav class="sub">
  35. <form class="search-form js-only">
  36. <div class="search-container">
  37. <input class="search-input" name="search"
  38. autocomplete="off"
  39. placeholder="Click or press ‘S’ to search, ‘?’ for more options…"
  40. type="search">
  41. </div>
  42. </form>
  43. </nav>
  44. <section id='main' class="content">
  45. <h1 class='fqn'><span class='in-band'>Module <a href='../index.html'>syn</a>::<wbr><a class="mod" href=''>parse</a></span><span class='out-of-band'><span id='render-detail'>
  46. <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
  47. [<span class='inner'>&#x2212;</span>]
  48. </a>
  49. </span><a class='srclink' href='../../src/syn/lib.rs.html#185-211' title='goto source code'>[src]</a></span></h1>
  50. <div class='docblock'><p>This module contains a set of exported nom parsers which can be used to
  51. parse custom grammars when used alongside the <code>synom</code> crate.</p>
  52. <p>Internally, <code>syn</code> uses a fork of <code>nom</code> called <code>synom</code> which resolves a
  53. persistent pitfall of using <code>nom</code> to parse Rust by eliminating the
  54. <code>IResult::Incomplete</code> variant. The <code>synom</code> crate should be used instead
  55. of <code>nom</code> when working with the parsers in this module.</p>
  56. </div><h2 id='enums' class='section-header'><a href="#enums">Enums</a></h2>
  57. <table>
  58. <tr class=' module-item'>
  59. <td><a class="enum" href="enum.IResult.html"
  60. title='enum syn::parse::IResult'>IResult</a></td>
  61. <td class='docblock-short'>
  62. <p>The result of a parser.</p>
  63. </td>
  64. </tr></table><h2 id='functions' class='section-header'><a href="#functions">Functions</a></h2>
  65. <table>
  66. <tr class=' module-item'>
  67. <td><a class="fn" href="fn.boolean.html"
  68. title='fn syn::parse::boolean'>boolean</a></td>
  69. <td class='docblock-short'>
  70. </td>
  71. </tr>
  72. <tr class=' module-item'>
  73. <td><a class="fn" href="fn.byte.html"
  74. title='fn syn::parse::byte'>byte</a></td>
  75. <td class='docblock-short'>
  76. </td>
  77. </tr>
  78. <tr class=' module-item'>
  79. <td><a class="fn" href="fn.byte_string.html"
  80. title='fn syn::parse::byte_string'>byte_string</a></td>
  81. <td class='docblock-short'>
  82. </td>
  83. </tr>
  84. <tr class=' module-item'>
  85. <td><a class="fn" href="fn.character.html"
  86. title='fn syn::parse::character'>character</a></td>
  87. <td class='docblock-short'>
  88. </td>
  89. </tr>
  90. <tr class=' module-item'>
  91. <td><a class="fn" href="fn.float.html"
  92. title='fn syn::parse::float'>float</a></td>
  93. <td class='docblock-short'>
  94. </td>
  95. </tr>
  96. <tr class=' module-item'>
  97. <td><a class="fn" href="fn.ident.html"
  98. title='fn syn::parse::ident'>ident</a></td>
  99. <td class='docblock-short'>
  100. </td>
  101. </tr>
  102. <tr class=' module-item'>
  103. <td><a class="fn" href="fn.int.html"
  104. title='fn syn::parse::int'>int</a></td>
  105. <td class='docblock-short'>
  106. </td>
  107. </tr>
  108. <tr class=' module-item'>
  109. <td><a class="fn" href="fn.lifetime.html"
  110. title='fn syn::parse::lifetime'>lifetime</a></td>
  111. <td class='docblock-short'>
  112. </td>
  113. </tr>
  114. <tr class=' module-item'>
  115. <td><a class="fn" href="fn.lit.html"
  116. title='fn syn::parse::lit'>lit</a></td>
  117. <td class='docblock-short'>
  118. </td>
  119. </tr>
  120. <tr class=' module-item'>
  121. <td><a class="fn" href="fn.path.html"
  122. title='fn syn::parse::path'>path</a></td>
  123. <td class='docblock-short'>
  124. </td>
  125. </tr>
  126. <tr class=' module-item'>
  127. <td><a class="fn" href="fn.string.html"
  128. title='fn syn::parse::string'>string</a></td>
  129. <td class='docblock-short'>
  130. </td>
  131. </tr>
  132. <tr class=' module-item'>
  133. <td><a class="fn" href="fn.tt.html"
  134. title='fn syn::parse::tt'>tt</a></td>
  135. <td class='docblock-short'>
  136. </td>
  137. </tr>
  138. <tr class=' module-item'>
  139. <td><a class="fn" href="fn.ty.html"
  140. title='fn syn::parse::ty'>ty</a></td>
  141. <td class='docblock-short'>
  142. </td>
  143. </tr></table></section>
  144. <section id='search' class="content hidden"></section>
  145. <section class="footer"></section>
  146. <aside id="help" class="hidden">
  147. <div>
  148. <h1 class="hidden">Help</h1>
  149. <div class="shortcuts">
  150. <h2>Keyboard Shortcuts</h2>
  151. <dl>
  152. <dt><kbd>?</kbd></dt>
  153. <dd>Show this help dialog</dd>
  154. <dt><kbd>S</kbd></dt>
  155. <dd>Focus the search field</dd>
  156. <dt><kbd>↑</kbd></dt>
  157. <dd>Move up in search results</dd>
  158. <dt><kbd>↓</kbd></dt>
  159. <dd>Move down in search results</dd>
  160. <dt><kbd>↹</kbd></dt>
  161. <dd>Switch tab</dd>
  162. <dt><kbd>&#9166;</kbd></dt>
  163. <dd>Go to active search result</dd>
  164. <dt><kbd>+</kbd></dt>
  165. <dd>Expand all sections</dd>
  166. <dt><kbd>-</kbd></dt>
  167. <dd>Collapse all sections</dd>
  168. </dl>
  169. </div>
  170. <div class="infos">
  171. <h2>Search Tricks</h2>
  172. <p>
  173. Prefix searches with a type followed by a colon (e.g.
  174. <code>fn:</code>) to restrict the search to a given type.
  175. </p>
  176. <p>
  177. Accepted types are: <code>fn</code>, <code>mod</code>,
  178. <code>struct</code>, <code>enum</code>,
  179. <code>trait</code>, <code>type</code>, <code>macro</code>,
  180. and <code>const</code>.
  181. </p>
  182. <p>
  183. Search functions by type signature (e.g.
  184. <code>vec -> usize</code> or <code>* -> vec</code>)
  185. </p>
  186. </div>
  187. </div>
  188. </aside>
  189. <script>
  190. window.rootPath = "../../";
  191. window.currentCrate = "syn";
  192. </script>
  193. <script src="../../main.js"></script>
  194. <script defer src="../../search-index.js"></script>
  195. </body>
  196. </html>