mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-11 20:58:54 +00:00
10 lines
No EOL
7.3 KiB
HTML
10 lines
No EOL
7.3 KiB
HTML
<!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-Regular-0fe48ade.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-42caa33d.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.84.0 (9fc6b4312 2025-01-07)" data-channel="1.84.0" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../static.files/storage-59e33391.js"></script><script defer src="../crates.js"></script><script defer src="../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-893ab5e7.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"></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-1016">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><ul class="item-table"><li><div class="item-name"><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></div><div class="desc docblock-short">Dummy things for testing where spans don’t matter.</div></li><li><div class="item-name"><a class="mod" href="prettify_macro_expansion/index.html" title="mod syntax_bridge::prettify_macro_expansion">prettify_<wbr>macro_<wbr>expansion</a></div><div class="desc docblock-short">Utilities for formatting macro expanded nodes until we get a proper formatter.</div></li></ul><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="enum" href="enum.DocCommentDesugarMode.html" title="enum syntax_bridge::DocCommentDesugarMode">DocComment<wbr>Desugar<wbr>Mode</a></div><div class="desc docblock-short">Doc comment desugaring differs between mbe and proc-macros.</div></li><li><div class="item-name"><a class="enum" href="enum.TopEntryPoint.html" title="enum syntax_bridge::TopEntryPoint">TopEntry<wbr>Point</a></div><div class="desc docblock-short">Parse the whole of the input as a given syntactic construct.</div></li></ul><h2 id="traits" class="section-header">Traits<a href="#traits" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="trait" href="trait.SpanMapper.html" title="trait syntax_bridge::SpanMapper">Span<wbr>Mapper</a></div></li></ul><h2 id="functions" class="section-header">Functions<a href="#functions" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><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></div><div class="desc docblock-short">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></div></li><li><div class="item-name"><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></div><div class="desc docblock-short">Convert a string to a <code>TokenTree</code>. The spans of the subtree will be anchored to the provided
|
||
anchor with the given context.</div></li><li><div class="item-name"><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></div><div class="desc docblock-short">Convert a string to a <code>TokenTree</code>. The passed span will be used for all spans of the produced subtree.</div></li><li><div class="item-name"><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></div><div class="desc docblock-short">Converts a syntax tree to a [<code>tt::Subtree</code>] using the provided span map to populate the
|
||
subtree’s spans.</div></li><li><div class="item-name"><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></div><div class="desc docblock-short">Converts a syntax tree to a [<code>tt::Subtree</code>] using the provided span map to populate the
|
||
subtree’s spans. Additionally using the append and remove parameters, the additional tokens can
|
||
be injected or hidden from the output.</div></li><li><div class="item-name"><a class="fn" href="fn.to_parser_input.html" title="fn syntax_bridge::to_parser_input">to_<wbr>parser_<wbr>input</a></div></li><li><div class="item-name"><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></div><div class="desc docblock-short">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 subtree’s spans.</div></li></ul></section></div></main></body></html> |