forked from argotorg/fe
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstruct.Parser.html
More file actions
74 lines (74 loc) · 40.9 KB
/
Copy pathstruct.Parser.html
File metadata and controls
74 lines (74 loc) · 40.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<!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="`Parser` maintains the parsing state, such as the token stream, indent stack, paren stack, diagnostics, etc. Syntax parsing logic is in the [`crate::grammar`] module."><meta name="keywords" content="rust, rustlang, rust-lang, Parser"><title>Parser in fe_parser - Rust</title><link rel="stylesheet" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><link rel="stylesheet" type="text/css" href="../dark.css" disabled ><link rel="stylesheet" type="text/css" href="../ayu.css" disabled ><script id="default-settings" ></script><script src="../storage.js"></script><script src="../crates.js"></script><script defer src="../main.js"></script>
<noscript><link rel="stylesheet" href="../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../favicon.svg"><style type="text/css">#crate-search{background-image:url("../down-arrow.svg");}</style></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a href='../fe_parser/index.html'><div class='logo-container rust-logo'><img src='../rust-logo.png' alt='logo'></div></a><h2 class="location">Struct Parser</h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#fields">Fields</a></h3><div class="sidebar-links"><a href="#structfield.diagnostics">diagnostics</a><a href="#structfield.file_id">file_id</a></div><h3 class="sidebar-title"><a href="#implementations">Methods</a></h3><div class="sidebar-links"><a href="#method.as_bt_parser">as_bt_parser</a><a href="#method.assert">assert</a><a href="#method.done">done</a><a href="#method.enter_block">enter_block</a><a href="#method.error">error</a><a href="#method.expect">expect</a><a href="#method.expect_newline">expect_newline</a><a href="#method.expect_with_notes">expect_with_notes</a><a href="#method.fancy_error">fancy_error</a><a href="#method.last_indent">last_indent</a><a href="#method.new">new</a><a href="#method.next">next</a><a href="#method.optional">optional</a><a href="#method.peek">peek</a><a href="#method.peek_or_err">peek_or_err</a><a href="#method.peeked_text">peeked_text</a><a href="#method.split_next">split_next</a><a href="#method.unexpected_token_error">unexpected_token_error</a></div><h3 class="sidebar-title"><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><h3 class="sidebar-title"><a href="#blanket-implementations">Blanket Implementations</a></h3><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a></div></div><h2 class="location">Other items in<br><a href="index.html">fe_parser</a></h2><div id="sidebar-vars" data-name="Parser" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../brush.svg"></button><div id="theme-choices" role="menu"></div></div><nav class="sub"><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../wheel.svg"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="in-band">Struct <a href="index.html">fe_parser</a>::<wbr><a class="struct" href="#">Parser</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../src/fe_parser/parser.rs.html#28-43" title="goto source code">[src]</a></span></h1><div class="docblock item-decl"><pre class="rust struct"><code>pub struct Parser<'a> {
pub file_id: <a class="struct" href="../fe_common/files/struct.SourceFileId.html" title="struct fe_common::files::SourceFileId">SourceFileId</a>,
pub diagnostics: <a class="struct" href="https://doc.rust-lang.org/1.58.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../fe_common/diagnostics/struct.Diagnostic.html" title="struct fe_common::diagnostics::Diagnostic">Diagnostic</a>>,
// some fields omitted
}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p><code>Parser</code> maintains the parsing state, such as the token stream,
indent stack, paren stack, diagnostics, etc.
Syntax parsing logic is in the <a href="grammar/index.html" title="crate::grammar"><code>crate::grammar</code></a> module.</p>
<p>See [<code>BTParser</code>] if you need backtrackable parser.</p>
</div></details><h2 id="fields" class="fields small-section-header">Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.file_id" class="structfield small-section-header"><a href="#structfield.file_id" class="anchor field"></a><code>file_id: <a class="struct" href="../fe_common/files/struct.SourceFileId.html" title="struct fe_common::files::SourceFileId">SourceFileId</a></code></span><span id="structfield.diagnostics" class="structfield small-section-header"><a href="#structfield.diagnostics" class="anchor field"></a><code>diagnostics: <a class="struct" href="https://doc.rust-lang.org/1.58.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="../fe_common/diagnostics/struct.Diagnostic.html" title="struct fe_common::diagnostics::Diagnostic">Diagnostic</a>></code></span><div class="docblock"><p>The diagnostics (errors and warnings) emitted during parsing.</p>
</div><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../src/fe_parser/parser.rs.html#45-482" title="goto source code">[src]</a></div><a href="#impl" class="anchor"></a><h3 class="code-header in-band">impl<'a> <a class="struct" href="struct.Parser.html" title="struct fe_parser::Parser">Parser</a><'a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.new" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/fe_parser/parser.rs.html#47-62" title="goto source code">[src]</a></div><a href="#method.new" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.new" class="fnname">new</a>(file_id: <a class="struct" href="../fe_common/files/struct.SourceFileId.html" title="struct fe_common::files::SourceFileId">SourceFileId</a>, content: &'a <a class="primitive" href="https://doc.rust-lang.org/1.58.1/std/primitive.str.html">str</a>) -> Self</h4></div></summary><div class="docblock"><p>Create a new parser for a source code string and associated file id.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.as_bt_parser" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/fe_parser/parser.rs.html#65-67" title="goto source code">[src]</a></div><a href="#method.as_bt_parser" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.as_bt_parser" class="fnname">as_bt_parser</a><'b>(&'b mut self) -> BTParser<'a, 'b></h4></div></summary><div class="docblock"><p>Return as wrapped back tracking parser</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.next" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/fe_parser/parser.rs.html#71-113" title="goto source code">[src]</a></div><a href="#method.next" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.next" class="fnname">next</a>(&mut self) -> <a class="type" href="type.ParseResult.html" title="type fe_parser::ParseResult">ParseResult</a><<a class="struct" href="lexer/struct.Token.html" title="struct fe_parser::lexer::Token">Token</a><'a>></h4></div></summary><div class="docblock"><p>Return the next token, or an error if we’ve reached the end of the file.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.peek_or_err" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/fe_parser/parser.rs.html#121-135" title="goto source code">[src]</a></div><a href="#method.peek_or_err" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.peek_or_err" class="fnname">peek_or_err</a>(&mut self) -> <a class="type" href="type.ParseResult.html" title="type fe_parser::ParseResult">ParseResult</a><<a class="enum" href="lexer/enum.TokenKind.html" title="enum fe_parser::lexer::TokenKind">TokenKind</a>></h4></div></summary><div class="docblock"><p>Take a peek at the next token kind without consuming it, or return an
error if we’ve reached the end of the file.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.peek" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/fe_parser/parser.rs.html#139-144" title="goto source code">[src]</a></div><a href="#method.peek" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.peek" class="fnname">peek</a>(&mut self) -> <a class="enum" href="https://doc.rust-lang.org/1.58.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="enum" href="lexer/enum.TokenKind.html" title="enum fe_parser::lexer::TokenKind">TokenKind</a>></h4></div></summary><div class="docblock"><p>Take a peek at the next token kind. Returns <code>None</code> if we’ve reached the
end of the file.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.peeked_text" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/fe_parser/parser.rs.html#155-157" title="goto source code">[src]</a></div><a href="#method.peeked_text" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.peeked_text" class="fnname">peeked_text</a>(&mut self) -> &'a <a class="primitive" href="https://doc.rust-lang.org/1.58.1/std/primitive.str.html">str</a></h4></div></summary><div class="docblock"><p>Peek at the text of the next token, without consuming it. This is useful
for words that are keywords in some contexts, but not others. E.g.
<code>from</code> can be used as a variable or field name, but it’s the leading
keyword of a <code>from x import y</code> statement.</p>
<h5 id="panics" class="section-header"><a href="#panics">Panics</a></h5>
<p>This function must only be used in cases where the kind of the next
token has already been <a href="struct.Parser.html#method.peek" title="Parser::peek"><code>Parser::peek</code></a>ed. If there is no next token, it
will panic.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.split_next" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/fe_parser/parser.rs.html#177-193" title="goto source code">[src]</a></div><a href="#method.split_next" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.split_next" class="fnname">split_next</a>(&mut self) -> <a class="type" href="type.ParseResult.html" title="type fe_parser::ParseResult">ParseResult</a><<a class="struct" href="lexer/struct.Token.html" title="struct fe_parser::lexer::Token">Token</a><'a>></h4></div></summary><div class="docblock"><p>Split the next token into two tokens, returning the first. Only supports
splitting the <code>>></code> token into two <code>></code> tokens, specifically for
parsing the closing angle bracket of a generic type argument list
(<code>Map<x, Map<y, z>></code>).</p>
<h5 id="panics-1" class="section-header"><a href="#panics-1">Panics</a></h5>
<p>Panics if the next token isn’t <code>>></code></p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.done" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/fe_parser/parser.rs.html#196-198" title="goto source code">[src]</a></div><a href="#method.done" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.done" class="fnname">done</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.58.1/std/primitive.bool.html">bool</a></h4></div></summary><div class="docblock"><p>Returns <code>true</code> if the parser has reached the end of the file.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.last_indent" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/fe_parser/parser.rs.html#202-204" title="goto source code">[src]</a></div><a href="#method.last_indent" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.last_indent" class="fnname">last_indent</a>(&self) -> &'a <a class="primitive" href="https://doc.rust-lang.org/1.58.1/std/primitive.str.html">str</a></h4></div></summary><div class="docblock"><p>The leading whitespace string of the last-seen indented line.
This does not include lines inside of parentheses.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.assert" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/fe_parser/parser.rs.html#218-222" title="goto source code">[src]</a></div><a href="#method.assert" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.assert" class="fnname">assert</a>(&mut self, tk: <a class="enum" href="lexer/enum.TokenKind.html" title="enum fe_parser::lexer::TokenKind">TokenKind</a>) -> <a class="struct" href="lexer/struct.Token.html" title="struct fe_parser::lexer::Token">Token</a><'a></h4></div></summary><div class="docblock"><p>Assert that the next token kind it matches the expected token
kind, and return it. This should be used in cases where the next token
kind is expected to have been checked already.</p>
<h5 id="panics-2" class="section-header"><a href="#panics-2">Panics</a></h5>
<p>Panics if the next token kind isn’t <code>tk</code>.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.expect" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/fe_parser/parser.rs.html#226-232" title="goto source code">[src]</a></div><a href="#method.expect" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.expect" class="fnname">expect</a><S: <a class="trait" href="https://doc.rust-lang.org/1.58.1/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="https://doc.rust-lang.org/1.58.1/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>>(<br> &mut self, <br> expected: <a class="enum" href="lexer/enum.TokenKind.html" title="enum fe_parser::lexer::TokenKind">TokenKind</a>, <br> message: S<br>) -> <a class="type" href="type.ParseResult.html" title="type fe_parser::ParseResult">ParseResult</a><<a class="struct" href="lexer/struct.Token.html" title="struct fe_parser::lexer::Token">Token</a><'a>></h4></div></summary><div class="docblock"><p>If the next token matches the expected kind, return it. Otherwise emit
an error diagnostic with the given message and return an error.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.expect_with_notes" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/fe_parser/parser.rs.html#238-266" title="goto source code">[src]</a></div><a href="#method.expect_with_notes" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.expect_with_notes" class="fnname">expect_with_notes</a><Str, NotesFn>(<br> &mut self, <br> expected: <a class="enum" href="lexer/enum.TokenKind.html" title="enum fe_parser::lexer::TokenKind">TokenKind</a>, <br> message: Str, <br> notes_fn: NotesFn<br>) -> <a class="type" href="type.ParseResult.html" title="type fe_parser::ParseResult">ParseResult</a><<a class="struct" href="lexer/struct.Token.html" title="struct fe_parser::lexer::Token">Token</a><'a>> <span class="where fmt-newline">where<br> Str: <a class="trait" href="https://doc.rust-lang.org/1.58.1/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="https://doc.rust-lang.org/1.58.1/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>,<br> NotesFn: <a class="trait" href="https://doc.rust-lang.org/1.58.1/core/ops/function/trait.FnOnce.html" title="trait core::ops::function::FnOnce">FnOnce</a>(&<a class="struct" href="lexer/struct.Token.html" title="struct fe_parser::lexer::Token">Token</a><'_>) -> <a class="struct" href="https://doc.rust-lang.org/1.58.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="https://doc.rust-lang.org/1.58.1/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>, </span></h4></div></summary><div class="docblock"><p>Like <a href="struct.Parser.html#method.expect" title="Parser::expect"><code>Parser::expect</code></a>, but with additional notes to be appended to the
bottom of the diagnostic message. The notes are provided by a
function that returns a <code>Vec<String></code>, to avoid allocations in the
case where the token is as expected.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.optional" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/fe_parser/parser.rs.html#269-275" title="goto source code">[src]</a></div><a href="#method.optional" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.optional" class="fnname">optional</a>(&mut self, kind: <a class="enum" href="lexer/enum.TokenKind.html" title="enum fe_parser::lexer::TokenKind">TokenKind</a>) -> <a class="enum" href="https://doc.rust-lang.org/1.58.1/core/option/enum.Option.html" title="enum core::option::Option">Option</a><<a class="struct" href="lexer/struct.Token.html" title="struct fe_parser::lexer::Token">Token</a><'a>></h4></div></summary><div class="docblock"><p>If the next token matches the expected kind, return it. Otherwise return None.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.unexpected_token_error" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/fe_parser/parser.rs.html#278-289" title="goto source code">[src]</a></div><a href="#method.unexpected_token_error" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.unexpected_token_error" class="fnname">unexpected_token_error</a><S: <a class="trait" href="https://doc.rust-lang.org/1.58.1/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="https://doc.rust-lang.org/1.58.1/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>>(<br> &mut self, <br> span: <a class="struct" href="node/struct.Span.html" title="struct fe_parser::node::Span">Span</a>, <br> message: S, <br> notes: <a class="struct" href="https://doc.rust-lang.org/1.58.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="https://doc.rust-lang.org/1.58.1/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>><br>)</h4></div></summary><div class="docblock"><p>Emit an “unexpected token” error diagnostic with the given message.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.enter_block" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/fe_parser/parser.rs.html#299-341" title="goto source code">[src]</a></div><a href="#method.enter_block" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.enter_block" class="fnname">enter_block</a>(<br> &mut self, <br> context_span: <a class="struct" href="node/struct.Span.html" title="struct fe_parser::node::Span">Span</a>, <br> context_name: &<a class="primitive" href="https://doc.rust-lang.org/1.58.1/std/primitive.str.html">str</a><br>) -> <a class="type" href="type.ParseResult.html" title="type fe_parser::ParseResult">ParseResult</a><<a class="primitive" href="https://doc.rust-lang.org/1.58.1/std/primitive.unit.html">()</a>></h4></div></summary><div class="docblock"><p>Enter an indented block, which is expected to be non-empty. This checks
for and consumes the colon that precedes the block. If no colon is
found, it emits an error and keeps parsing. Any number of
newlines are allowed before the first non-empty indented line.
Returns an error if the block has no non-empty indented line.</p>
<h5 id="panics-3" class="section-header"><a href="#panics-3">Panics</a></h5>
<p>Panics if called while the parser is inside a set of parentheses.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.expect_newline" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/fe_parser/parser.rs.html#350-366" title="goto source code">[src]</a></div><a href="#method.expect_newline" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.expect_newline" class="fnname">expect_newline</a>(&mut self, context_name: &<a class="primitive" href="https://doc.rust-lang.org/1.58.1/std/primitive.str.html">str</a>) -> <a class="type" href="type.ParseResult.html" title="type fe_parser::ParseResult">ParseResult</a><<a class="primitive" href="https://doc.rust-lang.org/1.58.1/std/primitive.unit.html">()</a>></h4></div></summary><div class="docblock"><p>Expect and consume one or more newlines, without returning them.
Returns an error if the next token isn’t a newline or the end of the
file, or if the indent of the next non-empty line doesn’t match the
current indentation.</p>
<h5 id="panics-4" class="section-header"><a href="#panics-4">Panics</a></h5>
<p>Panics if called while the parser is inside a set of parentheses.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.error" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/fe_parser/parser.rs.html#426-433" title="goto source code">[src]</a></div><a href="#method.error" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.error" class="fnname">error</a><S: <a class="trait" href="https://doc.rust-lang.org/1.58.1/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="https://doc.rust-lang.org/1.58.1/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>>(&mut self, span: <a class="struct" href="node/struct.Span.html" title="struct fe_parser::node::Span">Span</a>, message: S)</h4></div></summary><div class="docblock"><p>Emit an error diagnostic, but don’t stop parsing</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.fancy_error" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/fe_parser/parser.rs.html#437-449" title="goto source code">[src]</a></div><a href="#method.fancy_error" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.fancy_error" class="fnname">fancy_error</a><S: <a class="trait" href="https://doc.rust-lang.org/1.58.1/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><<a class="struct" href="https://doc.rust-lang.org/1.58.1/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>>>(<br> &mut self, <br> message: S, <br> labels: <a class="struct" href="https://doc.rust-lang.org/1.58.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="struct.Label.html" title="struct fe_parser::Label">Label</a>>, <br> notes: <a class="struct" href="https://doc.rust-lang.org/1.58.1/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="struct" href="https://doc.rust-lang.org/1.58.1/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>><br>)</h4></div></summary><div class="docblock"><p>Emit a “fancy” error diagnostic with any number of labels and notes,
but don’t stop parsing.</p>
</div></details></div></details><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><div id="impl-RefUnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-RefUnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl<'a> <a class="trait" href="https://doc.rust-lang.org/1.58.1/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.Parser.html" title="struct fe_parser::Parser">Parser</a><'a></h3></div><div id="impl-Send" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Send" class="anchor"></a><h3 class="code-header in-band">impl<'a> <a class="trait" href="https://doc.rust-lang.org/1.58.1/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.Parser.html" title="struct fe_parser::Parser">Parser</a><'a></h3></div><div id="impl-Sync" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Sync" class="anchor"></a><h3 class="code-header in-band">impl<'a> <a class="trait" href="https://doc.rust-lang.org/1.58.1/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.Parser.html" title="struct fe_parser::Parser">Parser</a><'a></h3></div><div id="impl-Unpin" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Unpin" class="anchor"></a><h3 class="code-header in-band">impl<'a> <a class="trait" href="https://doc.rust-lang.org/1.58.1/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.Parser.html" title="struct fe_parser::Parser">Parser</a><'a></h3></div><div id="impl-UnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-UnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl<'a> <a class="trait" href="https://doc.rust-lang.org/1.58.1/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.Parser.html" title="struct fe_parser::Parser">Parser</a><'a></h3></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Any" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.58.1/src/core/any.rs.html#132-136" title="goto source code">[src]</a></div><a href="#impl-Any" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.58.1/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/1.58.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.type_id" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.58.1/src/core/any.rs.html#133" title="goto source code">[src]</a></div><a href="#method.type_id" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.58.1/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/1.58.1/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></div></summary><div class='docblock'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/1.58.1/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Borrow%3CT%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.58.1/src/core/borrow.rs.html#208-213" title="goto source code">[src]</a></div><a href="#impl-Borrow%3CT%3E" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.58.1/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/1.58.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.58.1/src/core/borrow.rs.html#210" title="goto source code">[src]</a></div><a href="#method.borrow" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.58.1/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/1.58.1/std/primitive.reference.html">&</a>T</h4></div></summary><div class='docblock'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.58.1/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-BorrowMut%3CT%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.58.1/src/core/borrow.rs.html#216-220" title="goto source code">[src]</a></div><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.58.1/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/1.58.1/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow_mut" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.58.1/src/core/borrow.rs.html#217" title="goto source code">[src]</a></div><a href="#method.borrow_mut" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.58.1/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/1.58.1/std/primitive.reference.html">&mut </a>T</h4></div></summary><div class='docblock'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/1.58.1/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-From%3CT%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.58.1/src/core/convert/mod.rs.html#549-553" title="goto source code">[src]</a></div><a href="#impl-From%3CT%3E" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/1.58.1/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.from" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.58.1/src/core/convert/mod.rs.html#550" title="goto source code">[src]</a></div><a href="#method.from" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.58.1/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -> T</h4></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Into%3CU%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.58.1/src/core/convert/mod.rs.html#537-544" title="goto source code">[src]</a></div><a href="#impl-Into%3CU%3E" class="anchor"></a><h3 class="code-header in-band">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.58.1/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/1.58.1/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.into" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.58.1/src/core/convert/mod.rs.html#541" title="goto source code">[src]</a></div><a href="#method.into" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.58.1/core/convert/trait.Into.html#tymethod.into" class="fnname">into</a>(self) -> U</h4></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-TryFrom%3CU%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.58.1/src/core/convert/mod.rs.html#587-596" title="goto source code">[src]</a></div><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><h3 class="code-header in-band">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.58.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/1.58.1/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error" class="type trait-impl has-srclink"><a href="#associatedtype.Error" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.58.1/core/convert/trait.TryFrom.html#associatedtype.Error" class="type">Error</a> = <a class="enum" href="https://doc.rust-lang.org/1.58.1/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4></div></summary><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_from" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.58.1/src/core/convert/mod.rs.html#593" title="goto source code">[src]</a></div><a href="#method.try_from" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.58.1/core/convert/trait.TryFrom.html#tymethod.try_from" class="fnname">try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/1.58.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/1.58.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="type" href="https://doc.rust-lang.org/1.58.1/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-TryInto%3CU%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.58.1/src/core/convert/mod.rs.html#573-582" title="goto source code">[src]</a></div><a href="#impl-TryInto%3CU%3E" class="anchor"></a><h3 class="code-header in-band">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/1.58.1/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/1.58.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error-1" class="type trait-impl has-srclink"><a href="#associatedtype.Error-1" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/1.58.1/core/convert/trait.TryInto.html#associatedtype.Error" class="type">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/1.58.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/1.58.1/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4></div></summary><div class='docblock'><p>The type returned in the event of a conversion error.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_into" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/1.58.1/src/core/convert/mod.rs.html#579" title="goto source code">[src]</a></div><a href="#method.try_into" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/1.58.1/core/convert/trait.TryInto.html#tymethod.try_into" class="fnname">try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/1.58.1/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/1.58.1/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="type" href="https://doc.rust-lang.org/1.58.1/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></div></summary><div class='docblock'><p>Performs the conversion.</p>
</div></details></div></details></div></section><section id="search" class="content hidden"></section><div id="rustdoc-vars" data-root-path="../" data-current-crate="fe_parser" data-search-index-js="../search-index.js" data-search-js="../search.js"></div>
</body></html>