rust-analyzer/syntax_bridge/index.html
github-merge-queue[bot] 7b2caddf6e deploy: a79e27b8d2
2025-09-03 06:16:18 +00:00

10 lines
No EOL
6.8 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Conversions between `SyntaxNode` and `tt::TokenTree`."><title>syntax_bridge - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Italic-81dc35de.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-MediumItalic-ccf7e434.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-84e720fa.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="syntax_bridge" data-themes="" data-resource-suffix="" data-rustdoc-version="1.89.0 (29483883e 2025-08-04)" data-channel="1.89.0" data-search-js="search-92309212.js" data-settings-js="settings-5514c975.js" ><script src="../static.files/storage-4e99c027.js"></script><script defer src="../crates.js"></script><script defer src="../static.files/main-fd3af306.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-32bb7600.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc mod crate"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../syntax_bridge/index.html">syntax_<wbr>bridge</a><span class="version">0.0.0</span></h2></div><div class="sidebar-elems"><ul class="block"><li><a id="all-types" href="all.html">All Items</a></li></ul><section id="rustdoc-toc"><h3><a href="#modules">Crate Items</a></h3><ul class="block"><li><a href="#modules" title="Modules">Modules</a></li><li><a href="#enums" title="Enums">Enums</a></li><li><a href="#traits" title="Traits">Traits</a></li><li><a href="#functions" title="Functions">Functions</a></li></ul></section><div id="rustdoc-modnav"></div></div></nav><div class="sidebar-resizer" title="Drag to resize sidebar"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><h1>Crate <span>syntax_bridge</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/syntax_bridge/lib.rs.html#1-1055">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Conversions between [<code>SyntaxNode</code>] and [<code>tt::TokenTree</code>].</p>
</div></details><h2 id="modules" class="section-header">Modules<a href="#modules" class="anchor">§</a></h2><dl class="item-table"><dt><a class="mod" href="dummy_test_span_utils/index.html" title="mod syntax_bridge::dummy_test_span_utils">dummy_<wbr>test_<wbr>span_<wbr>utils</a></dt><dd>Dummy things for testing where spans dont matter.</dd><dt><a class="mod" href="prettify_macro_expansion/index.html" title="mod syntax_bridge::prettify_macro_expansion">prettify_<wbr>macro_<wbr>expansion</a></dt><dd>Utilities for formatting macro expanded nodes until we get a proper formatter.</dd></dl><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><dl class="item-table"><dt><a class="enum" href="enum.DocCommentDesugarMode.html" title="enum syntax_bridge::DocCommentDesugarMode">DocComment<wbr>Desugar<wbr>Mode</a></dt><dd>Doc comment desugaring differs between mbe and proc-macros.</dd><dt><a class="enum" href="enum.TopEntryPoint.html" title="enum syntax_bridge::TopEntryPoint">TopEntry<wbr>Point</a></dt><dd>Parse the whole of the input as a given syntactic construct.</dd></dl><h2 id="traits" class="section-header">Traits<a href="#traits" class="anchor">§</a></h2><dl class="item-table"><dt><a class="trait" href="trait.SpanMapper.html" title="trait syntax_bridge::SpanMapper">Span<wbr>Mapper</a></dt></dl><h2 id="functions" class="section-header">Functions<a href="#functions" class="anchor">§</a></h2><dl class="item-table"><dt><a class="fn" href="fn.desugar_doc_comment_text.html" title="fn syntax_bridge::desugar_doc_comment_text">desugar_<wbr>doc_<wbr>comment_<wbr>text</a></dt><dd>Returns the textual content of a doc comment block as a quoted string
That is, strips leading <code>///</code> (or <code>/**</code>, etc)
and strips the ending <code>*/</code>
And then quote the string, which is needed to convert to <code>tt::Literal</code></dd><dt><a class="fn" href="fn.parse_to_token_tree.html" title="fn syntax_bridge::parse_to_token_tree">parse_<wbr>to_<wbr>token_<wbr>tree</a></dt><dd>Convert a string to a <code>TokenTree</code>. The spans of the subtree will be anchored to the provided
anchor with the given context.</dd><dt><a class="fn" href="fn.parse_to_token_tree_static_span.html" title="fn syntax_bridge::parse_to_token_tree_static_span">parse_<wbr>to_<wbr>token_<wbr>tree_<wbr>static_<wbr>span</a></dt><dd>Convert a string to a <code>TokenTree</code>. The passed span will be used for all spans of the produced subtree.</dd><dt><a class="fn" href="fn.syntax_node_to_token_tree.html" title="fn syntax_bridge::syntax_node_to_token_tree">syntax_<wbr>node_<wbr>to_<wbr>token_<wbr>tree</a></dt><dd>Converts a syntax tree to a [<code>tt::Subtree</code>] using the provided span map to populate the
subtrees spans.</dd><dt><a class="fn" href="fn.syntax_node_to_token_tree_modified.html" title="fn syntax_bridge::syntax_node_to_token_tree_modified">syntax_<wbr>node_<wbr>to_<wbr>token_<wbr>tree_<wbr>modified</a></dt><dd>Converts a syntax tree to a [<code>tt::Subtree</code>] using the provided span map to populate the
subtrees spans. Additionally using the append and remove parameters, the additional tokens can
be injected or hidden from the output.</dd><dt><a class="fn" href="fn.to_parser_input.html" title="fn syntax_bridge::to_parser_input">to_<wbr>parser_<wbr>input</a></dt><dt><a class="fn" href="fn.token_tree_to_syntax_node.html" title="fn syntax_bridge::token_tree_to_syntax_node">token_<wbr>tree_<wbr>to_<wbr>syntax_<wbr>node</a></dt><dd>Converts a [<code>tt::Subtree</code>] back to a [<code>SyntaxNode</code>].
The produced <code>SpanMap</code> contains a mapping from the syntax nodes offsets to the subtrees spans.</dd></dl></section></div></main></body></html>