Coverage Report

Created: 2025-01-09 07:53

/src/wasm-tools/crates/wast/src/parser.rs
Line
Count
Source (jump to first uncovered line)
1
//! Traits for parsing the WebAssembly Text format
2
//!
3
//! This module contains the traits, abstractions, and utilities needed to
4
//! define custom parsers for WebAssembly text format items. This module exposes
5
//! a recursive descent parsing strategy and centers around the [`Parse`] trait
6
//! for defining new fragments of WebAssembly text syntax.
7
//!
8
//! The top-level [`parse`] function can be used to fully parse AST fragments:
9
//!
10
//! ```
11
//! use wast::Wat;
12
//! use wast::parser::{self, ParseBuffer};
13
//!
14
//! # fn foo() -> Result<(), wast::Error> {
15
//! let wat = "(module (func))";
16
//! let buf = ParseBuffer::new(wat)?;
17
//! let module = parser::parse::<Wat>(&buf)?;
18
//! # Ok(())
19
//! # }
20
//! ```
21
//!
22
//! and you can also define your own new syntax with the [`Parse`] trait:
23
//!
24
//! ```
25
//! use wast::kw;
26
//! use wast::core::{Import, Func};
27
//! use wast::parser::{Parser, Parse, Result};
28
//!
29
//! // Fields of a WebAssembly which only allow imports and functions, and all
30
//! // imports must come before all the functions
31
//! struct OnlyImportsAndFunctions<'a> {
32
//!     imports: Vec<Import<'a>>,
33
//!     functions: Vec<Func<'a>>,
34
//! }
35
//!
36
//! impl<'a> Parse<'a> for OnlyImportsAndFunctions<'a> {
37
//!     fn parse(parser: Parser<'a>) -> Result<Self> {
38
//!         // While the second token is `import` (the first is `(`, so we care
39
//!         // about the second) we parse an `ast::ModuleImport` inside of
40
//!         // parentheses. The `parens` function here ensures that what we
41
//!         // parse inside of it is surrounded by `(` and `)`.
42
//!         let mut imports = Vec::new();
43
//!         while parser.peek2::<kw::import>()? {
44
//!             let import = parser.parens(|p| p.parse())?;
45
//!             imports.push(import);
46
//!         }
47
//!
48
//!         // Afterwards we assume everything else is a function. Note that
49
//!         // `parse` here is a generic function and type inference figures out
50
//!         // that we're parsing functions here and imports above.
51
//!         let mut functions = Vec::new();
52
//!         while !parser.is_empty() {
53
//!             let func = parser.parens(|p| p.parse())?;
54
//!             functions.push(func);
55
//!         }
56
//!
57
//!         Ok(OnlyImportsAndFunctions { imports, functions })
58
//!     }
59
//! }
60
//! ```
61
//!
62
//! This module is heavily inspired by [`syn`](https://docs.rs/syn) so you can
63
//! likely also draw inspiration from the excellent examples in the `syn` crate.
64
65
use crate::lexer::{Float, Integer, Lexer, Token, TokenKind};
66
use crate::token::Span;
67
use crate::Error;
68
use bumpalo::Bump;
69
use std::borrow::Cow;
70
use std::cell::{Cell, RefCell};
71
use std::collections::HashMap;
72
use std::fmt;
73
use std::usize;
74
75
/// The maximum recursive depth of parens to parse.
76
///
77
/// This is sort of a fundamental limitation of the way this crate is
78
/// designed. Everything is done through recursive descent parsing which
79
/// means, well, that we're recursively going down the stack as we parse
80
/// nested data structures. While we can handle this for wasm expressions
81
/// since that's a pretty local decision, handling this for nested
82
/// modules/components which be far trickier. For now we just say that when
83
/// the parser goes too deep we return an error saying there's too many
84
/// nested items. It would be great to not return an error here, though!
85
#[cfg(feature = "wasm-module")]
86
pub(crate) const MAX_PARENS_DEPTH: usize = 100;
87
88
/// A top-level convenience parsing function that parses a `T` from `buf` and
89
/// requires that all tokens in `buf` are consume.
90
///
91
/// This generic parsing function can be used to parse any `T` implementing the
92
/// [`Parse`] trait. It is not used from [`Parse`] trait implementations.
93
///
94
/// # Examples
95
///
96
/// ```
97
/// use wast::Wat;
98
/// use wast::parser::{self, ParseBuffer};
99
///
100
/// # fn foo() -> Result<(), wast::Error> {
101
/// let wat = "(module (func))";
102
/// let buf = ParseBuffer::new(wat)?;
103
/// let module = parser::parse::<Wat>(&buf)?;
104
/// # Ok(())
105
/// # }
106
/// ```
107
///
108
/// or parsing simply a fragment
109
///
110
/// ```
111
/// use wast::parser::{self, ParseBuffer};
112
///
113
/// # fn foo() -> Result<(), wast::Error> {
114
/// let wat = "12";
115
/// let buf = ParseBuffer::new(wat)?;
116
/// let val = parser::parse::<u32>(&buf)?;
117
/// assert_eq!(val, 12);
118
/// # Ok(())
119
/// # }
120
/// ```
121
13.6k
pub fn parse<'a, T: Parse<'a>>(buf: &'a ParseBuffer<'a>) -> Result<T> {
122
13.6k
    let parser = buf.parser();
123
13.6k
    let result = parser.parse()?;
124
11.3k
    if parser.cursor().token()?.is_none() {
125
11.3k
        Ok(result)
126
    } else {
127
22
        Err(parser.error("extra tokens remaining after parse"))
128
    }
129
13.6k
}
wast::parser::parse::<wast::wast::Wast>
Line
Count
Source
121
1.15k
pub fn parse<'a, T: Parse<'a>>(buf: &'a ParseBuffer<'a>) -> Result<T> {
122
1.15k
    let parser = buf.parser();
123
1.15k
    let result = parser.parse()?;
124
11
    if parser.cursor().token()?.is_none() {
125
0
        Ok(result)
126
    } else {
127
11
        Err(parser.error("extra tokens remaining after parse"))
128
    }
129
1.15k
}
wast::parser::parse::<wast::wat::Wat>
Line
Count
Source
121
12.4k
pub fn parse<'a, T: Parse<'a>>(buf: &'a ParseBuffer<'a>) -> Result<T> {
122
12.4k
    let parser = buf.parser();
123
12.4k
    let result = parser.parse()?;
124
11.3k
    if parser.cursor().token()?.is_none() {
125
11.3k
        Ok(result)
126
    } else {
127
11
        Err(parser.error("extra tokens remaining after parse"))
128
    }
129
12.4k
}
130
131
/// A trait for parsing a fragment of syntax in a recursive descent fashion.
132
///
133
/// The [`Parse`] trait is main abstraction you'll be working with when defining
134
/// custom parser or custom syntax for your WebAssembly text format (or when
135
/// using the official format items). Almost all items in the
136
/// [`core`](crate::core) module implement the [`Parse`] trait, and you'll
137
/// commonly use this with:
138
///
139
/// * The top-level [`parse`] function to parse an entire input.
140
/// * The intermediate [`Parser::parse`] function to parse an item out of an
141
///   input stream and then parse remaining items.
142
///
143
/// Implementation of [`Parse`] take a [`Parser`] as input and will mutate the
144
/// parser as they parse syntax. Once a token is consume it cannot be
145
/// "un-consumed". Utilities such as [`Parser::peek`] and [`Parser::lookahead1`]
146
/// can be used to determine what to parse next.
147
///
148
/// ## When to parse `(` and `)`?
149
///
150
/// Conventionally types are not responsible for parsing their own `(` and `)`
151
/// tokens which surround the type. For example WebAssembly imports look like:
152
///
153
/// ```text
154
/// (import "foo" "bar" (func (type 0)))
155
/// ```
156
///
157
/// but the [`Import`](crate::core::Import) type parser looks like:
158
///
159
/// ```
160
/// # use wast::kw;
161
/// # use wast::parser::{Parser, Parse, Result};
162
/// # struct Import<'a>(&'a str);
163
/// impl<'a> Parse<'a> for Import<'a> {
164
///     fn parse(parser: Parser<'a>) -> Result<Self> {
165
///         parser.parse::<kw::import>()?;
166
///         // ...
167
/// # panic!()
168
///     }
169
/// }
170
/// ```
171
///
172
/// It is assumed here that the `(` and `)` tokens which surround an `import`
173
/// statement in the WebAssembly text format are parsed by the parent item
174
/// parsing `Import`.
175
///
176
/// Note that this is just a convention, so it's not necessarily required for
177
/// all types. It's recommended that your types stick to this convention where
178
/// possible to avoid nested calls to [`Parser::parens`] or accidentally trying
179
/// to parse too many parenthesis.
180
///
181
/// # Examples
182
///
183
/// Let's say you want to define your own WebAssembly text format which only
184
/// contains imports and functions. You also require all imports to be listed
185
/// before all functions. An example [`Parse`] implementation might look like:
186
///
187
/// ```
188
/// use wast::core::{Import, Func};
189
/// use wast::kw;
190
/// use wast::parser::{Parser, Parse, Result};
191
///
192
/// // Fields of a WebAssembly which only allow imports and functions, and all
193
/// // imports must come before all the functions
194
/// struct OnlyImportsAndFunctions<'a> {
195
///     imports: Vec<Import<'a>>,
196
///     functions: Vec<Func<'a>>,
197
/// }
198
///
199
/// impl<'a> Parse<'a> for OnlyImportsAndFunctions<'a> {
200
///     fn parse(parser: Parser<'a>) -> Result<Self> {
201
///         // While the second token is `import` (the first is `(`, so we care
202
///         // about the second) we parse an `ast::ModuleImport` inside of
203
///         // parentheses. The `parens` function here ensures that what we
204
///         // parse inside of it is surrounded by `(` and `)`.
205
///         let mut imports = Vec::new();
206
///         while parser.peek2::<kw::import>()? {
207
///             let import = parser.parens(|p| p.parse())?;
208
///             imports.push(import);
209
///         }
210
///
211
///         // Afterwards we assume everything else is a function. Note that
212
///         // `parse` here is a generic function and type inference figures out
213
///         // that we're parsing functions here and imports above.
214
///         let mut functions = Vec::new();
215
///         while !parser.is_empty() {
216
///             let func = parser.parens(|p| p.parse())?;
217
///             functions.push(func);
218
///         }
219
///
220
///         Ok(OnlyImportsAndFunctions { imports, functions })
221
///     }
222
/// }
223
/// ```
224
pub trait Parse<'a>: Sized {
225
    /// Attempts to parse `Self` from `parser`, returning an error if it could
226
    /// not be parsed.
227
    ///
228
    /// This method will mutate the state of `parser` after attempting to parse
229
    /// an instance of `Self`. If an error happens then it is likely fatal and
230
    /// there is no guarantee of how many tokens have been consumed from
231
    /// `parser`.
232
    ///
233
    /// As recommended in the documentation of [`Parse`], implementations of
234
    /// this function should not start out by parsing `(` and `)` tokens, but
235
    /// rather parents calling recursive parsers should parse the `(` and `)`
236
    /// tokens for their child item that's being parsed.
237
    ///
238
    /// # Errors
239
    ///
240
    /// This function will return an error if `Self` could not be parsed. Note
241
    /// that creating an [`Error`] is not exactly a cheap operation, so
242
    /// [`Error`] is typically fatal and propagated all the way back to the top
243
    /// parse call site.
244
    fn parse(parser: Parser<'a>) -> Result<Self>;
245
}
246
247
impl<'a, T> Parse<'a> for Box<T>
248
where
249
    T: Parse<'a>,
250
{
251
370k
    fn parse(parser: Parser<'a>) -> Result<Self> {
252
370k
        Ok(Box::new(parser.parse()?))
253
370k
    }
<alloc::boxed::Box<wast::core::expr::BrOnCastFail> as wast::parser::Parse>::parse
Line
Count
Source
251
82
    fn parse(parser: Parser<'a>) -> Result<Self> {
252
82
        Ok(Box::new(parser.parse()?))
253
82
    }
<alloc::boxed::Box<wast::core::expr::CallIndirect> as wast::parser::Parse>::parse
Line
Count
Source
251
398
    fn parse(parser: Parser<'a>) -> Result<Self> {
252
398
        Ok(Box::new(parser.parse()?))
253
398
    }
<alloc::boxed::Box<wast::core::expr::BrOnCast> as wast::parser::Parse>::parse
Line
Count
Source
251
218
    fn parse(parser: Parser<'a>) -> Result<Self> {
252
218
        Ok(Box::new(parser.parse()?))
253
218
    }
<alloc::boxed::Box<wast::core::expr::BlockType> as wast::parser::Parse>::parse
Line
Count
Source
251
369k
    fn parse(parser: Parser<'a>) -> Result<Self> {
252
369k
        Ok(Box::new(parser.parse()?))
253
369k
    }
254
}
255
256
/// A trait for types which be used to "peek" to see if they're the next token
257
/// in an input stream of [`Parser`].
258
///
259
/// Often when implementing [`Parse`] you'll need to query what the next token
260
/// in the stream is to figure out what to parse next. This [`Peek`] trait
261
/// defines the set of types that can be tested whether they're the next token
262
/// in the input stream.
263
///
264
/// Implementations of [`Peek`] should only be present on types that consume
265
/// exactly one token (not zero, not more, exactly one). Types implementing
266
/// [`Peek`] should also typically implement [`Parse`] should also typically
267
/// implement [`Parse`].
268
///
269
/// See the documentation of [`Parser::peek`] for example usage.
270
pub trait Peek {
271
    /// Tests to see whether this token is the first token within the [`Cursor`]
272
    /// specified.
273
    ///
274
    /// Returns `true` if [`Parse`] for this type is highly likely to succeed
275
    /// failing no other error conditions happening (like an integer literal
276
    /// being too big).
277
    fn peek(cursor: Cursor<'_>) -> Result<bool>;
278
279
    /// The same as `peek`, except it checks the token immediately following
280
    /// the current token.
281
7.74M
    fn peek2(mut cursor: Cursor<'_>) -> Result<bool> {
282
7.74M
        match cursor.token()? {
283
7.74M
            Some(token) => cursor.advance_past(&token),
284
35
            None => return Ok(false),
285
        }
286
7.74M
        Self::peek(cursor)
287
7.74M
    }
<wast::token::Index as wast::parser::Peek>::peek2
Line
Count
Source
281
2
    fn peek2(mut cursor: Cursor<'_>) -> Result<bool> {
282
2
        match cursor.token()? {
283
2
            Some(token) => cursor.advance_past(&token),
284
0
            None => return Ok(false),
285
        }
286
2
        Self::peek(cursor)
287
2
    }
<wast::token::LParen as wast::parser::Peek>::peek2
Line
Count
Source
281
13.1k
    fn peek2(mut cursor: Cursor<'_>) -> Result<bool> {
282
13.1k
        match cursor.token()? {
283
13.1k
            Some(token) => cursor.advance_past(&token),
284
0
            None => return Ok(false),
285
        }
286
13.1k
        Self::peek(cursor)
287
13.1k
    }
<wast::wast::WastDirectiveToken as wast::parser::Peek>::peek2
Line
Count
Source
281
1.15k
    fn peek2(mut cursor: Cursor<'_>) -> Result<bool> {
282
1.15k
        match cursor.token()? {
283
714
            Some(token) => cursor.advance_past(&token),
284
31
            None => return Ok(false),
285
        }
286
714
        Self::peek(cursor)
287
1.15k
    }
<wast::core::types::Type as wast::parser::Peek>::peek2
Line
Count
Source
281
545k
    fn peek2(mut cursor: Cursor<'_>) -> Result<bool> {
282
545k
        match cursor.token()? {
283
545k
            Some(token) => cursor.advance_past(&token),
284
0
            None => return Ok(false),
285
        }
286
545k
        Self::peek(cursor)
287
545k
    }
<wast::core::types::RefType as wast::parser::Peek>::peek2
Line
Count
Source
281
9.16k
    fn peek2(mut cursor: Cursor<'_>) -> Result<bool> {
282
9.16k
        match cursor.token()? {
283
9.16k
            Some(token) => cursor.advance_past(&token),
284
0
            None => return Ok(false),
285
        }
286
9.16k
        Self::peek(cursor)
287
9.16k
    }
Unexecuted instantiation: <wast::kw::definition as wast::parser::Peek>::peek2
<wast::kw::catch_all_ref as wast::parser::Peek>::peek2
Line
Count
Source
281
26.7k
    fn peek2(mut cursor: Cursor<'_>) -> Result<bool> {
282
26.7k
        match cursor.token()? {
283
26.7k
            Some(token) => cursor.advance_past(&token),
284
0
            None => return Ok(false),
285
        }
286
26.7k
        Self::peek(cursor)
287
26.7k
    }
Unexecuted instantiation: <wast::kw::on as wast::parser::Peek>::peek2
<wast::kw::mut as wast::parser::Peek>::peek2
Line
Count
Source
281
921k
    fn peek2(mut cursor: Cursor<'_>) -> Result<bool> {
282
921k
        match cursor.token()? {
283
921k
            Some(token) => cursor.advance_past(&token),
284
0
            None => return Ok(false),
285
        }
286
921k
        Self::peek(cursor)
287
921k
    }
<wast::kw::ref as wast::parser::Peek>::peek2
Line
Count
Source
281
344k
    fn peek2(mut cursor: Cursor<'_>) -> Result<bool> {
282
344k
        match cursor.token()? {
283
344k
            Some(token) => cursor.advance_past(&token),
284
0
            None => return Ok(false),
285
        }
286
344k
        Self::peek(cursor)
287
344k
    }
<wast::kw::item as wast::parser::Peek>::peek2
Line
Count
Source
281
113k
    fn peek2(mut cursor: Cursor<'_>) -> Result<bool> {
282
113k
        match cursor.token()? {
283
113k
            Some(token) => cursor.advance_past(&token),
284
0
            None => return Ok(false),
285
        }
286
113k
        Self::peek(cursor)
287
113k
    }
<wast::kw::type as wast::parser::Peek>::peek2
Line
Count
Source
281
625k
    fn peek2(mut cursor: Cursor<'_>) -> Result<bool> {
282
625k
        match cursor.token()? {
283
625k
            Some(token) => cursor.advance_past(&token),
284
0
            None => return Ok(false),
285
        }
286
625k
        Self::peek(cursor)
287
625k
    }
<wast::kw::catch as wast::parser::Peek>::peek2
Line
Count
Source
281
267k
    fn peek2(mut cursor: Cursor<'_>) -> Result<bool> {
282
267k
        match cursor.token()? {
283
267k
            Some(token) => cursor.advance_past(&token),
284
0
            None => return Ok(false),
285
        }
286
267k
        Self::peek(cursor)
287
267k
    }
<wast::kw::local as wast::parser::Peek>::peek2
Line
Count
Source
281
209k
    fn peek2(mut cursor: Cursor<'_>) -> Result<bool> {
282
209k
        match cursor.token()? {
283
209k
            Some(token) => cursor.advance_past(&token),
284
0
            None => return Ok(false),
285
        }
286
209k
        Self::peek(cursor)
287
209k
    }
<wast::kw::param as wast::parser::Peek>::peek2
Line
Count
Source
281
1.18M
    fn peek2(mut cursor: Cursor<'_>) -> Result<bool> {
282
1.18M
        match cursor.token()? {
283
1.18M
            Some(token) => cursor.advance_past(&token),
284
0
            None => return Ok(false),
285
        }
286
1.18M
        Self::peek(cursor)
287
1.18M
    }
Unexecuted instantiation: <wast::kw::quote as wast::parser::Peek>::peek2
<wast::kw::table as wast::parser::Peek>::peek2
Line
Count
Source
281
10.2k
    fn peek2(mut cursor: Cursor<'_>) -> Result<bool> {
282
10.2k
        match cursor.token()? {
283
10.2k
            Some(token) => cursor.advance_past(&token),
284
0
            None => return Ok(false),
285
        }
286
10.2k
        Self::peek(cursor)
287
10.2k
    }
<wast::kw::memory as wast::parser::Peek>::peek2
Line
Count
Source
281
4.75k
    fn peek2(mut cursor: Cursor<'_>) -> Result<bool> {
282
4.75k
        match cursor.token()? {
283
4.75k
            Some(token) => cursor.advance_past(&token),
284
0
            None => return Ok(false),
285
        }
286
4.75k
        Self::peek(cursor)
287
4.75k
    }
<wast::kw::module as wast::parser::Peek>::peek2
Line
Count
Source
281
12.9k
    fn peek2(mut cursor: Cursor<'_>) -> Result<bool> {
282
12.9k
        match cursor.token()? {
283
12.5k
            Some(token) => cursor.advance_past(&token),
284
0
            None => return Ok(false),
285
        }
286
12.5k
        Self::peek(cursor)
287
12.9k
    }
<wast::kw::offset as wast::parser::Peek>::peek2
Line
Count
Source
281
10.2k
    fn peek2(mut cursor: Cursor<'_>) -> Result<bool> {
282
10.2k
        match cursor.token()? {
283
10.2k
            Some(token) => cursor.advance_past(&token),
284
2
            None => return Ok(false),
285
        }
286
10.2k
        Self::peek(cursor)
287
10.2k
    }
<wast::kw::result as wast::parser::Peek>::peek2
Line
Count
Source
281
979k
    fn peek2(mut cursor: Cursor<'_>) -> Result<bool> {
282
979k
        match cursor.token()? {
283
979k
            Some(token) => cursor.advance_past(&token),
284
0
            None => return Ok(false),
285
        }
286
979k
        Self::peek(cursor)
287
979k
    }
<wast::kw::shared as wast::parser::Peek>::peek2
Line
Count
Source
281
406k
    fn peek2(mut cursor: Cursor<'_>) -> Result<bool> {
282
406k
        match cursor.token()? {
283
406k
            Some(token) => cursor.advance_past(&token),
284
0
            None => return Ok(false),
285
        }
286
406k
        Self::peek(cursor)
287
406k
    }
Unexecuted instantiation: <wast::kw::instance as wast::parser::Peek>::peek2
<wast::kw::pagesize as wast::parser::Peek>::peek2
Line
Count
Source
281
16.9k
    fn peek2(mut cursor: Cursor<'_>) -> Result<bool> {
282
16.9k
        match cursor.token()? {
283
16.9k
            Some(token) => cursor.advance_past(&token),
284
0
            None => return Ok(false),
285
        }
286
16.9k
        Self::peek(cursor)
287
16.9k
    }
<wast::kw::catch_all as wast::parser::Peek>::peek2
Line
Count
Source
281
239k
    fn peek2(mut cursor: Cursor<'_>) -> Result<bool> {
282
239k
        match cursor.token()? {
283
239k
            Some(token) => cursor.advance_past(&token),
284
0
            None => return Ok(false),
285
        }
286
239k
        Self::peek(cursor)
287
239k
    }
<wast::kw::catch_ref as wast::parser::Peek>::peek2
Line
Count
Source
281
239k
    fn peek2(mut cursor: Cursor<'_>) -> Result<bool> {
282
239k
        match cursor.token()? {
283
239k
            Some(token) => cursor.advance_past(&token),
284
0
            None => return Ok(false),
285
        }
286
239k
        Self::peek(cursor)
287
239k
    }
<wast::kw::component as wast::parser::Peek>::peek2
Line
Count
Source
281
1.04k
    fn peek2(mut cursor: Cursor<'_>) -> Result<bool> {
282
1.04k
        match cursor.token()? {
283
1.04k
            Some(token) => cursor.advance_past(&token),
284
0
            None => return Ok(false),
285
        }
286
1.04k
        Self::peek(cursor)
287
1.04k
    }
<wast::annotation::name as wast::parser::Peek>::peek2
Line
Count
Source
281
1.55M
    fn peek2(mut cursor: Cursor<'_>) -> Result<bool> {
282
1.55M
        match cursor.token()? {
283
1.55M
            Some(token) => cursor.advance_past(&token),
284
2
            None => return Ok(false),
285
        }
286
1.55M
        Self::peek(cursor)
287
1.55M
    }
288
289
    /// Returns a human-readable name of this token to display when generating
290
    /// errors about this token missing.
291
    fn display() -> &'static str;
292
}
293
294
/// A convenience type definition for `Result` where the error is hardwired to
295
/// [`Error`].
296
pub type Result<T, E = Error> = std::result::Result<T, E>;
297
298
/// A low-level buffer of tokens which represents a completely lexed file.
299
///
300
/// A `ParseBuffer` will immediately lex an entire file and then store all
301
/// tokens internally. A `ParseBuffer` only used to pass to the top-level
302
/// [`parse`] function.
303
pub struct ParseBuffer<'a> {
304
    lexer: Lexer<'a>,
305
    cur: Cell<Position>,
306
    known_annotations: RefCell<HashMap<String, usize>>,
307
    track_instr_spans: bool,
308
    depth: Cell<usize>,
309
    strings: Bump,
310
}
311
312
/// The current position within a `Lexer` that we're at. This simultaneously
313
/// stores the byte position that the lexer was last positioned at as well as
314
/// the next significant token.
315
///
316
/// Note that "significant" here does not mean that `token` is the next token
317
/// to be lexed at `offset`. Instead it's the next non-whitespace,
318
/// non-annotation, non-coment token. This simple cache-of-sorts avoids
319
/// re-parsing tokens the majority of the time, or at least that's the
320
/// intention.
321
///
322
/// If `token` is set to `None` then it means that either it hasn't been
323
/// calculated at or the lexer is at EOF. Basically it means go talk to the
324
/// lexer.
325
#[derive(Copy, Clone)]
326
struct Position {
327
    offset: usize,
328
    token: Option<Token>,
329
}
330
331
/// An in-progress parser for the tokens of a WebAssembly text file.
332
///
333
/// A `Parser` is argument to the [`Parse`] trait and is now the input stream is
334
/// interacted with to parse new items. Cloning [`Parser`] or copying a parser
335
/// refers to the same stream of tokens to parse, you cannot clone a [`Parser`]
336
/// and clone two items.
337
///
338
/// For more information about a [`Parser`] see its methods.
339
#[derive(Copy, Clone)]
340
pub struct Parser<'a> {
341
    buf: &'a ParseBuffer<'a>,
342
}
343
344
/// A helpful structure to perform a lookahead of one token to determine what to
345
/// parse.
346
///
347
/// For more information see the [`Parser::lookahead1`] method.
348
pub struct Lookahead1<'a> {
349
    parser: Parser<'a>,
350
    attempts: Vec<&'static str>,
351
}
352
353
/// An immutable cursor into a list of tokens.
354
///
355
/// This cursor cannot be mutated but can be used to parse more tokens in a list
356
/// of tokens. Cursors are created from the [`Parser::step`] method. This is a
357
/// very low-level parsing structure and you likely won't use it much.
358
#[derive(Copy, Clone)]
359
pub struct Cursor<'a> {
360
    parser: Parser<'a>,
361
    pos: Position,
362
}
363
364
impl ParseBuffer<'_> {
365
    /// Creates a new [`ParseBuffer`] by lexing the given `input` completely.
366
    ///
367
    /// # Errors
368
    ///
369
    /// Returns an error if `input` fails to lex.
370
13.6k
    pub fn new(input: &str) -> Result<ParseBuffer<'_>> {
371
13.6k
        ParseBuffer::new_with_lexer(Lexer::new(input))
372
13.6k
    }
373
374
    /// Creates a new [`ParseBuffer`] by lexing the given `input` completely.
375
    ///
376
    /// # Errors
377
    ///
378
    /// Returns an error if `input` fails to lex.
379
13.6k
    pub fn new_with_lexer(lexer: Lexer<'_>) -> Result<ParseBuffer<'_>> {
380
13.6k
        Ok(ParseBuffer {
381
13.6k
            lexer,
382
13.6k
            depth: Cell::new(0),
383
13.6k
            cur: Cell::new(Position {
384
13.6k
                offset: 0,
385
13.6k
                token: None,
386
13.6k
            }),
387
13.6k
            known_annotations: Default::default(),
388
13.6k
            strings: Default::default(),
389
13.6k
            track_instr_spans: false,
390
13.6k
        })
391
13.6k
    }
392
393
    /// Indicates whether the [`Expression::instr_spans`] field will be filled
394
    /// in.
395
    ///
396
    /// This is useful when enabling DWARF debugging information via
397
    /// [`EncodeOptions::dwarf`], for example.
398
    ///
399
    /// [`Expression::instr_spans`]: crate::core::Expression::instr_spans
400
    /// [`EncodeOptions::dwarf`]: crate::core::EncodeOptions::dwarf
401
0
    pub fn track_instr_spans(&mut self, track: bool) -> &mut Self {
402
0
        self.track_instr_spans = track;
403
0
        self
404
0
    }
405
406
13.6k
    fn parser(&self) -> Parser<'_> {
407
13.6k
        Parser { buf: self }
408
13.6k
    }
409
410
    /// Stores an owned allocation in this `Parser` to attach the lifetime of
411
    /// the vector to `self`.
412
    ///
413
    /// This will return a reference to `s`, but one that's safely rooted in the
414
    /// `Parser`.
415
22.6k
    fn push_str(&self, s: Vec<u8>) -> &[u8] {
416
22.6k
        self.strings.alloc_slice_copy(&s)
417
22.6k
    }
418
419
    /// Lexes the next "significant" token from the `pos` specified.
420
    ///
421
    /// This will skip irrelevant tokens such as whitespace, comments, and
422
    /// unknown annotations.
423
93.0M
    fn advance_token(&self, mut pos: usize) -> Result<Option<Token>> {
424
93.0M
        let token = loop {
425
160M
            let token = match self.lexer.parse(&mut pos)? {
426
160M
                Some(token) => token,
427
25.6k
                None => return Ok(None),
428
            };
429
160M
            match token.kind {
430
                // Always skip whitespace and comments.
431
                TokenKind::Whitespace | TokenKind::LineComment | TokenKind::BlockComment => {
432
67.6M
                    continue
433
                }
434
435
                // If an lparen is seen then this may be skipped if it's an
436
                // annotation of the form `(@foo ...)`. In this situation
437
                // everything up to and including the closing rparen is skipped.
438
                //
439
                // Note that the annotation is only skipped if it's an unknown
440
                // annotation as known annotations are specifically registered
441
                // as "someone's gonna parse this".
442
                TokenKind::LParen => {
443
14.0M
                    if let Some(annotation) = self.lexer.annotation(pos)? {
444
743
                        let text = annotation.annotation(self.lexer.input())?;
445
708
                        match self.known_annotations.borrow().get(&text[..]) {
446
                            Some(0) | None => {
447
699
                                self.skip_annotation(&mut pos)?;
448
335
                                continue;
449
                            }
450
9
                            Some(_) => {}
451
                        }
452
14.0M
                    }
453
14.0M
                    break token;
454
                }
455
79.0M
                _ => break token,
456
            }
457
        };
458
93.0M
        Ok(Some(token))
459
93.0M
    }
460
461
699
    fn skip_annotation(&self, pos: &mut usize) -> Result<()> {
462
699
        let mut depth = 1;
463
699
        let span = Span { offset: *pos };
464
        loop {
465
52.4k
            let token = match self.lexer.parse(pos)? {
466
52.0k
                Some(token) => token,
467
                None => {
468
228
                    break Err(Error::new(span, "unclosed annotation".to_string()));
469
                }
470
            };
471
52.0k
            match token.kind {
472
3.05k
                TokenKind::LParen => depth += 1,
473
                TokenKind::RParen => {
474
2.92k
                    depth -= 1;
475
2.92k
                    if depth == 0 {
476
335
                        break Ok(());
477
2.58k
                    }
478
                }
479
46.0k
                _ => {}
480
            }
481
        }
482
699
    }
483
}
484
485
impl<'a> Parser<'a> {
486
    /// Returns whether there are no more `Token` tokens to parse from this
487
    /// [`Parser`].
488
    ///
489
    /// This indicates that either we've reached the end of the input, or we're
490
    /// a sub-[`Parser`] inside of a parenthesized expression and we've hit the
491
    /// `)` token.
492
    ///
493
    /// Note that if `false` is returned there *may* be more comments. Comments
494
    /// and whitespace are not considered for whether this parser is empty.
495
21.4M
    pub fn is_empty(self) -> bool {
496
21.4M
        match self.cursor().token() {
497
21.4M
            Ok(Some(token)) => matches!(token.kind, TokenKind::RParen),
498
2
            Ok(None) => true,
499
4
            Err(_) => false,
500
        }
501
21.4M
    }
502
503
    #[cfg(feature = "wasm-module")]
504
13.0k
    pub(crate) fn has_meaningful_tokens(self) -> bool {
505
13.4k
        self.buf.lexer.iter(0).any(|t| match t {
506
13.0k
            Ok(token) => !matches!(
507
13.0k
                token.kind,
508
                TokenKind::Whitespace | TokenKind::LineComment | TokenKind::BlockComment
509
            ),
510
355
            Err(_) => true,
511
13.4k
        })
512
13.0k
    }
513
514
    /// Parses a `T` from this [`Parser`].
515
    ///
516
    /// This method has a trivial definition (it simply calls
517
    /// [`T::parse`](Parse::parse)) but is here for syntactic purposes. This is
518
    /// what you'll call 99% of the time in a [`Parse`] implementation in order
519
    /// to parse sub-items.
520
    ///
521
    /// Typically you always want to use `?` with the result of this method, you
522
    /// should not handle errors and decide what else to parse. To handle
523
    /// branches in parsing, use [`Parser::peek`].
524
    ///
525
    /// # Examples
526
    ///
527
    /// A good example of using `parse` is to see how the [`TableType`] type is
528
    /// parsed in this crate. A [`TableType`] is defined in the official
529
    /// specification as [`tabletype`][spec] and is defined as:
530
    ///
531
    /// [spec]: https://webassembly.github.io/spec/core/text/types.html#table-types
532
    ///
533
    /// ```text
534
    /// tabletype ::= lim:limits et:reftype
535
    /// ```
536
    ///
537
    /// so to parse a [`TableType`] we recursively need to parse a [`Limits`]
538
    /// and a [`RefType`]
539
    ///
540
    /// ```
541
    /// # use wast::core::*;
542
    /// # use wast::parser::*;
543
    /// struct TableType<'a> {
544
    ///     limits: Limits,
545
    ///     elem: RefType<'a>,
546
    /// }
547
    ///
548
    /// impl<'a> Parse<'a> for TableType<'a> {
549
    ///     fn parse(parser: Parser<'a>) -> Result<Self> {
550
    ///         // parse the `lim` then `et` in sequence
551
    ///         Ok(TableType {
552
    ///             limits: parser.parse()?,
553
    ///             elem: parser.parse()?,
554
    ///         })
555
    ///     }
556
    /// }
557
    /// ```
558
    ///
559
    /// [`Limits`]: crate::core::Limits
560
    /// [`TableType`]: crate::core::TableType
561
    /// [`RefType`]: crate::core::RefType
562
50.9M
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
50.9M
        T::parse(self)
564
50.9M
    }
<wast::parser::Parser>::parse::<wast::wast::Wast>
Line
Count
Source
562
1.15k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
1.15k
        T::parse(self)
564
1.15k
    }
<wast::parser::Parser>::parse::<alloc::boxed::Box<wast::core::expr::BrOnCastFail>>
Line
Count
Source
562
82
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
82
        T::parse(self)
564
82
    }
<wast::parser::Parser>::parse::<alloc::boxed::Box<wast::core::expr::CallIndirect>>
Line
Count
Source
562
398
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
398
        T::parse(self)
564
398
    }
<wast::parser::Parser>::parse::<alloc::boxed::Box<wast::core::expr::BrOnCast>>
Line
Count
Source
562
218
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
218
        T::parse(self)
564
218
    }
<wast::parser::Parser>::parse::<alloc::boxed::Box<wast::core::expr::BlockType>>
Line
Count
Source
562
369k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
369k
        T::parse(self)
564
369k
    }
Unexecuted instantiation: <wast::parser::Parser>::parse::<core::option::Option<wast::kw::i32>>
Unexecuted instantiation: <wast::parser::Parser>::parse::<core::option::Option<wast::kw::i64>>
<wast::parser::Parser>::parse::<core::option::Option<wast::kw::shared>>
Line
Count
Source
562
59.6k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
59.6k
        T::parse(self)
564
59.6k
    }
<wast::parser::Parser>::parse::<core::option::Option<wast::token::NameAnnotation>>
Line
Count
Source
562
1.55M
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
1.55M
        T::parse(self)
564
1.55M
    }
<wast::parser::Parser>::parse::<core::option::Option<wast::token::Id>>
Line
Count
Source
562
1.78M
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
1.78M
        T::parse(self)
564
1.78M
    }
<wast::parser::Parser>::parse::<core::option::Option<wast::token::Index>>
Line
Count
Source
562
345k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
345k
        T::parse(self)
564
345k
    }
<wast::parser::Parser>::parse::<core::option::Option<wast::core::types::FunctionType>>
Line
Count
Source
562
254k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
254k
        T::parse(self)
564
254k
    }
<wast::parser::Parser>::parse::<core::option::Option<wast::core::types::FunctionTypeNoNames>>
Line
Count
Source
562
370k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
370k
        T::parse(self)
564
370k
    }
Unexecuted instantiation: <wast::parser::Parser>::parse::<core::option::Option<wast::core::types::HeapType>>
<wast::parser::Parser>::parse::<core::option::Option<wast::core::import::InlineImport>>
Line
Count
Source
562
285k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
285k
        T::parse(self)
564
285k
    }
Unexecuted instantiation: <wast::parser::Parser>::parse::<core::option::Option<u32>>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::core::expr::Ordered<wast::core::expr::StructAccess>>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::core::expr::Ordered<wast::core::expr::TableArg>>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::core::expr::Ordered<wast::token::Index>>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::core::wast::NanPattern<wast::token::F32>>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::core::wast::NanPattern<wast::token::F64>>
<wast::parser::Parser>::parse::<wast::core::types::TypeUse<wast::core::types::FunctionType>>
Line
Count
Source
562
254k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
254k
        T::parse(self)
564
254k
    }
<wast::parser::Parser>::parse::<wast::core::types::TypeUse<wast::core::types::FunctionTypeNoNames>>
Line
Count
Source
562
370k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
370k
        T::parse(self)
564
370k
    }
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::annotation::metadata_code_branch_hint>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::annotation::name>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::annotation::custom>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::annotation::dylink_0>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::annotation::producers>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::kw::definition>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::kw::nullexnref>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::kw::assert_trap>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::kw::export_info>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::kw::import_info>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::kw::nullcontref>
<wast::parser::Parser>::parse::<wast::kw::nullfuncref>
Line
Count
Source
562
9.17k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
9.17k
        T::parse(self)
564
9.17k
    }
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::kw::processed_by>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::kw::assert_return>
<wast::parser::Parser>::parse::<wast::kw::catch_all_ref>
Line
Count
Source
562
546
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
546
        T::parse(self)
564
546
    }
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::kw::nan_canonical>
<wast::parser::Parser>::parse::<wast::kw::nullexternref>
Line
Count
Source
562
13.5k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
13.5k
        T::parse(self)
564
13.5k
    }
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::kw::assert_invalid>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::kw::nan_arithmetic>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::kw::assert_exception>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::kw::assert_malformed>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::kw::assert_exhaustion>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::kw::assert_suspension>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::kw::assert_unlinkable>
<wast::parser::Parser>::parse::<wast::kw::eq>
Line
Count
Source
562
6.65k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
6.65k
        T::parse(self)
564
6.65k
    }
<wast::parser::Parser>::parse::<wast::kw::i8>
Line
Count
Source
562
522k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
522k
        T::parse(self)
564
522k
    }
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::kw::on>
<wast::parser::Parser>::parse::<wast::kw::any>
Line
Count
Source
562
2.82k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
2.82k
        T::parse(self)
564
2.82k
    }
<wast::parser::Parser>::parse::<wast::kw::exn>
Line
Count
Source
562
11.8k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
11.8k
        T::parse(self)
564
11.8k
    }
<wast::parser::Parser>::parse::<wast::kw::f32>
Line
Count
Source
562
504k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
504k
        T::parse(self)
564
504k
    }
<wast::parser::Parser>::parse::<wast::kw::f64>
Line
Count
Source
562
1.43M
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
1.43M
        T::parse(self)
564
1.43M
    }
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::kw::get>
<wast::parser::Parser>::parse::<wast::kw::i16>
Line
Count
Source
562
118k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
118k
        T::parse(self)
564
118k
    }
<wast::parser::Parser>::parse::<wast::kw::i31>
Line
Count
Source
562
4.87k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
4.87k
        T::parse(self)
564
4.87k
    }
<wast::parser::Parser>::parse::<wast::kw::i32>
Line
Count
Source
562
573k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
573k
        T::parse(self)
564
573k
    }
<wast::parser::Parser>::parse::<wast::kw::i64>
Line
Count
Source
562
3.13M
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
3.13M
        T::parse(self)
564
3.13M
    }
<wast::parser::Parser>::parse::<wast::kw::mut>
Line
Count
Source
562
696k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
696k
        T::parse(self)
564
696k
    }
<wast::parser::Parser>::parse::<wast::kw::rec>
Line
Count
Source
562
75.7k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
75.7k
        T::parse(self)
564
75.7k
    }
<wast::parser::Parser>::parse::<wast::kw::ref>
Line
Count
Source
562
313k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
313k
        T::parse(self)
564
313k
    }
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::kw::sdk>
<wast::parser::Parser>::parse::<wast::kw::sub>
Line
Count
Source
562
158k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
158k
        T::parse(self)
564
158k
    }
<wast::parser::Parser>::parse::<wast::kw::tag>
Line
Count
Source
562
28.8k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
28.8k
        T::parse(self)
564
28.8k
    }
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::kw::code>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::kw::cont>
<wast::parser::Parser>::parse::<wast::kw::data>
Line
Count
Source
562
16.4k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
16.4k
        T::parse(self)
564
16.4k
    }
<wast::parser::Parser>::parse::<wast::kw::elem>
Line
Count
Source
562
15.9k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
15.9k
        T::parse(self)
564
15.9k
    }
<wast::parser::Parser>::parse::<wast::kw::else>
Line
Count
Source
562
3.93k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
3.93k
        T::parse(self)
564
3.93k
    }
<wast::parser::Parser>::parse::<wast::kw::func>
Line
Count
Source
562
377k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
377k
        T::parse(self)
564
377k
    }
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::kw::item>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::kw::last>
<wast::parser::Parser>::parse::<wast::kw::none>
Line
Count
Source
562
91.5k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
91.5k
        T::parse(self)
564
91.5k
    }
<wast::parser::Parser>::parse::<wast::kw::null>
Line
Count
Source
562
308k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
308k
        T::parse(self)
564
308k
    }
<wast::parser::Parser>::parse::<wast::kw::then>
Line
Count
Source
562
29.2k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
29.2k
        T::parse(self)
564
29.2k
    }
<wast::parser::Parser>::parse::<wast::kw::type>
Line
Count
Source
562
721k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
721k
        T::parse(self)
564
721k
    }
<wast::parser::Parser>::parse::<wast::kw::v128>
Line
Count
Source
562
133k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
133k
        T::parse(self)
564
133k
    }
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::kw::wait>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::kw::after>
<wast::parser::Parser>::parse::<wast::kw::array>
Line
Count
Source
562
310k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
310k
        T::parse(self)
564
310k
    }
<wast::parser::Parser>::parse::<wast::kw::catch>
Line
Count
Source
562
28.6k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
28.6k
        T::parse(self)
564
28.6k
    }
<wast::parser::Parser>::parse::<wast::kw::eqref>
Line
Count
Source
562
7.82k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
7.82k
        T::parse(self)
564
7.82k
    }
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::kw::f32x4>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::kw::f64x2>
<wast::parser::Parser>::parse::<wast::kw::field>
Line
Count
Source
562
570k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
570k
        T::parse(self)
564
570k
    }
<wast::parser::Parser>::parse::<wast::kw::final>
Line
Count
Source
562
18.8k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
18.8k
        T::parse(self)
564
18.8k
    }
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::kw::first>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::kw::i16x8>
<wast::parser::Parser>::parse::<wast::kw::i32x4>
Line
Count
Source
562
84.2k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
84.2k
        T::parse(self)
564
84.2k
    }
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::kw::i64x2>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::kw::i8x16>
<wast::parser::Parser>::parse::<wast::kw::local>
Line
Count
Source
562
21.7k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
21.7k
        T::parse(self)
564
21.7k
    }
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::kw::noexn>
<wast::parser::Parser>::parse::<wast::kw::param>
Line
Count
Source
562
289k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
289k
        T::parse(self)
564
289k
    }
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::kw::quote>
<wast::parser::Parser>::parse::<wast::kw::start>
Line
Count
Source
562
254
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
254
        T::parse(self)
564
254
    }
<wast::parser::Parser>::parse::<wast::kw::table>
Line
Count
Source
562
48.9k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
48.9k
        T::parse(self)
564
48.9k
    }
<wast::parser::Parser>::parse::<wast::kw::anyref>
Line
Count
Source
562
9.40k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
9.40k
        T::parse(self)
564
9.40k
    }
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::kw::before>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::kw::binary>
<wast::parser::Parser>::parse::<wast::kw::exnref>
Line
Count
Source
562
23.2k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
23.2k
        T::parse(self)
564
23.2k
    }
<wast::parser::Parser>::parse::<wast::kw::export>
Line
Count
Source
562
98.1k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
98.1k
        T::parse(self)
564
98.1k
    }
<wast::parser::Parser>::parse::<wast::kw::extern>
Line
Count
Source
562
9.44k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
9.44k
        T::parse(self)
564
9.44k
    }
<wast::parser::Parser>::parse::<wast::kw::global>
Line
Count
Source
562
77.6k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
77.6k
        T::parse(self)
564
77.6k
    }
<wast::parser::Parser>::parse::<wast::kw::i31ref>
Line
Count
Source
562
32.3k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
32.3k
        T::parse(self)
564
32.3k
    }
<wast::parser::Parser>::parse::<wast::kw::import>
Line
Count
Source
562
76.4k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
76.4k
        T::parse(self)
564
76.4k
    }
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::kw::invoke>
<wast::parser::Parser>::parse::<wast::kw::memory>
Line
Count
Source
562
34.0k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
34.0k
        T::parse(self)
564
34.0k
    }
<wast::parser::Parser>::parse::<wast::kw::module>
Line
Count
Source
562
11.3k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
11.3k
        T::parse(self)
564
11.3k
    }
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::kw::needed>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::kw::nocont>
<wast::parser::Parser>::parse::<wast::kw::nofunc>
Line
Count
Source
562
33.8k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
33.8k
        T::parse(self)
564
33.8k
    }
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::kw::offset>
<wast::parser::Parser>::parse::<wast::kw::result>
Line
Count
Source
562
408k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
408k
        T::parse(self)
564
408k
    }
<wast::parser::Parser>::parse::<wast::kw::shared>
Line
Count
Source
562
109k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
109k
        T::parse(self)
564
109k
    }
<wast::parser::Parser>::parse::<wast::kw::struct>
Line
Count
Source
562
85.9k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
85.9k
        T::parse(self)
564
85.9k
    }
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::kw::switch>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::kw::thread>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::kw::acq_rel>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::kw::contref>
<wast::parser::Parser>::parse::<wast::kw::declare>
Line
Count
Source
562
3.71k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
3.71k
        T::parse(self)
564
3.71k
    }
<wast::parser::Parser>::parse::<wast::kw::funcref>
Line
Count
Source
562
30.5k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
30.5k
        T::parse(self)
564
30.5k
    }
<wast::parser::Parser>::parse::<wast::kw::nullref>
Line
Count
Source
562
11.0k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
11.0k
        T::parse(self)
564
11.0k
    }
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::kw::seq_cst>
<wast::parser::Parser>::parse::<wast::kw::arrayref>
Line
Count
Source
562
28.9k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
28.9k
        T::parse(self)
564
28.9k
    }
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::kw::instance>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::kw::language>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::kw::mem_info>
<wast::parser::Parser>::parse::<wast::kw::noextern>
Line
Count
Source
562
28.7k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
28.7k
        T::parse(self)
564
28.7k
    }
<wast::parser::Parser>::parse::<wast::kw::pagesize>
Line
Count
Source
562
16.9k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
16.9k
        T::parse(self)
564
16.9k
    }
<wast::parser::Parser>::parse::<wast::kw::register>
Line
Count
Source
562
1
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
1
        T::parse(self)
564
1
    }
<wast::parser::Parser>::parse::<wast::kw::catch_all>
Line
Count
Source
562
212k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
212k
        T::parse(self)
564
212k
    }
<wast::parser::Parser>::parse::<wast::kw::catch_ref>
Line
Count
Source
562
6
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
6
        T::parse(self)
564
6
    }
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::kw::component>
<wast::parser::Parser>::parse::<wast::kw::externref>
Line
Count
Source
562
27.8k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
27.8k
        T::parse(self)
564
27.8k
    }
<wast::parser::Parser>::parse::<wast::kw::structref>
Line
Count
Source
562
17.7k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
17.7k
        T::parse(self)
564
17.7k
    }
<wast::parser::Parser>::parse::<wast::wat::Wat>
Line
Count
Source
562
13.0k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
13.0k
        T::parse(self)
564
13.0k
    }
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::wast::WastInvoke>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::wast::WastThread>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::wast::WastExecute>
<wast::parser::Parser>::parse::<wast::wast::WastDirective>
Line
Count
Source
562
1
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
1
        T::parse(self)
564
1
    }
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::wast::WastArg>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::wast::WastRet>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::wast::QuoteWat>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::token::NameAnnotation>
<wast::parser::Parser>::parse::<wast::token::Id>
Line
Count
Source
562
6
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
6
        T::parse(self)
564
6
    }
<wast::parser::Parser>::parse::<wast::token::F32>
Line
Count
Source
562
176k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
176k
        T::parse(self)
564
176k
    }
<wast::parser::Parser>::parse::<wast::token::F64>
Line
Count
Source
562
568k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
568k
        T::parse(self)
564
568k
    }
<wast::parser::Parser>::parse::<wast::token::Index>
Line
Count
Source
562
3.66M
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
3.66M
        T::parse(self)
564
3.66M
    }
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::component::Component>
Unexecuted instantiation: <wast::parser::Parser>::parse::<alloc::string::String>
<wast::parser::Parser>::parse::<wast::core::tag::Tag>
Line
Count
Source
562
22.5k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
22.5k
        T::parse(self)
564
22.5k
    }
<wast::parser::Parser>::parse::<wast::core::tag::TagType>
Line
Count
Source
562
28.8k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
28.8k
        T::parse(self)
564
28.8k
    }
<wast::parser::Parser>::parse::<wast::core::expr::Expression>
Line
Count
Source
562
240k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
240k
        T::parse(self)
564
240k
    }
<wast::parser::Parser>::parse::<wast::core::expr::MemoryCopy>
Line
Count
Source
562
4
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
4
        T::parse(self)
564
4
    }
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::core::expr::MemoryInit>
<wast::parser::Parser>::parse::<wast::core::expr::Instruction>
Line
Count
Source
562
8.08M
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
8.08M
        T::parse(self)
564
8.08M
    }
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::core::expr::ResumeTable>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::core::expr::ResumeThrow>
<wast::parser::Parser>::parse::<wast::core::expr::SelectTypes>
Line
Count
Source
562
79.5k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
79.5k
        T::parse(self)
564
79.5k
    }
<wast::parser::Parser>::parse::<wast::core::expr::ArrayNewData>
Line
Count
Source
562
8
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
8
        T::parse(self)
564
8
    }
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::core::expr::ArrayNewElem>
<wast::parser::Parser>::parse::<wast::core::expr::BrOnCastFail>
Line
Count
Source
562
82
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
82
        T::parse(self)
564
82
    }
<wast::parser::Parser>::parse::<wast::core::expr::CallIndirect>
Line
Count
Source
562
398
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
398
        T::parse(self)
564
398
    }
<wast::parser::Parser>::parse::<wast::core::expr::I8x16Shuffle>
Line
Count
Source
562
10
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
10
        T::parse(self)
564
10
    }
<wast::parser::Parser>::parse::<wast::core::expr::StructAccess>
Line
Count
Source
562
712
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
712
        T::parse(self)
564
712
    }
<wast::parser::Parser>::parse::<wast::core::expr::ArrayNewFixed>
Line
Count
Source
562
7.83k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
7.83k
        T::parse(self)
564
7.83k
    }
<wast::parser::Parser>::parse::<wast::core::expr::BrTableIndices>
Line
Count
Source
562
5.32k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
5.32k
        T::parse(self)
564
5.32k
    }
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::core::expr::Resume>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::core::expr::Switch>
<wast::parser::Parser>::parse::<wast::core::expr::LaneArg>
Line
Count
Source
562
6.25k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
6.25k
        T::parse(self)
564
6.25k
    }
<wast::parser::Parser>::parse::<wast::core::expr::RefCast>
Line
Count
Source
562
1.37k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
1.37k
        T::parse(self)
564
1.37k
    }
<wast::parser::Parser>::parse::<wast::core::expr::RefTest>
Line
Count
Source
562
4.70k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
4.70k
        T::parse(self)
564
4.70k
    }
<wast::parser::Parser>::parse::<wast::core::expr::BrOnCast>
Line
Count
Source
562
218
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
218
        T::parse(self)
564
218
    }
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::core::expr::ContBind>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::core::expr::Ordering>
<wast::parser::Parser>::parse::<wast::core::expr::TableArg>
Line
Count
Source
562
23.8k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
23.8k
        T::parse(self)
564
23.8k
    }
<wast::parser::Parser>::parse::<wast::core::expr::TryTable>
Line
Count
Source
562
55.0k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
55.0k
        T::parse(self)
564
55.0k
    }
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::core::expr::ArrayCopy>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::core::expr::ArrayFill>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::core::expr::ArrayInit>
<wast::parser::Parser>::parse::<wast::core::expr::BlockType>
Line
Count
Source
562
369k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
369k
        T::parse(self)
564
369k
    }
<wast::parser::Parser>::parse::<wast::core::expr::MemoryArg>
Line
Count
Source
562
110k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
110k
        T::parse(self)
564
110k
    }
<wast::parser::Parser>::parse::<wast::core::expr::TableCopy>
Line
Count
Source
562
10
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
10
        T::parse(self)
564
10
    }
<wast::parser::Parser>::parse::<wast::core::expr::TableInit>
Line
Count
Source
562
2
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
2
        T::parse(self)
564
2
    }
<wast::parser::Parser>::parse::<wast::core::expr::V128Const>
Line
Count
Source
562
84.2k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
84.2k
        T::parse(self)
564
84.2k
    }
<wast::parser::Parser>::parse::<wast::core::func::LocalParser>
Line
Count
Source
562
21.7k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
21.7k
        T::parse(self)
564
21.7k
    }
<wast::parser::Parser>::parse::<wast::core::func::Func>
Line
Count
Source
562
187k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
187k
        T::parse(self)
564
187k
    }
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::core::wast::V128Pattern>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::core::wast::WastArgCore>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::core::wast::WastRetCore>
<wast::parser::Parser>::parse::<wast::core::table::Elem>
Line
Count
Source
562
15.9k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
15.9k
        T::parse(self)
564
15.9k
    }
<wast::parser::Parser>::parse::<wast::core::table::Table>
Line
Count
Source
562
14.6k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
14.6k
        T::parse(self)
564
14.6k
    }
<wast::parser::Parser>::parse::<wast::core::types::GlobalType>
Line
Count
Source
562
62.1k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
62.1k
        T::parse(self)
564
62.1k
    }
<wast::parser::Parser>::parse::<wast::core::types::MemoryType>
Line
Count
Source
562
28.2k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
28.2k
        T::parse(self)
564
28.2k
    }
<wast::parser::Parser>::parse::<wast::core::types::StructType>
Line
Count
Source
562
76.7k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
76.7k
        T::parse(self)
564
76.7k
    }
<wast::parser::Parser>::parse::<wast::core::types::StorageType>
Line
Count
Source
562
860k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
860k
        T::parse(self)
564
860k
    }
<wast::parser::Parser>::parse::<wast::core::types::FunctionType>
Line
Count
Source
562
349k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
349k
        T::parse(self)
564
349k
    }
<wast::parser::Parser>::parse::<wast::core::types::InnerTypeKind>
Line
Count
Source
562
495k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
495k
        T::parse(self)
564
495k
    }
<wast::parser::Parser>::parse::<wast::core::types::AbstractHeapType>
Line
Count
Source
562
229k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
229k
        T::parse(self)
564
229k
    }
<wast::parser::Parser>::parse::<wast::core::types::FunctionTypeNoNames>
Line
Count
Source
562
141k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
141k
        T::parse(self)
564
141k
    }
<wast::parser::Parser>::parse::<wast::core::types::Rec>
Line
Count
Source
562
75.7k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
75.7k
        T::parse(self)
564
75.7k
    }
<wast::parser::Parser>::parse::<wast::core::types::Type>
Line
Count
Source
562
495k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
495k
        T::parse(self)
564
495k
    }
<wast::parser::Parser>::parse::<wast::core::types::Limits>
Line
Count
Source
562
59.6k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
59.6k
        T::parse(self)
564
59.6k
    }
<wast::parser::Parser>::parse::<wast::core::types::RefType>
Line
Count
Source
562
524k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
524k
        T::parse(self)
564
524k
    }
<wast::parser::Parser>::parse::<wast::core::types::TypeDef>
Line
Count
Source
562
495k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
495k
        T::parse(self)
564
495k
    }
<wast::parser::Parser>::parse::<wast::core::types::ValType>
Line
Count
Source
562
6.21M
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
6.21M
        T::parse(self)
564
6.21M
    }
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::core::types::ContType>
<wast::parser::Parser>::parse::<wast::core::types::HeapType>
Line
Count
Source
562
561k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
561k
        T::parse(self)
564
561k
    }
<wast::parser::Parser>::parse::<wast::core::types::ArrayType>
Line
Count
Source
562
290k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
290k
        T::parse(self)
564
290k
    }
<wast::parser::Parser>::parse::<wast::core::types::TableType>
Line
Count
Source
562
31.3k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
31.3k
        T::parse(self)
564
31.3k
    }
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::core::custom::CustomPlace>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::core::custom::RawCustomSection>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::core::custom::CustomPlaceAnchor>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::core::custom::Custom>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::core::custom::Dylink0>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::core::custom::Producers>
<wast::parser::Parser>::parse::<wast::core::export::ExportKind>
Line
Count
Source
562
35.3k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
35.3k
        T::parse(self)
564
35.3k
    }
<wast::parser::Parser>::parse::<wast::core::export::InlineExport>
Line
Count
Source
562
300k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
300k
        T::parse(self)
564
300k
    }
<wast::parser::Parser>::parse::<wast::core::export::Export>
Line
Count
Source
562
35.3k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
35.3k
        T::parse(self)
564
35.3k
    }
<wast::parser::Parser>::parse::<wast::core::global::Global>
Line
Count
Source
562
51.2k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
51.2k
        T::parse(self)
564
51.2k
    }
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::core::import::InlineImport>
<wast::parser::Parser>::parse::<wast::core::import::Import>
Line
Count
Source
562
76.4k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
76.4k
        T::parse(self)
564
76.4k
    }
<wast::parser::Parser>::parse::<wast::core::import::ItemSig>
Line
Count
Source
562
76.4k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
76.4k
        T::parse(self)
564
76.4k
    }
<wast::parser::Parser>::parse::<wast::core::memory::Data>
Line
Count
Source
562
16.4k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
16.4k
        T::parse(self)
564
16.4k
    }
<wast::parser::Parser>::parse::<wast::core::memory::Memory>
Line
Count
Source
562
24.3k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
24.3k
        T::parse(self)
564
24.3k
    }
<wast::parser::Parser>::parse::<wast::core::memory::DataVal>
Line
Count
Source
562
16.4k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
16.4k
        T::parse(self)
564
16.4k
    }
<wast::parser::Parser>::parse::<wast::core::module::Module>
Line
Count
Source
562
11.3k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
11.3k
        T::parse(self)
564
11.3k
    }
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::core::custom::parse_sym_flags::flag>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::core::custom::parse_sym_flags::flag>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::core::custom::parse_sym_flags::flag>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::core::custom::parse_sym_flags::flag>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::core::custom::parse_sym_flags::flag>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::core::custom::parse_sym_flags::flag>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::core::custom::parse_sym_flags::flag>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::core::custom::parse_sym_flags::flag>
Unexecuted instantiation: <wast::parser::Parser>::parse::<wast::core::custom::parse_sym_flags::flag>
<wast::parser::Parser>::parse::<&[u8]>
Line
Count
Source
562
267k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
267k
        T::parse(self)
564
267k
    }
<wast::parser::Parser>::parse::<&str>
Line
Count
Source
562
251k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
251k
        T::parse(self)
564
251k
    }
Unexecuted instantiation: <wast::parser::Parser>::parse::<(i8, wast::token::Span)>
<wast::parser::Parser>::parse::<(u8, wast::token::Span)>
Line
Count
Source
562
72
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
72
        T::parse(self)
564
72
    }
<wast::parser::Parser>::parse::<(i32, wast::token::Span)>
Line
Count
Source
562
590k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
590k
        T::parse(self)
564
590k
    }
<wast::parser::Parser>::parse::<(u32, wast::token::Span)>
Line
Count
Source
562
3.68M
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
3.68M
        T::parse(self)
564
3.68M
    }
Unexecuted instantiation: <wast::parser::Parser>::parse::<(i16, wast::token::Span)>
Unexecuted instantiation: <wast::parser::Parser>::parse::<(u16, wast::token::Span)>
<wast::parser::Parser>::parse::<(i64, wast::token::Span)>
Line
Count
Source
562
1.06M
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
1.06M
        T::parse(self)
564
1.06M
    }
<wast::parser::Parser>::parse::<(u64, wast::token::Span)>
Line
Count
Source
562
110k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
110k
        T::parse(self)
564
110k
    }
Unexecuted instantiation: <wast::parser::Parser>::parse::<i8>
<wast::parser::Parser>::parse::<u8>
Line
Count
Source
562
72
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
72
        T::parse(self)
564
72
    }
<wast::parser::Parser>::parse::<i32>
Line
Count
Source
562
590k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
590k
        T::parse(self)
564
590k
    }
<wast::parser::Parser>::parse::<u32>
Line
Count
Source
562
24.8k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
24.8k
        T::parse(self)
564
24.8k
    }
Unexecuted instantiation: <wast::parser::Parser>::parse::<i16>
<wast::parser::Parser>::parse::<i64>
Line
Count
Source
562
1.06M
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
1.06M
        T::parse(self)
564
1.06M
    }
<wast::parser::Parser>::parse::<u64>
Line
Count
Source
562
110k
    pub fn parse<T: Parse<'a>>(self) -> Result<T> {
563
110k
        T::parse(self)
564
110k
    }
565
566
    /// Performs a cheap test to see whether the current token in this stream is
567
    /// `T`.
568
    ///
569
    /// This method can be used to efficiently determine what next to parse. The
570
    /// [`Peek`] trait is defined for types which can be used to test if they're
571
    /// the next item in the input stream.
572
    ///
573
    /// Nothing is actually parsed in this method, nor does this mutate the
574
    /// state of this [`Parser`]. Instead, this simply performs a check.
575
    ///
576
    /// This method is frequently combined with the [`Parser::lookahead1`]
577
    /// method to automatically produce nice error messages if some tokens
578
    /// aren't found.
579
    ///
580
    /// # Examples
581
    ///
582
    /// For an example of using the `peek` method let's take a look at parsing
583
    /// the [`Limits`] type. This is [defined in the official spec][spec] as:
584
    ///
585
    /// ```text
586
    /// limits ::= n:u32
587
    ///          | n:u32 m:u32
588
    /// ```
589
    ///
590
    /// which means that it's either one `u32` token or two, so we need to know
591
    /// whether to consume two tokens or one:
592
    ///
593
    /// ```
594
    /// # use wast::parser::*;
595
    /// struct Limits {
596
    ///     min: u32,
597
    ///     max: Option<u32>,
598
    /// }
599
    ///
600
    /// impl<'a> Parse<'a> for Limits {
601
    ///     fn parse(parser: Parser<'a>) -> Result<Self> {
602
    ///         // Always parse the first number...
603
    ///         let min = parser.parse()?;
604
    ///
605
    ///         // ... and then test if there's a second number before parsing
606
    ///         let max = if parser.peek::<u32>()? {
607
    ///             Some(parser.parse()?)
608
    ///         } else {
609
    ///             None
610
    ///         };
611
    ///
612
    ///         Ok(Limits { min, max })
613
    ///     }
614
    /// }
615
    /// ```
616
    ///
617
    /// [spec]: https://webassembly.github.io/spec/core/text/types.html#limits
618
    /// [`Limits`]: crate::core::Limits
619
53.7M
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
53.7M
        T::peek(self.cursor())
621
53.7M
    }
<wast::parser::Parser>::peek::<wast::annotation::metadata_code_branch_hint>
Line
Count
Source
619
3.87M
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
3.87M
        T::peek(self.cursor())
621
3.87M
    }
<wast::parser::Parser>::peek::<wast::annotation::custom>
Line
Count
Source
619
131
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
131
        T::peek(self.cursor())
621
131
    }
<wast::parser::Parser>::peek::<wast::annotation::dylink_0>
Line
Count
Source
619
129
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
129
        T::peek(self.cursor())
621
129
    }
<wast::parser::Parser>::peek::<wast::annotation::producers>
Line
Count
Source
619
129
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
129
        T::peek(self.cursor())
621
129
    }
<wast::parser::Parser>::peek::<wast::kw::nullexnref>
Line
Count
Source
619
335k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
335k
        T::peek(self.cursor())
621
335k
    }
Unexecuted instantiation: <wast::parser::Parser>::peek::<wast::kw::assert_trap>
Unexecuted instantiation: <wast::parser::Parser>::peek::<wast::kw::export_info>
Unexecuted instantiation: <wast::parser::Parser>::peek::<wast::kw::import_info>
<wast::parser::Parser>::peek::<wast::kw::nullcontref>
Line
Count
Source
619
324k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
324k
        T::peek(self.cursor())
621
324k
    }
<wast::parser::Parser>::peek::<wast::kw::nullfuncref>
Line
Count
Source
619
380k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
380k
        T::peek(self.cursor())
621
380k
    }
Unexecuted instantiation: <wast::parser::Parser>::peek::<wast::kw::processed_by>
Unexecuted instantiation: <wast::parser::Parser>::peek::<wast::kw::assert_return>
Unexecuted instantiation: <wast::parser::Parser>::peek::<wast::kw::nan_canonical>
<wast::parser::Parser>::peek::<wast::kw::nullexternref>
Line
Count
Source
619
362k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
362k
        T::peek(self.cursor())
621
362k
    }
<wast::parser::Parser>::peek::<wast::kw::assert_invalid>
Line
Count
Source
619
1
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
1
        T::peek(self.cursor())
621
1
    }
Unexecuted instantiation: <wast::parser::Parser>::peek::<wast::kw::nan_arithmetic>
Unexecuted instantiation: <wast::parser::Parser>::peek::<wast::kw::assert_exception>
<wast::parser::Parser>::peek::<wast::kw::assert_malformed>
Line
Count
Source
619
1
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
1
        T::peek(self.cursor())
621
1
    }
Unexecuted instantiation: <wast::parser::Parser>::peek::<wast::kw::assert_exhaustion>
Unexecuted instantiation: <wast::parser::Parser>::peek::<wast::kw::assert_suspension>
Unexecuted instantiation: <wast::parser::Parser>::peek::<wast::kw::assert_unlinkable>
<wast::parser::Parser>::peek::<wast::kw::eq>
Line
Count
Source
619
195k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
195k
        T::peek(self.cursor())
621
195k
    }
<wast::parser::Parser>::peek::<wast::kw::i8>
Line
Count
Source
619
860k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
860k
        T::peek(self.cursor())
621
860k
    }
<wast::parser::Parser>::peek::<wast::kw::any>
Line
Count
Source
619
197k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
197k
        T::peek(self.cursor())
621
197k
    }
<wast::parser::Parser>::peek::<wast::kw::exn>
Line
Count
Source
619
209k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
209k
        T::peek(self.cursor())
621
209k
    }
<wast::parser::Parser>::peek::<wast::kw::f32>
Line
Count
Source
619
2.54M
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
2.54M
        T::peek(self.cursor())
621
2.54M
    }
<wast::parser::Parser>::peek::<wast::kw::f64>
Line
Count
Source
619
2.04M
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
2.04M
        T::peek(self.cursor())
621
2.04M
    }
Unexecuted instantiation: <wast::parser::Parser>::peek::<wast::kw::get>
<wast::parser::Parser>::peek::<wast::kw::i16>
Line
Count
Source
619
338k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
338k
        T::peek(self.cursor())
621
338k
    }
<wast::parser::Parser>::peek::<wast::kw::i31>
Line
Count
Source
619
159k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
159k
        T::peek(self.cursor())
621
159k
    }
<wast::parser::Parser>::peek::<wast::kw::i32>
Line
Count
Source
619
6.32M
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
6.32M
        T::peek(self.cursor())
621
6.32M
    }
<wast::parser::Parser>::peek::<wast::kw::i64>
Line
Count
Source
619
5.75M
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
5.75M
        T::peek(self.cursor())
621
5.75M
    }
<wast::parser::Parser>::peek::<wast::kw::mut>
Line
Count
Source
619
57.4k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
57.4k
        T::peek(self.cursor())
621
57.4k
    }
<wast::parser::Parser>::peek::<wast::kw::rec>
Line
Count
Source
619
520k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
520k
        T::peek(self.cursor())
621
520k
    }
<wast::parser::Parser>::peek::<wast::kw::ref>
Line
Count
Source
619
313k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
313k
        T::peek(self.cursor())
621
313k
    }
Unexecuted instantiation: <wast::parser::Parser>::peek::<wast::kw::sdk>
<wast::parser::Parser>::peek::<wast::kw::sub>
Line
Count
Source
619
495k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
495k
        T::peek(self.cursor())
621
495k
    }
<wast::parser::Parser>::peek::<wast::kw::tag>
Line
Count
Source
619
29.0k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
29.0k
        T::peek(self.cursor())
621
29.0k
    }
Unexecuted instantiation: <wast::parser::Parser>::peek::<wast::kw::code>
<wast::parser::Parser>::peek::<wast::kw::cont>
Line
Count
Source
619
197k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
197k
        T::peek(self.cursor())
621
197k
    }
<wast::parser::Parser>::peek::<wast::kw::data>
Line
Count
Source
619
39.1k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
39.1k
        T::peek(self.cursor())
621
39.1k
    }
<wast::parser::Parser>::peek::<wast::kw::elem>
Line
Count
Source
619
55.1k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
55.1k
        T::peek(self.cursor())
621
55.1k
    }
<wast::parser::Parser>::peek::<wast::kw::func>
Line
Count
Source
619
1.22M
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
1.22M
        T::peek(self.cursor())
621
1.22M
    }
Unexecuted instantiation: <wast::parser::Parser>::peek::<wast::kw::last>
<wast::parser::Parser>::peek::<wast::kw::none>
Line
Count
Source
619
91.5k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
91.5k
        T::peek(self.cursor())
621
91.5k
    }
<wast::parser::Parser>::peek::<wast::kw::null>
Line
Count
Source
619
313k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
313k
        T::peek(self.cursor())
621
313k
    }
<wast::parser::Parser>::peek::<wast::kw::then>
Line
Count
Source
619
58.9k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
58.9k
        T::peek(self.cursor())
621
58.9k
    }
Unexecuted instantiation: <wast::parser::Parser>::peek::<wast::kw::type>
<wast::parser::Parser>::peek::<wast::kw::v128>
Line
Count
Source
619
609k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
609k
        T::peek(self.cursor())
621
609k
    }
Unexecuted instantiation: <wast::parser::Parser>::peek::<wast::kw::wait>
Unexecuted instantiation: <wast::parser::Parser>::peek::<wast::kw::after>
<wast::parser::Parser>::peek::<wast::kw::array>
Line
Count
Source
619
469k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
469k
        T::peek(self.cursor())
621
469k
    }
<wast::parser::Parser>::peek::<wast::kw::catch>
Line
Count
Source
619
241k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
241k
        T::peek(self.cursor())
621
241k
    }
<wast::parser::Parser>::peek::<wast::kw::eqref>
Line
Count
Source
619
554k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
554k
        T::peek(self.cursor())
621
554k
    }
Unexecuted instantiation: <wast::parser::Parser>::peek::<wast::kw::f32x4>
Unexecuted instantiation: <wast::parser::Parser>::peek::<wast::kw::f64x2>
<wast::parser::Parser>::peek::<wast::kw::final>
Line
Count
Source
619
158k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
158k
        T::peek(self.cursor())
621
158k
    }
Unexecuted instantiation: <wast::parser::Parser>::peek::<wast::kw::first>
<wast::parser::Parser>::peek::<wast::kw::i16x8>
Line
Count
Source
619
84.2k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
84.2k
        T::peek(self.cursor())
621
84.2k
    }
<wast::parser::Parser>::peek::<wast::kw::i32x4>
Line
Count
Source
619
84.2k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
84.2k
        T::peek(self.cursor())
621
84.2k
    }
Unexecuted instantiation: <wast::parser::Parser>::peek::<wast::kw::i64x2>
<wast::parser::Parser>::peek::<wast::kw::i8x16>
Line
Count
Source
619
84.2k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
84.2k
        T::peek(self.cursor())
621
84.2k
    }
<wast::parser::Parser>::peek::<wast::kw::noexn>
Line
Count
Source
619
91.5k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
91.5k
        T::peek(self.cursor())
621
91.5k
    }
<wast::parser::Parser>::peek::<wast::kw::param>
Line
Count
Source
619
698k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
698k
        T::peek(self.cursor())
621
698k
    }
<wast::parser::Parser>::peek::<wast::kw::start>
Line
Count
Source
619
55.3k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
55.3k
        T::peek(self.cursor())
621
55.3k
    }
<wast::parser::Parser>::peek::<wast::kw::table>
Line
Count
Source
619
246k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
246k
        T::peek(self.cursor())
621
246k
    }
<wast::parser::Parser>::peek::<wast::kw::anyref>
Line
Count
Source
619
573k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
573k
        T::peek(self.cursor())
621
573k
    }
Unexecuted instantiation: <wast::parser::Parser>::peek::<wast::kw::before>
<wast::parser::Parser>::peek::<wast::kw::binary>
Line
Count
Source
619
11.3k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
11.3k
        T::peek(self.cursor())
621
11.3k
    }
<wast::parser::Parser>::peek::<wast::kw::exnref>
Line
Count
Source
619
619k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
619k
        T::peek(self.cursor())
621
619k
    }
<wast::parser::Parser>::peek::<wast::kw::export>
Line
Count
Source
619
90.7k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
90.7k
        T::peek(self.cursor())
621
90.7k
    }
<wast::parser::Parser>::peek::<wast::kw::extern>
Line
Count
Source
619
219k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
219k
        T::peek(self.cursor())
621
219k
    }
<wast::parser::Parser>::peek::<wast::kw::global>
Line
Count
Source
619
174k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
174k
        T::peek(self.cursor())
621
174k
    }
<wast::parser::Parser>::peek::<wast::kw::i31ref>
Line
Count
Source
619
445k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
445k
        T::peek(self.cursor())
621
445k
    }
<wast::parser::Parser>::peek::<wast::kw::import>
Line
Count
Source
619
444k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
444k
        T::peek(self.cursor())
621
444k
    }
Unexecuted instantiation: <wast::parser::Parser>::peek::<wast::kw::invoke>
<wast::parser::Parser>::peek::<wast::kw::memory>
Line
Count
Source
619
205k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
205k
        T::peek(self.cursor())
621
205k
    }
<wast::parser::Parser>::peek::<wast::kw::module>
Line
Count
Source
619
1
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
1
        T::peek(self.cursor())
621
1
    }
Unexecuted instantiation: <wast::parser::Parser>::peek::<wast::kw::needed>
<wast::parser::Parser>::peek::<wast::kw::nocont>
Line
Count
Source
619
91.5k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
91.5k
        T::peek(self.cursor())
621
91.5k
    }
<wast::parser::Parser>::peek::<wast::kw::nofunc>
Line
Count
Source
619
154k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
154k
        T::peek(self.cursor())
621
154k
    }
<wast::parser::Parser>::peek::<wast::kw::offset>
Line
Count
Source
619
4.75k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
4.75k
        T::peek(self.cursor())
621
4.75k
    }
<wast::parser::Parser>::peek::<wast::kw::result>
Line
Count
Source
619
408k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
408k
        T::peek(self.cursor())
621
408k
    }
<wast::parser::Parser>::peek::<wast::kw::shared>
Line
Count
Source
619
627k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
627k
        T::peek(self.cursor())
621
627k
    }
<wast::parser::Parser>::peek::<wast::kw::struct>
Line
Count
Source
619
555k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
555k
        T::peek(self.cursor())
621
555k
    }
Unexecuted instantiation: <wast::parser::Parser>::peek::<wast::kw::switch>
Unexecuted instantiation: <wast::parser::Parser>::peek::<wast::kw::thread>
Unexecuted instantiation: <wast::parser::Parser>::peek::<wast::kw::acq_rel>
<wast::parser::Parser>::peek::<wast::kw::contref>
Line
Count
Source
619
477k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
477k
        T::peek(self.cursor())
621
477k
    }
<wast::parser::Parser>::peek::<wast::kw::declare>
Line
Count
Source
619
15.9k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
15.9k
        T::peek(self.cursor())
621
15.9k
    }
<wast::parser::Parser>::peek::<wast::kw::funcref>
Line
Count
Source
619
736k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
736k
        T::peek(self.cursor())
621
736k
    }
<wast::parser::Parser>::peek::<wast::kw::nullref>
Line
Count
Source
619
335k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
335k
        T::peek(self.cursor())
621
335k
    }
Unexecuted instantiation: <wast::parser::Parser>::peek::<wast::kw::seq_cst>
<wast::parser::Parser>::peek::<wast::kw::arrayref>
Line
Count
Source
619
503k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
503k
        T::peek(self.cursor())
621
503k
    }
Unexecuted instantiation: <wast::parser::Parser>::peek::<wast::kw::language>
Unexecuted instantiation: <wast::parser::Parser>::peek::<wast::kw::mem_info>
<wast::parser::Parser>::peek::<wast::kw::noextern>
Line
Count
Source
619
120k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
120k
        T::peek(self.cursor())
621
120k
    }
<wast::parser::Parser>::peek::<wast::kw::register>
Line
Count
Source
619
1
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
1
        T::peek(self.cursor())
621
1
    }
<wast::parser::Parser>::peek::<wast::kw::catch_all>
Line
Count
Source
619
212k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
212k
        T::peek(self.cursor())
621
212k
    }
<wast::parser::Parser>::peek::<wast::kw::catch_ref>
Line
Count
Source
619
241k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
241k
        T::peek(self.cursor())
621
241k
    }
<wast::parser::Parser>::peek::<wast::kw::component>
Line
Count
Source
619
1
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
1
        T::peek(self.cursor())
621
1
    }
<wast::parser::Parser>::peek::<wast::kw::externref>
Line
Count
Source
619
675k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
675k
        T::peek(self.cursor())
621
675k
    }
<wast::parser::Parser>::peek::<wast::kw::structref>
Line
Count
Source
619
538k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
538k
        T::peek(self.cursor())
621
538k
    }
<wast::parser::Parser>::peek::<wast::token::Id>
Line
Count
Source
619
6.01M
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
6.01M
        T::peek(self.cursor())
621
6.01M
    }
<wast::parser::Parser>::peek::<wast::token::Index>
Line
Count
Source
619
1.09M
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
1.09M
        T::peek(self.cursor())
621
1.09M
    }
<wast::parser::Parser>::peek::<wast::token::LParen>
Line
Count
Source
619
983k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
983k
        T::peek(self.cursor())
621
983k
    }
<wast::parser::Parser>::peek::<wast::token::RParen>
Line
Count
Source
619
4.75k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
4.75k
        T::peek(self.cursor())
621
4.75k
    }
<wast::parser::Parser>::peek::<wast::core::types::FunctionType>
Line
Count
Source
619
254k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
254k
        T::peek(self.cursor())
621
254k
    }
<wast::parser::Parser>::peek::<wast::core::types::AbstractHeapType>
Line
Count
Source
619
182k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
182k
        T::peek(self.cursor())
621
182k
    }
<wast::parser::Parser>::peek::<wast::core::types::FunctionTypeNoNames>
Line
Count
Source
619
370k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
370k
        T::peek(self.cursor())
621
370k
    }
<wast::parser::Parser>::peek::<wast::core::types::Type>
Line
Count
Source
619
546k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
546k
        T::peek(self.cursor())
621
546k
    }
<wast::parser::Parser>::peek::<wast::core::types::RefType>
Line
Count
Source
619
512k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
512k
        T::peek(self.cursor())
621
512k
    }
<wast::parser::Parser>::peek::<wast::core::types::ValType>
Line
Count
Source
619
219k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
219k
        T::peek(self.cursor())
621
219k
    }
Unexecuted instantiation: <wast::parser::Parser>::peek::<wast::core::types::HeapType>
<wast::parser::Parser>::peek::<wast::core::export::InlineExport>
Line
Count
Source
619
363k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
363k
        T::peek(self.cursor())
621
363k
    }
<wast::parser::Parser>::peek::<wast::core::import::InlineImport>
Line
Count
Source
619
285k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
285k
        T::peek(self.cursor())
621
285k
    }
Unexecuted instantiation: <wast::parser::Parser>::peek::<wast::core::custom::parse_sym_flags::flag>
Unexecuted instantiation: <wast::parser::Parser>::peek::<wast::core::custom::parse_sym_flags::flag>
Unexecuted instantiation: <wast::parser::Parser>::peek::<wast::core::custom::parse_sym_flags::flag>
Unexecuted instantiation: <wast::parser::Parser>::peek::<wast::core::custom::parse_sym_flags::flag>
Unexecuted instantiation: <wast::parser::Parser>::peek::<wast::core::custom::parse_sym_flags::flag>
Unexecuted instantiation: <wast::parser::Parser>::peek::<wast::core::custom::parse_sym_flags::flag>
Unexecuted instantiation: <wast::parser::Parser>::peek::<wast::core::custom::parse_sym_flags::flag>
Unexecuted instantiation: <wast::parser::Parser>::peek::<wast::core::custom::parse_sym_flags::flag>
Unexecuted instantiation: <wast::parser::Parser>::peek::<wast::core::custom::parse_sym_flags::flag>
<wast::parser::Parser>::peek::<&[u8]>
Line
Count
Source
619
16.4k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
16.4k
        T::peek(self.cursor())
621
16.4k
    }
<wast::parser::Parser>::peek::<u32>
Line
Count
Source
619
3.71M
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
3.71M
        T::peek(self.cursor())
621
3.71M
    }
<wast::parser::Parser>::peek::<u64>
Line
Count
Source
619
65.1k
    pub fn peek<T: Peek>(self) -> Result<bool> {
620
65.1k
        T::peek(self.cursor())
621
65.1k
    }
622
623
    /// Same as the [`Parser::peek`] method, except checks the next token, not
624
    /// the current token.
625
7.05M
    pub fn peek2<T: Peek>(self) -> Result<bool> {
626
7.05M
        T::peek2(self.cursor())
627
7.05M
    }
<wast::parser::Parser>::peek2::<wast::annotation::name>
Line
Count
Source
625
1.55M
    pub fn peek2<T: Peek>(self) -> Result<bool> {
626
1.55M
        T::peek2(self.cursor())
627
1.55M
    }
Unexecuted instantiation: <wast::parser::Parser>::peek2::<wast::kw::definition>
<wast::parser::Parser>::peek2::<wast::kw::catch_all_ref>
Line
Count
Source
625
26.7k
    pub fn peek2<T: Peek>(self) -> Result<bool> {
626
26.7k
        T::peek2(self.cursor())
627
26.7k
    }
Unexecuted instantiation: <wast::parser::Parser>::peek2::<wast::kw::on>
<wast::parser::Parser>::peek2::<wast::kw::mut>
Line
Count
Source
625
921k
    pub fn peek2<T: Peek>(self) -> Result<bool> {
626
921k
        T::peek2(self.cursor())
627
921k
    }
<wast::parser::Parser>::peek2::<wast::kw::item>
Line
Count
Source
625
113k
    pub fn peek2<T: Peek>(self) -> Result<bool> {
626
113k
        T::peek2(self.cursor())
627
113k
    }
<wast::parser::Parser>::peek2::<wast::kw::type>
Line
Count
Source
625
625k
    pub fn peek2<T: Peek>(self) -> Result<bool> {
626
625k
        T::peek2(self.cursor())
627
625k
    }
<wast::parser::Parser>::peek2::<wast::kw::catch>
Line
Count
Source
625
267k
    pub fn peek2<T: Peek>(self) -> Result<bool> {
626
267k
        T::peek2(self.cursor())
627
267k
    }
<wast::parser::Parser>::peek2::<wast::kw::local>
Line
Count
Source
625
209k
    pub fn peek2<T: Peek>(self) -> Result<bool> {
626
209k
        T::peek2(self.cursor())
627
209k
    }
<wast::parser::Parser>::peek2::<wast::kw::param>
Line
Count
Source
625
1.18M
    pub fn peek2<T: Peek>(self) -> Result<bool> {
626
1.18M
        T::peek2(self.cursor())
627
1.18M
    }
Unexecuted instantiation: <wast::parser::Parser>::peek2::<wast::kw::quote>
<wast::parser::Parser>::peek2::<wast::kw::table>
Line
Count
Source
625
10.2k
    pub fn peek2<T: Peek>(self) -> Result<bool> {
626
10.2k
        T::peek2(self.cursor())
627
10.2k
    }
<wast::parser::Parser>::peek2::<wast::kw::memory>
Line
Count
Source
625
4.75k
    pub fn peek2<T: Peek>(self) -> Result<bool> {
626
4.75k
        T::peek2(self.cursor())
627
4.75k
    }
<wast::parser::Parser>::peek2::<wast::kw::module>
Line
Count
Source
625
12.9k
    pub fn peek2<T: Peek>(self) -> Result<bool> {
626
12.9k
        T::peek2(self.cursor())
627
12.9k
    }
<wast::parser::Parser>::peek2::<wast::kw::offset>
Line
Count
Source
625
10.2k
    pub fn peek2<T: Peek>(self) -> Result<bool> {
626
10.2k
        T::peek2(self.cursor())
627
10.2k
    }
<wast::parser::Parser>::peek2::<wast::kw::result>
Line
Count
Source
625
979k
    pub fn peek2<T: Peek>(self) -> Result<bool> {
626
979k
        T::peek2(self.cursor())
627
979k
    }
<wast::parser::Parser>::peek2::<wast::kw::shared>
Line
Count
Source
625
62.1k
    pub fn peek2<T: Peek>(self) -> Result<bool> {
626
62.1k
        T::peek2(self.cursor())
627
62.1k
    }
Unexecuted instantiation: <wast::parser::Parser>::peek2::<wast::kw::instance>
<wast::parser::Parser>::peek2::<wast::kw::pagesize>
Line
Count
Source
625
16.9k
    pub fn peek2<T: Peek>(self) -> Result<bool> {
626
16.9k
        T::peek2(self.cursor())
627
16.9k
    }
<wast::parser::Parser>::peek2::<wast::kw::catch_all>
Line
Count
Source
625
239k
    pub fn peek2<T: Peek>(self) -> Result<bool> {
626
239k
        T::peek2(self.cursor())
627
239k
    }
<wast::parser::Parser>::peek2::<wast::kw::catch_ref>
Line
Count
Source
625
239k
    pub fn peek2<T: Peek>(self) -> Result<bool> {
626
239k
        T::peek2(self.cursor())
627
239k
    }
<wast::parser::Parser>::peek2::<wast::kw::component>
Line
Count
Source
625
1.04k
    pub fn peek2<T: Peek>(self) -> Result<bool> {
626
1.04k
        T::peek2(self.cursor())
627
1.04k
    }
<wast::parser::Parser>::peek2::<wast::wast::WastDirectiveToken>
Line
Count
Source
625
1.15k
    pub fn peek2<T: Peek>(self) -> Result<bool> {
626
1.15k
        T::peek2(self.cursor())
627
1.15k
    }
<wast::parser::Parser>::peek2::<wast::token::Index>
Line
Count
Source
625
2
    pub fn peek2<T: Peek>(self) -> Result<bool> {
626
2
        T::peek2(self.cursor())
627
2
    }
<wast::parser::Parser>::peek2::<wast::token::LParen>
Line
Count
Source
625
13.1k
    pub fn peek2<T: Peek>(self) -> Result<bool> {
626
13.1k
        T::peek2(self.cursor())
627
13.1k
    }
<wast::parser::Parser>::peek2::<wast::core::types::Type>
Line
Count
Source
625
545k
    pub fn peek2<T: Peek>(self) -> Result<bool> {
626
545k
        T::peek2(self.cursor())
627
545k
    }
<wast::parser::Parser>::peek2::<wast::core::types::RefType>
Line
Count
Source
625
9.16k
    pub fn peek2<T: Peek>(self) -> Result<bool> {
626
9.16k
        T::peek2(self.cursor())
627
9.16k
    }
628
629
    /// Same as the [`Parser::peek2`] method, except checks the next next token,
630
    /// not the next token.
631
0
    pub fn peek3<T: Peek>(self) -> Result<bool> {
632
0
        let mut cursor = self.cursor();
633
0
        match cursor.token()? {
634
0
            Some(token) => cursor.advance_past(&token),
635
0
            None => return Ok(false),
636
        }
637
0
        match cursor.token()? {
638
0
            Some(token) => cursor.advance_past(&token),
639
0
            None => return Ok(false),
640
        }
641
0
        T::peek(cursor)
642
0
    }
643
644
    /// A helper structure to perform a sequence of `peek` operations and if
645
    /// they all fail produce a nice error message.
646
    ///
647
    /// This method purely exists for conveniently producing error messages and
648
    /// provides no functionality that [`Parser::peek`] doesn't already give.
649
    /// The [`Lookahead1`] structure has one main method [`Lookahead1::peek`],
650
    /// which is the same method as [`Parser::peek`]. The difference is that the
651
    /// [`Lookahead1::error`] method needs no arguments.
652
    ///
653
    /// # Examples
654
    ///
655
    /// Let's look at the parsing of [`Index`]. This type is either a `u32` or
656
    /// an [`Id`] and is used in name resolution primarily. The [official
657
    /// grammar for an index][spec] is:
658
    ///
659
    /// ```text
660
    /// idx ::= x:u32
661
    ///       | v:id
662
    /// ```
663
    ///
664
    /// Which is to say that an index is either a `u32` or an [`Id`]. When
665
    /// parsing an [`Index`] we can do:
666
    ///
667
    /// ```
668
    /// # use wast::token::*;
669
    /// # use wast::parser::*;
670
    /// enum Index<'a> {
671
    ///     Num(u32),
672
    ///     Id(Id<'a>),
673
    /// }
674
    ///
675
    /// impl<'a> Parse<'a> for Index<'a> {
676
    ///     fn parse(parser: Parser<'a>) -> Result<Self> {
677
    ///         let mut l = parser.lookahead1();
678
    ///         if l.peek::<Id>()? {
679
    ///             Ok(Index::Id(parser.parse()?))
680
    ///         } else if l.peek::<u32>()? {
681
    ///             Ok(Index::Num(parser.parse()?))
682
    ///         } else {
683
    ///             // produces error message of `expected identifier or u32`
684
    ///             Err(l.error())
685
    ///         }
686
    ///     }
687
    /// }
688
    /// ```
689
    ///
690
    /// [spec]: https://webassembly.github.io/spec/core/text/modules.html#indices
691
    /// [`Index`]: crate::token::Index
692
    /// [`Id`]: crate::token::Id
693
10.1M
    pub fn lookahead1(self) -> Lookahead1<'a> {
694
10.1M
        Lookahead1 {
695
10.1M
            attempts: Vec::new(),
696
10.1M
            parser: self,
697
10.1M
        }
698
10.1M
    }
699
700
    /// Parse an item surrounded by parentheses.
701
    ///
702
    /// WebAssembly's text format is all based on s-expressions, so naturally
703
    /// you're going to want to parse a lot of parenthesized things! As noted in
704
    /// the documentation of [`Parse`] you typically don't parse your own
705
    /// surrounding `(` and `)` tokens, but the parser above you parsed them for
706
    /// you. This is method method the parser above you uses.
707
    ///
708
    /// This method will parse a `(` token, and then call `f` on a sub-parser
709
    /// which when finished asserts that a `)` token is the next token. This
710
    /// requires that `f` consumes all tokens leading up to the paired `)`.
711
    ///
712
    /// Usage will often simply be `parser.parens(|p| p.parse())?` to
713
    /// automatically parse a type within parentheses, but you can, as always,
714
    /// go crazy and do whatever you'd like too.
715
    ///
716
    /// # Examples
717
    ///
718
    /// A good example of this is to see how a `Module` is parsed. This isn't
719
    /// the exact definition, but it's close enough!
720
    ///
721
    /// ```
722
    /// # use wast::kw;
723
    /// # use wast::core::*;
724
    /// # use wast::parser::*;
725
    /// struct Module<'a> {
726
    ///     fields: Vec<ModuleField<'a>>,
727
    /// }
728
    ///
729
    /// impl<'a> Parse<'a> for Module<'a> {
730
    ///     fn parse(parser: Parser<'a>) -> Result<Self> {
731
    ///         // Modules start out with a `module` keyword
732
    ///         parser.parse::<kw::module>()?;
733
    ///
734
    ///         // And then everything else is `(field ...)`, so while we've got
735
    ///         // items left we continuously parse parenthesized items.
736
    ///         let mut fields = Vec::new();
737
    ///         while !parser.is_empty() {
738
    ///             fields.push(parser.parens(|p| p.parse())?);
739
    ///         }
740
    ///         Ok(Module { fields })
741
    ///     }
742
    /// }
743
    /// ```
744
4.76M
    pub fn parens<T>(self, f: impl FnOnce(Parser<'a>) -> Result<T>) -> Result<T> {
745
4.76M
        self.buf.depth.set(self.buf.depth.get() + 1);
746
4.76M
        let before = self.buf.cur.get();
747
4.76M
        let res = self.step(|cursor| {
748
4.76M
            let mut cursor = match cursor.lparen()? {
749
4.75M
                Some(rest) => rest,
750
797
                None => return Err(cursor.error("expected `(`")),
751
            };
752
4.75M
            cursor.parser.buf.cur.set(cursor.pos);
753
4.75M
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
4.75M
            cursor.pos = cursor.parser.buf.cur.get();
758
4.75M
759
4.75M
            match cursor.rparen()? {
760
4.75M
                Some(rest) => Ok((result, rest)),
761
6
                None => Err(cursor.error("expected `)`")),
762
            }
763
4.76M
        });
Unexecuted instantiation: <wast::parser::Parser>::parens::<alloc::vec::Vec<wast::core::memory::DataVal>, <wast::core::memory::Memory as wast::parser::Parse>::parse::{closure#0}>::{closure#0}
Unexecuted instantiation: <wast::parser::Parser>::parens::<wast::wat::Wat, wast::wast::parse_wat>::{closure#0}
Unexecuted instantiation: <wast::parser::Parser>::parens::<wast::wast::WastInvoke, <wast::wast::WastDirective as wast::parser::Parse>::parse::{closure#5}>::{closure#0}
Unexecuted instantiation: <wast::parser::Parser>::parens::<wast::wast::WastExecute, <wast::wast::WastDirective as wast::parser::Parse>::parse::{closure#2}>::{closure#0}
Unexecuted instantiation: <wast::parser::Parser>::parens::<wast::wast::WastExecute, <wast::wast::WastDirective as wast::parser::Parse>::parse::{closure#3}>::{closure#0}
Unexecuted instantiation: <wast::parser::Parser>::parens::<wast::wast::WastExecute, <wast::wast::WastDirective as wast::parser::Parse>::parse::{closure#6}>::{closure#0}
Unexecuted instantiation: <wast::parser::Parser>::parens::<wast::wast::WastExecute, <wast::wast::WastDirective as wast::parser::Parse>::parse::{closure#7}>::{closure#0}
<wast::parser::Parser>::parens::<wast::wast::WastDirective, <wast::wast::Wast as wast::parser::Parse>::parse::{closure#0}::{closure#0}>::{closure#0}
Line
Count
Source
747
1
        let res = self.step(|cursor| {
748
1
            let mut cursor = match cursor.lparen()? {
749
1
                Some(rest) => rest,
750
0
                None => return Err(cursor.error("expected `(`")),
751
            };
752
1
            cursor.parser.buf.cur.set(cursor.pos);
753
1
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
0
            cursor.pos = cursor.parser.buf.cur.get();
758
0
759
0
            match cursor.rparen()? {
760
0
                Some(rest) => Ok((result, rest)),
761
0
                None => Err(cursor.error("expected `)`")),
762
            }
763
1
        });
Unexecuted instantiation: <wast::parser::Parser>::parens::<wast::wast::WastDirective, <wast::wast::WastThread as wast::parser::Parse>::parse::{closure#1}>::{closure#0}
Unexecuted instantiation: <wast::parser::Parser>::parens::<wast::wast::WastArg, <wast::wast::WastInvoke as wast::parser::Parse>::parse::{closure#0}>::{closure#0}
Unexecuted instantiation: <wast::parser::Parser>::parens::<wast::wast::WastRet, <wast::wast::WastDirective as wast::parser::Parse>::parse::{closure#4}>::{closure#0}
Unexecuted instantiation: <wast::parser::Parser>::parens::<wast::wast::QuoteWat, <wast::wast::WastDirective as wast::parser::Parse>::parse::{closure#0}>::{closure#0}
Unexecuted instantiation: <wast::parser::Parser>::parens::<wast::wast::QuoteWat, <wast::wast::WastDirective as wast::parser::Parse>::parse::{closure#1}>::{closure#0}
Unexecuted instantiation: <wast::parser::Parser>::parens::<wast::token::NameAnnotation, <core::option::Option<wast::token::NameAnnotation> as wast::parser::Parse>::parse::{closure#0}>::{closure#0}
Unexecuted instantiation: <wast::parser::Parser>::parens::<wast::token::Id, <wast::wast::WastThread as wast::parser::Parse>::parse::{closure#0}::{closure#0}>::{closure#0}
Unexecuted instantiation: <wast::parser::Parser>::parens::<wast::token::Id, <wast::wast::WastThread as wast::parser::Parse>::parse::{closure#0}>::{closure#0}
<wast::parser::Parser>::parens::<wast::token::Index, <wast::core::table::Elem as wast::parser::Parse>::parse::{closure#0}>::{closure#0}
Line
Count
Source
747
7.95k
        let res = self.step(|cursor| {
748
7.95k
            let mut cursor = match cursor.lparen()? {
749
7.95k
                Some(rest) => rest,
750
0
                None => return Err(cursor.error("expected `(`")),
751
            };
752
7.95k
            cursor.parser.buf.cur.set(cursor.pos);
753
7.95k
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
7.95k
            cursor.pos = cursor.parser.buf.cur.get();
758
7.95k
759
7.95k
            match cursor.rparen()? {
760
7.95k
                Some(rest) => Ok((result, rest)),
761
0
                None => Err(cursor.error("expected `)`")),
762
            }
763
7.95k
        });
<wast::parser::Parser>::parens::<wast::token::Index, <wast::core::memory::Data as wast::parser::Parse>::parse::{closure#0}>::{closure#0}
Line
Count
Source
747
3.49k
        let res = self.step(|cursor| {
748
3.49k
            let mut cursor = match cursor.lparen()? {
749
3.49k
                Some(rest) => rest,
750
0
                None => return Err(cursor.error("expected `(`")),
751
            };
752
3.49k
            cursor.parser.buf.cur.set(cursor.pos);
753
3.49k
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
3.49k
            cursor.pos = cursor.parser.buf.cur.get();
758
3.49k
759
3.49k
            match cursor.rparen()? {
760
3.49k
                Some(rest) => Ok((result, rest)),
761
0
                None => Err(cursor.error("expected `)`")),
762
            }
763
3.49k
        });
<wast::parser::Parser>::parens::<wast::token::Index, <wast::core::types::TypeUse<wast::core::types::FunctionType> as wast::parser::Parse>::parse::{closure#0}>::{closure#0}
Line
Count
Source
747
170k
        let res = self.step(|cursor| {
748
170k
            let mut cursor = match cursor.lparen()? {
749
170k
                Some(rest) => rest,
750
0
                None => return Err(cursor.error("expected `(`")),
751
            };
752
170k
            cursor.parser.buf.cur.set(cursor.pos);
753
170k
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
170k
            cursor.pos = cursor.parser.buf.cur.get();
758
170k
759
170k
            match cursor.rparen()? {
760
170k
                Some(rest) => Ok((result, rest)),
761
0
                None => Err(cursor.error("expected `)`")),
762
            }
763
170k
        });
<wast::parser::Parser>::parens::<wast::token::Index, <wast::core::types::TypeUse<wast::core::types::FunctionTypeNoNames> as wast::parser::Parse>::parse::{closure#0}>::{closure#0}
Line
Count
Source
747
55.1k
        let res = self.step(|cursor| {
748
55.1k
            let mut cursor = match cursor.lparen()? {
749
55.1k
                Some(rest) => rest,
750
0
                None => return Err(cursor.error("expected `(`")),
751
            };
752
55.1k
            cursor.parser.buf.cur.set(cursor.pos);
753
55.1k
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
55.1k
            cursor.pos = cursor.parser.buf.cur.get();
758
55.1k
759
55.1k
            match cursor.rparen()? {
760
55.1k
                Some(rest) => Ok((result, rest)),
761
0
                None => Err(cursor.error("expected `)`")),
762
            }
763
55.1k
        });
Unexecuted instantiation: <wast::parser::Parser>::parens::<wast::component::Component, <wast::wat::Wat as wast::parser::Parse>::parse::{closure#0}::{closure#1}>::{closure#0}
Unexecuted instantiation: <wast::parser::Parser>::parens::<wast::core::expr::Expression, wast::core::table::parse_expr_or_single_instr<wast::kw::item>::{closure#0}>::{closure#0}
Unexecuted instantiation: <wast::parser::Parser>::parens::<wast::core::expr::Expression, wast::core::table::parse_expr_or_single_instr<wast::kw::offset>::{closure#0}>::{closure#0}
<wast::parser::Parser>::parens::<wast::core::expr::Expression, <wast::core::memory::Data as wast::parser::Parse>::parse::{closure#1}>::{closure#0}
Line
Count
Source
747
4.75k
        let res = self.step(|cursor| {
748
4.75k
            let mut cursor = match cursor.lparen()? {
749
4.75k
                Some(rest) => rest,
750
0
                None => return Err(cursor.error("expected `(`")),
751
            };
752
4.75k
            cursor.parser.buf.cur.set(cursor.pos);
753
4.75k
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
4.73k
            cursor.pos = cursor.parser.buf.cur.get();
758
4.73k
759
4.73k
            match cursor.rparen()? {
760
4.73k
                Some(rest) => Ok((result, rest)),
761
0
                None => Err(cursor.error("expected `)`")),
762
            }
763
4.75k
        });
<wast::parser::Parser>::parens::<wast::core::expr::TryTableCatch, <wast::core::expr::TryTable as wast::parser::Parse>::parse::{closure#0}>::{closure#0}
Line
Count
Source
747
241k
        let res = self.step(|cursor| {
748
241k
            let mut cursor = match cursor.lparen()? {
749
241k
                Some(rest) => rest,
750
0
                None => return Err(cursor.error("expected `(`")),
751
            };
752
241k
            cursor.parser.buf.cur.set(cursor.pos);
753
241k
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
241k
            cursor.pos = cursor.parser.buf.cur.get();
758
241k
759
241k
            match cursor.rparen()? {
760
241k
                Some(rest) => Ok((result, rest)),
761
0
                None => Err(cursor.error("expected `)`")),
762
            }
763
241k
        });
Unexecuted instantiation: <wast::parser::Parser>::parens::<wast::core::expr::Handle, <wast::core::expr::ResumeTable as wast::parser::Parse>::parse::{closure#0}>::{closure#0}
Unexecuted instantiation: <wast::parser::Parser>::parens::<wast::core::wast::WastRetCore, wast::core::wast::RETS::{closure#15}::{closure#0}>::{closure#0}
Unexecuted instantiation: <wast::parser::Parser>::parens::<wast::core::table::ElemPayload, <wast::core::table::Table as wast::parser::Parse>::parse::{closure#0}>::{closure#0}
<wast::parser::Parser>::parens::<wast::core::types::GlobalType, <wast::core::types::GlobalType as wast::parser::Parse>::parse::{closure#0}>::{closure#0}
Line
Count
Source
747
57.4k
        let res = self.step(|cursor| {
748
57.4k
            let mut cursor = match cursor.lparen()? {
749
57.4k
                Some(rest) => rest,
750
0
                None => return Err(cursor.error("expected `(`")),
751
            };
752
57.4k
            cursor.parser.buf.cur.set(cursor.pos);
753
57.4k
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
57.4k
            cursor.pos = cursor.parser.buf.cur.get();
758
57.4k
759
57.4k
            match cursor.rparen()? {
760
57.4k
                Some(rest) => Ok((result, rest)),
761
0
                None => Err(cursor.error("expected `)`")),
762
            }
763
57.4k
        });
<wast::parser::Parser>::parens::<wast::core::types::StorageType, <wast::core::types::StructField>::parse::{closure#0}>::{closure#0}
Line
Count
Source
747
398k
        let res = self.step(|cursor| {
748
398k
            let mut cursor = match cursor.lparen()? {
749
398k
                Some(rest) => rest,
750
0
                None => return Err(cursor.error("expected `(`")),
751
            };
752
398k
            cursor.parser.buf.cur.set(cursor.pos);
753
398k
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
398k
            cursor.pos = cursor.parser.buf.cur.get();
758
398k
759
398k
            match cursor.rparen()? {
760
398k
                Some(rest) => Ok((result, rest)),
761
0
                None => Err(cursor.error("expected `)`")),
762
            }
763
398k
        });
<wast::parser::Parser>::parens::<wast::core::types::StorageType, <wast::core::types::ArrayType as wast::parser::Parse>::parse::{closure#0}>::{closure#0}
Line
Count
Source
747
240k
        let res = self.step(|cursor| {
748
240k
            let mut cursor = match cursor.lparen()? {
749
240k
                Some(rest) => rest,
750
0
                None => return Err(cursor.error("expected `(`")),
751
            };
752
240k
            cursor.parser.buf.cur.set(cursor.pos);
753
240k
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
240k
            cursor.pos = cursor.parser.buf.cur.get();
758
240k
759
240k
            match cursor.rparen()? {
760
240k
                Some(rest) => Ok((result, rest)),
761
0
                None => Err(cursor.error("expected `)`")),
762
            }
763
240k
        });
<wast::parser::Parser>::parens::<wast::core::types::Type, <wast::core::types::Rec as wast::parser::Parse>::parse::{closure#0}>::{closure#0}
Line
Count
Source
747
469k
        let res = self.step(|cursor| {
748
469k
            let mut cursor = match cursor.lparen()? {
749
469k
                Some(rest) => rest,
750
2
                None => return Err(cursor.error("expected `(`")),
751
            };
752
469k
            cursor.parser.buf.cur.set(cursor.pos);
753
469k
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
469k
            cursor.pos = cursor.parser.buf.cur.get();
758
469k
759
469k
            match cursor.rparen()? {
760
469k
                Some(rest) => Ok((result, rest)),
761
0
                None => Err(cursor.error("expected `)`")),
762
            }
763
469k
        });
<wast::parser::Parser>::parens::<wast::core::types::RefType, <wast::core::types::RefType as wast::parser::Parse>::parse::{closure#0}>::{closure#0}
Line
Count
Source
747
313k
        let res = self.step(|cursor| {
748
313k
            let mut cursor = match cursor.lparen()? {
749
313k
                Some(rest) => rest,
750
0
                None => return Err(cursor.error("expected `(`")),
751
            };
752
313k
            cursor.parser.buf.cur.set(cursor.pos);
753
313k
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
313k
            cursor.pos = cursor.parser.buf.cur.get();
758
313k
759
313k
            match cursor.rparen()? {
760
313k
                Some(rest) => Ok((result, rest)),
761
0
                None => Err(cursor.error("expected `)`")),
762
            }
763
313k
        });
<wast::parser::Parser>::parens::<wast::core::types::TypeDef, <wast::core::types::Type as wast::parser::Parse>::parse::{closure#0}>::{closure#0}
Line
Count
Source
747
495k
        let res = self.step(|cursor| {
748
495k
            let mut cursor = match cursor.lparen()? {
749
495k
                Some(rest) => rest,
750
0
                None => return Err(cursor.error("expected `(`")),
751
            };
752
495k
            cursor.parser.buf.cur.set(cursor.pos);
753
495k
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
495k
            cursor.pos = cursor.parser.buf.cur.get();
758
495k
759
495k
            match cursor.rparen()? {
760
495k
                Some(rest) => Ok((result, rest)),
761
0
                None => Err(cursor.error("expected `)`")),
762
            }
763
495k
        });
<wast::parser::Parser>::parens::<wast::core::types::HeapType, <wast::core::types::HeapType as wast::parser::Parse>::parse::{closure#0}>::{closure#0}
Line
Count
Source
747
47.3k
        let res = self.step(|cursor| {
748
47.3k
            let mut cursor = match cursor.lparen()? {
749
47.3k
                Some(rest) => rest,
750
0
                None => return Err(cursor.error("expected `(`")),
751
            };
752
47.3k
            cursor.parser.buf.cur.set(cursor.pos);
753
47.3k
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
47.3k
            cursor.pos = cursor.parser.buf.cur.get();
758
47.3k
759
47.3k
            match cursor.rparen()? {
760
47.3k
                Some(rest) => Ok((result, rest)),
761
0
                None => Err(cursor.error("expected `)`")),
762
            }
763
47.3k
        });
Unexecuted instantiation: <wast::parser::Parser>::parens::<wast::core::custom::CustomPlace, <wast::core::custom::RawCustomSection as wast::parser::Parse>::parse::{closure#0}>::{closure#0}
Unexecuted instantiation: <wast::parser::Parser>::parens::<wast::core::import::InlineImport, <wast::core::import::InlineImport as wast::parser::Parse>::parse::{closure#0}>::{closure#0}
<wast::parser::Parser>::parens::<wast::core::import::ItemSig, <wast::core::import::Import as wast::parser::Parse>::parse::{closure#0}>::{closure#0}
Line
Count
Source
747
76.4k
        let res = self.step(|cursor| {
748
76.4k
            let mut cursor = match cursor.lparen()? {
749
76.4k
                Some(rest) => rest,
750
0
                None => return Err(cursor.error("expected `(`")),
751
            };
752
76.4k
            cursor.parser.buf.cur.set(cursor.pos);
753
76.4k
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
76.4k
            cursor.pos = cursor.parser.buf.cur.get();
758
76.4k
759
76.4k
            match cursor.rparen()? {
760
76.4k
                Some(rest) => Ok((result, rest)),
761
0
                None => Err(cursor.error("expected `)`")),
762
            }
763
76.4k
        });
Unexecuted instantiation: <wast::parser::Parser>::parens::<wast::core::import::ItemSig, <wast::core::types::ExportType as wast::parser::Parse>::parse::{closure#0}>::{closure#0}
<wast::parser::Parser>::parens::<wast::core::memory::DataVal, <wast::core::memory::DataVal as wast::parser::Parse>::parse::{closure#0}>::{closure#0}
Line
Count
Source
747
4
        let res = self.step(|cursor| {
748
4
            let mut cursor = match cursor.lparen()? {
749
4
                Some(rest) => rest,
750
0
                None => return Err(cursor.error("expected `(`")),
751
            };
752
4
            cursor.parser.buf.cur.set(cursor.pos);
753
4
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
0
            cursor.pos = cursor.parser.buf.cur.get();
758
0
759
0
            match cursor.rparen()? {
760
0
                Some(rest) => Ok((result, rest)),
761
0
                None => Err(cursor.error("expected `)`")),
762
            }
763
4
        });
<wast::parser::Parser>::parens::<wast::core::module::ModuleField, <wast::core::module::ModuleField as wast::parser::Parse>::parse>::{closure#0}
Line
Count
Source
747
547k
        let res = self.step(|cursor| {
748
547k
            let mut cursor = match cursor.lparen()? {
749
546k
                Some(rest) => rest,
750
795
                None => return Err(cursor.error("expected `(`")),
751
            };
752
546k
            cursor.parser.buf.cur.set(cursor.pos);
753
546k
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
546k
            cursor.pos = cursor.parser.buf.cur.get();
758
546k
759
546k
            match cursor.rparen()? {
760
546k
                Some(rest) => Ok((result, rest)),
761
6
                None => Err(cursor.error("expected `)`")),
762
            }
763
547k
        });
<wast::parser::Parser>::parens::<wast::core::module::Module, <wast::wat::Wat as wast::parser::Parse>::parse::{closure#0}::{closure#0}>::{closure#0}
Line
Count
Source
747
11.3k
        let res = self.step(|cursor| {
748
11.3k
            let mut cursor = match cursor.lparen()? {
749
11.3k
                Some(rest) => rest,
750
0
                None => return Err(cursor.error("expected `(`")),
751
            };
752
11.3k
            cursor.parser.buf.cur.set(cursor.pos);
753
11.3k
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
11.3k
            cursor.pos = cursor.parser.buf.cur.get();
758
11.3k
759
11.3k
            match cursor.rparen()? {
760
11.3k
                Some(rest) => Ok((result, rest)),
761
0
                None => Err(cursor.error("expected `)`")),
762
            }
763
11.3k
        });
<wast::parser::Parser>::parens::<&str, <wast::core::export::InlineExport as wast::parser::Parse>::parse::{closure#0}>::{closure#0}
Line
Count
Source
747
62.8k
        let res = self.step(|cursor| {
748
62.8k
            let mut cursor = match cursor.lparen()? {
749
62.8k
                Some(rest) => rest,
750
0
                None => return Err(cursor.error("expected `(`")),
751
            };
752
62.8k
            cursor.parser.buf.cur.set(cursor.pos);
753
62.8k
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
62.8k
            cursor.pos = cursor.parser.buf.cur.get();
758
62.8k
759
62.8k
            match cursor.rparen()? {
760
62.8k
                Some(rest) => Ok((result, rest)),
761
0
                None => Err(cursor.error("expected `)`")),
762
            }
763
62.8k
        });
<wast::parser::Parser>::parens::<(wast::core::export::ExportKind, wast::token::Index), <wast::core::export::Export as wast::parser::Parse>::parse::{closure#0}>::{closure#0}
Line
Count
Source
747
35.3k
        let res = self.step(|cursor| {
748
35.3k
            let mut cursor = match cursor.lparen()? {
749
35.3k
                Some(rest) => rest,
750
0
                None => return Err(cursor.error("expected `(`")),
751
            };
752
35.3k
            cursor.parser.buf.cur.set(cursor.pos);
753
35.3k
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
35.3k
            cursor.pos = cursor.parser.buf.cur.get();
758
35.3k
759
35.3k
            match cursor.rparen()? {
760
35.3k
                Some(rest) => Ok((result, rest)),
761
0
                None => Err(cursor.error("expected `)`")),
762
            }
763
35.3k
        });
<wast::parser::Parser>::parens::<(bool, wast::core::types::InnerTypeKind), <wast::core::types::TypeDef as wast::parser::Parse>::parse::{closure#0}::{closure#0}>::{closure#0}
Line
Count
Source
747
55.5k
        let res = self.step(|cursor| {
748
55.5k
            let mut cursor = match cursor.lparen()? {
749
55.5k
                Some(rest) => rest,
750
0
                None => return Err(cursor.error("expected `(`")),
751
            };
752
55.5k
            cursor.parser.buf.cur.set(cursor.pos);
753
55.5k
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
55.5k
            cursor.pos = cursor.parser.buf.cur.get();
758
55.5k
759
55.5k
            match cursor.rparen()? {
760
55.5k
                Some(rest) => Ok((result, rest)),
761
0
                None => Err(cursor.error("expected `)`")),
762
            }
763
55.5k
        });
<wast::parser::Parser>::parens::<(bool, wast::core::types::InnerTypeKind), <wast::core::types::TypeDef as wast::parser::Parse>::parse::{closure#0}>::{closure#0}
Line
Count
Source
747
158k
        let res = self.step(|cursor| {
748
158k
            let mut cursor = match cursor.lparen()? {
749
158k
                Some(rest) => rest,
750
0
                None => return Err(cursor.error("expected `(`")),
751
            };
752
158k
            cursor.parser.buf.cur.set(cursor.pos);
753
158k
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
158k
            cursor.pos = cursor.parser.buf.cur.get();
758
158k
759
158k
            match cursor.rparen()? {
760
158k
                Some(rest) => Ok((result, rest)),
761
0
                None => Err(cursor.error("expected `)`")),
762
            }
763
158k
        });
<wast::parser::Parser>::parens::<u32, wast::core::types::page_size::{closure#0}>::{closure#0}
Line
Count
Source
747
16.9k
        let res = self.step(|cursor| {
748
16.9k
            let mut cursor = match cursor.lparen()? {
749
16.9k
                Some(rest) => rest,
750
0
                None => return Err(cursor.error("expected `(`")),
751
            };
752
16.9k
            cursor.parser.buf.cur.set(cursor.pos);
753
16.9k
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
16.9k
            cursor.pos = cursor.parser.buf.cur.get();
758
16.9k
759
16.9k
            match cursor.rparen()? {
760
16.9k
                Some(rest) => Ok((result, rest)),
761
0
                None => Err(cursor.error("expected `)`")),
762
            }
763
16.9k
        });
<wast::parser::Parser>::parens::<(), <wast::core::func::Local>::parse_remainder::{closure#0}>::{closure#0}
Line
Count
Source
747
21.7k
        let res = self.step(|cursor| {
748
21.7k
            let mut cursor = match cursor.lparen()? {
749
21.7k
                Some(rest) => rest,
750
0
                None => return Err(cursor.error("expected `(`")),
751
            };
752
21.7k
            cursor.parser.buf.cur.set(cursor.pos);
753
21.7k
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
21.7k
            cursor.pos = cursor.parser.buf.cur.get();
758
21.7k
759
21.7k
            match cursor.rparen()? {
760
21.7k
                Some(rest) => Ok((result, rest)),
761
0
                None => Err(cursor.error("expected `)`")),
762
            }
763
21.7k
        });
Unexecuted instantiation: <wast::parser::Parser>::parens::<(), <wast::core::custom::Dylink0>::parse_next::{closure#0}>::{closure#0}
Unexecuted instantiation: <wast::parser::Parser>::parens::<(), <wast::core::custom::Dylink0>::parse_next::{closure#1}>::{closure#0}
<wast::parser::Parser>::parens::<(), <wast::core::types::FunctionType>::finish_parse::{closure#0}>::{closure#0}
Line
Count
Source
747
698k
        let res = self.step(|cursor| {
748
698k
            let mut cursor = match cursor.lparen()? {
749
698k
                Some(rest) => rest,
750
0
                None => return Err(cursor.error("expected `(`")),
751
            };
752
698k
            cursor.parser.buf.cur.set(cursor.pos);
753
698k
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
698k
            cursor.pos = cursor.parser.buf.cur.get();
758
698k
759
698k
            match cursor.rparen()? {
760
698k
                Some(rest) => Ok((result, rest)),
761
0
                None => Err(cursor.error("expected `)`")),
762
            }
763
698k
        });
Unexecuted instantiation: <wast::parser::Parser>::parens::<(), <wast::core::custom::Producers as wast::parser::Parse>::parse::{closure#0}>::{closure#0}
Unexecuted instantiation: <wast::parser::Parser>::parens::<(), <wast::core::custom::Dylink0 as wast::parser::Parse>::parse::{closure#0}>::{closure#0}
<wast::parser::Parser>::parens::<(), <wast::core::expr::SelectTypes as wast::parser::Parse>::parse::{closure#0}>::{closure#0}
Line
Count
Source
747
36
        let res = self.step(|cursor| {
748
36
            let mut cursor = match cursor.lparen()? {
749
36
                Some(rest) => rest,
750
0
                None => return Err(cursor.error("expected `(`")),
751
            };
752
36
            cursor.parser.buf.cur.set(cursor.pos);
753
36
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
36
            cursor.pos = cursor.parser.buf.cur.get();
758
36
759
36
            match cursor.rparen()? {
760
36
                Some(rest) => Ok((result, rest)),
761
0
                None => Err(cursor.error("expected `)`")),
762
            }
763
36
        });
<wast::parser::Parser>::parens::<(), <wast::core::types::StructType as wast::parser::Parse>::parse::{closure#0}>::{closure#0}
Line
Count
Source
747
570k
        let res = self.step(|cursor| {
748
570k
            let mut cursor = match cursor.lparen()? {
749
570k
                Some(rest) => rest,
750
0
                None => return Err(cursor.error("expected `(`")),
751
            };
752
570k
            cursor.parser.buf.cur.set(cursor.pos);
753
570k
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
570k
            cursor.pos = cursor.parser.buf.cur.get();
758
570k
759
570k
            match cursor.rparen()? {
760
570k
                Some(rest) => Ok((result, rest)),
761
0
                None => Err(cursor.error("expected `)`")),
762
            }
763
570k
        });
764
4.76M
        self.buf.depth.set(self.buf.depth.get() - 1);
765
4.76M
        if res.is_err() {
766
1.05k
            self.buf.cur.set(before);
767
4.75M
        }
768
4.76M
        res
769
4.76M
    }
Unexecuted instantiation: <wast::parser::Parser>::parens::<alloc::vec::Vec<wast::core::memory::DataVal>, <wast::core::memory::Memory as wast::parser::Parse>::parse::{closure#0}>
Unexecuted instantiation: <wast::parser::Parser>::parens::<wast::wat::Wat, wast::wast::parse_wat>
Unexecuted instantiation: <wast::parser::Parser>::parens::<wast::wast::WastInvoke, <wast::wast::WastDirective as wast::parser::Parse>::parse::{closure#5}>
Unexecuted instantiation: <wast::parser::Parser>::parens::<wast::wast::WastExecute, <wast::wast::WastDirective as wast::parser::Parse>::parse::{closure#2}>
Unexecuted instantiation: <wast::parser::Parser>::parens::<wast::wast::WastExecute, <wast::wast::WastDirective as wast::parser::Parse>::parse::{closure#3}>
Unexecuted instantiation: <wast::parser::Parser>::parens::<wast::wast::WastExecute, <wast::wast::WastDirective as wast::parser::Parse>::parse::{closure#6}>
Unexecuted instantiation: <wast::parser::Parser>::parens::<wast::wast::WastExecute, <wast::wast::WastDirective as wast::parser::Parse>::parse::{closure#7}>
<wast::parser::Parser>::parens::<wast::wast::WastDirective, <wast::wast::Wast as wast::parser::Parse>::parse::{closure#0}::{closure#0}>
Line
Count
Source
744
1
    pub fn parens<T>(self, f: impl FnOnce(Parser<'a>) -> Result<T>) -> Result<T> {
745
1
        self.buf.depth.set(self.buf.depth.get() + 1);
746
1
        let before = self.buf.cur.get();
747
1
        let res = self.step(|cursor| {
748
            let mut cursor = match cursor.lparen()? {
749
                Some(rest) => rest,
750
                None => return Err(cursor.error("expected `(`")),
751
            };
752
            cursor.parser.buf.cur.set(cursor.pos);
753
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
            cursor.pos = cursor.parser.buf.cur.get();
758
759
            match cursor.rparen()? {
760
                Some(rest) => Ok((result, rest)),
761
                None => Err(cursor.error("expected `)`")),
762
            }
763
1
        });
764
1
        self.buf.depth.set(self.buf.depth.get() - 1);
765
1
        if res.is_err() {
766
1
            self.buf.cur.set(before);
767
1
        }
768
1
        res
769
1
    }
Unexecuted instantiation: <wast::parser::Parser>::parens::<wast::wast::WastDirective, <wast::wast::WastThread as wast::parser::Parse>::parse::{closure#1}>
Unexecuted instantiation: <wast::parser::Parser>::parens::<wast::wast::WastArg, <wast::wast::WastInvoke as wast::parser::Parse>::parse::{closure#0}>
Unexecuted instantiation: <wast::parser::Parser>::parens::<wast::wast::WastRet, <wast::wast::WastDirective as wast::parser::Parse>::parse::{closure#4}>
Unexecuted instantiation: <wast::parser::Parser>::parens::<wast::wast::QuoteWat, <wast::wast::WastDirective as wast::parser::Parse>::parse::{closure#0}>
Unexecuted instantiation: <wast::parser::Parser>::parens::<wast::wast::QuoteWat, <wast::wast::WastDirective as wast::parser::Parse>::parse::{closure#1}>
Unexecuted instantiation: <wast::parser::Parser>::parens::<wast::token::NameAnnotation, <core::option::Option<wast::token::NameAnnotation> as wast::parser::Parse>::parse::{closure#0}>
Unexecuted instantiation: <wast::parser::Parser>::parens::<wast::token::Id, <wast::wast::WastThread as wast::parser::Parse>::parse::{closure#0}::{closure#0}>
Unexecuted instantiation: <wast::parser::Parser>::parens::<wast::token::Id, <wast::wast::WastThread as wast::parser::Parse>::parse::{closure#0}>
<wast::parser::Parser>::parens::<wast::token::Index, <wast::core::table::Elem as wast::parser::Parse>::parse::{closure#0}>
Line
Count
Source
744
7.95k
    pub fn parens<T>(self, f: impl FnOnce(Parser<'a>) -> Result<T>) -> Result<T> {
745
7.95k
        self.buf.depth.set(self.buf.depth.get() + 1);
746
7.95k
        let before = self.buf.cur.get();
747
7.95k
        let res = self.step(|cursor| {
748
            let mut cursor = match cursor.lparen()? {
749
                Some(rest) => rest,
750
                None => return Err(cursor.error("expected `(`")),
751
            };
752
            cursor.parser.buf.cur.set(cursor.pos);
753
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
            cursor.pos = cursor.parser.buf.cur.get();
758
759
            match cursor.rparen()? {
760
                Some(rest) => Ok((result, rest)),
761
                None => Err(cursor.error("expected `)`")),
762
            }
763
7.95k
        });
764
7.95k
        self.buf.depth.set(self.buf.depth.get() - 1);
765
7.95k
        if res.is_err() {
766
0
            self.buf.cur.set(before);
767
7.95k
        }
768
7.95k
        res
769
7.95k
    }
<wast::parser::Parser>::parens::<wast::token::Index, <wast::core::memory::Data as wast::parser::Parse>::parse::{closure#0}>
Line
Count
Source
744
3.49k
    pub fn parens<T>(self, f: impl FnOnce(Parser<'a>) -> Result<T>) -> Result<T> {
745
3.49k
        self.buf.depth.set(self.buf.depth.get() + 1);
746
3.49k
        let before = self.buf.cur.get();
747
3.49k
        let res = self.step(|cursor| {
748
            let mut cursor = match cursor.lparen()? {
749
                Some(rest) => rest,
750
                None => return Err(cursor.error("expected `(`")),
751
            };
752
            cursor.parser.buf.cur.set(cursor.pos);
753
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
            cursor.pos = cursor.parser.buf.cur.get();
758
759
            match cursor.rparen()? {
760
                Some(rest) => Ok((result, rest)),
761
                None => Err(cursor.error("expected `)`")),
762
            }
763
3.49k
        });
764
3.49k
        self.buf.depth.set(self.buf.depth.get() - 1);
765
3.49k
        if res.is_err() {
766
0
            self.buf.cur.set(before);
767
3.49k
        }
768
3.49k
        res
769
3.49k
    }
<wast::parser::Parser>::parens::<wast::token::Index, <wast::core::types::TypeUse<wast::core::types::FunctionType> as wast::parser::Parse>::parse::{closure#0}>
Line
Count
Source
744
170k
    pub fn parens<T>(self, f: impl FnOnce(Parser<'a>) -> Result<T>) -> Result<T> {
745
170k
        self.buf.depth.set(self.buf.depth.get() + 1);
746
170k
        let before = self.buf.cur.get();
747
170k
        let res = self.step(|cursor| {
748
            let mut cursor = match cursor.lparen()? {
749
                Some(rest) => rest,
750
                None => return Err(cursor.error("expected `(`")),
751
            };
752
            cursor.parser.buf.cur.set(cursor.pos);
753
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
            cursor.pos = cursor.parser.buf.cur.get();
758
759
            match cursor.rparen()? {
760
                Some(rest) => Ok((result, rest)),
761
                None => Err(cursor.error("expected `)`")),
762
            }
763
170k
        });
764
170k
        self.buf.depth.set(self.buf.depth.get() - 1);
765
170k
        if res.is_err() {
766
0
            self.buf.cur.set(before);
767
170k
        }
768
170k
        res
769
170k
    }
<wast::parser::Parser>::parens::<wast::token::Index, <wast::core::types::TypeUse<wast::core::types::FunctionTypeNoNames> as wast::parser::Parse>::parse::{closure#0}>
Line
Count
Source
744
55.1k
    pub fn parens<T>(self, f: impl FnOnce(Parser<'a>) -> Result<T>) -> Result<T> {
745
55.1k
        self.buf.depth.set(self.buf.depth.get() + 1);
746
55.1k
        let before = self.buf.cur.get();
747
55.1k
        let res = self.step(|cursor| {
748
            let mut cursor = match cursor.lparen()? {
749
                Some(rest) => rest,
750
                None => return Err(cursor.error("expected `(`")),
751
            };
752
            cursor.parser.buf.cur.set(cursor.pos);
753
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
            cursor.pos = cursor.parser.buf.cur.get();
758
759
            match cursor.rparen()? {
760
                Some(rest) => Ok((result, rest)),
761
                None => Err(cursor.error("expected `)`")),
762
            }
763
55.1k
        });
764
55.1k
        self.buf.depth.set(self.buf.depth.get() - 1);
765
55.1k
        if res.is_err() {
766
0
            self.buf.cur.set(before);
767
55.1k
        }
768
55.1k
        res
769
55.1k
    }
Unexecuted instantiation: <wast::parser::Parser>::parens::<wast::component::Component, <wast::wat::Wat as wast::parser::Parse>::parse::{closure#0}::{closure#1}>
Unexecuted instantiation: <wast::parser::Parser>::parens::<wast::core::expr::Expression, wast::core::table::parse_expr_or_single_instr<wast::kw::item>::{closure#0}>
Unexecuted instantiation: <wast::parser::Parser>::parens::<wast::core::expr::Expression, wast::core::table::parse_expr_or_single_instr<wast::kw::offset>::{closure#0}>
<wast::parser::Parser>::parens::<wast::core::expr::Expression, <wast::core::memory::Data as wast::parser::Parse>::parse::{closure#1}>
Line
Count
Source
744
4.75k
    pub fn parens<T>(self, f: impl FnOnce(Parser<'a>) -> Result<T>) -> Result<T> {
745
4.75k
        self.buf.depth.set(self.buf.depth.get() + 1);
746
4.75k
        let before = self.buf.cur.get();
747
4.75k
        let res = self.step(|cursor| {
748
            let mut cursor = match cursor.lparen()? {
749
                Some(rest) => rest,
750
                None => return Err(cursor.error("expected `(`")),
751
            };
752
            cursor.parser.buf.cur.set(cursor.pos);
753
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
            cursor.pos = cursor.parser.buf.cur.get();
758
759
            match cursor.rparen()? {
760
                Some(rest) => Ok((result, rest)),
761
                None => Err(cursor.error("expected `)`")),
762
            }
763
4.75k
        });
764
4.75k
        self.buf.depth.set(self.buf.depth.get() - 1);
765
4.75k
        if res.is_err() {
766
23
            self.buf.cur.set(before);
767
4.73k
        }
768
4.75k
        res
769
4.75k
    }
<wast::parser::Parser>::parens::<wast::core::expr::TryTableCatch, <wast::core::expr::TryTable as wast::parser::Parse>::parse::{closure#0}>
Line
Count
Source
744
241k
    pub fn parens<T>(self, f: impl FnOnce(Parser<'a>) -> Result<T>) -> Result<T> {
745
241k
        self.buf.depth.set(self.buf.depth.get() + 1);
746
241k
        let before = self.buf.cur.get();
747
241k
        let res = self.step(|cursor| {
748
            let mut cursor = match cursor.lparen()? {
749
                Some(rest) => rest,
750
                None => return Err(cursor.error("expected `(`")),
751
            };
752
            cursor.parser.buf.cur.set(cursor.pos);
753
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
            cursor.pos = cursor.parser.buf.cur.get();
758
759
            match cursor.rparen()? {
760
                Some(rest) => Ok((result, rest)),
761
                None => Err(cursor.error("expected `)`")),
762
            }
763
241k
        });
764
241k
        self.buf.depth.set(self.buf.depth.get() - 1);
765
241k
        if res.is_err() {
766
0
            self.buf.cur.set(before);
767
241k
        }
768
241k
        res
769
241k
    }
Unexecuted instantiation: <wast::parser::Parser>::parens::<wast::core::expr::Handle, <wast::core::expr::ResumeTable as wast::parser::Parse>::parse::{closure#0}>
Unexecuted instantiation: <wast::parser::Parser>::parens::<wast::core::wast::WastRetCore, wast::core::wast::RETS::{closure#15}::{closure#0}>
Unexecuted instantiation: <wast::parser::Parser>::parens::<wast::core::table::ElemPayload, <wast::core::table::Table as wast::parser::Parse>::parse::{closure#0}>
<wast::parser::Parser>::parens::<wast::core::types::GlobalType, <wast::core::types::GlobalType as wast::parser::Parse>::parse::{closure#0}>
Line
Count
Source
744
57.4k
    pub fn parens<T>(self, f: impl FnOnce(Parser<'a>) -> Result<T>) -> Result<T> {
745
57.4k
        self.buf.depth.set(self.buf.depth.get() + 1);
746
57.4k
        let before = self.buf.cur.get();
747
57.4k
        let res = self.step(|cursor| {
748
            let mut cursor = match cursor.lparen()? {
749
                Some(rest) => rest,
750
                None => return Err(cursor.error("expected `(`")),
751
            };
752
            cursor.parser.buf.cur.set(cursor.pos);
753
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
            cursor.pos = cursor.parser.buf.cur.get();
758
759
            match cursor.rparen()? {
760
                Some(rest) => Ok((result, rest)),
761
                None => Err(cursor.error("expected `)`")),
762
            }
763
57.4k
        });
764
57.4k
        self.buf.depth.set(self.buf.depth.get() - 1);
765
57.4k
        if res.is_err() {
766
0
            self.buf.cur.set(before);
767
57.4k
        }
768
57.4k
        res
769
57.4k
    }
<wast::parser::Parser>::parens::<wast::core::types::StorageType, <wast::core::types::StructField>::parse::{closure#0}>
Line
Count
Source
744
398k
    pub fn parens<T>(self, f: impl FnOnce(Parser<'a>) -> Result<T>) -> Result<T> {
745
398k
        self.buf.depth.set(self.buf.depth.get() + 1);
746
398k
        let before = self.buf.cur.get();
747
398k
        let res = self.step(|cursor| {
748
            let mut cursor = match cursor.lparen()? {
749
                Some(rest) => rest,
750
                None => return Err(cursor.error("expected `(`")),
751
            };
752
            cursor.parser.buf.cur.set(cursor.pos);
753
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
            cursor.pos = cursor.parser.buf.cur.get();
758
759
            match cursor.rparen()? {
760
                Some(rest) => Ok((result, rest)),
761
                None => Err(cursor.error("expected `)`")),
762
            }
763
398k
        });
764
398k
        self.buf.depth.set(self.buf.depth.get() - 1);
765
398k
        if res.is_err() {
766
0
            self.buf.cur.set(before);
767
398k
        }
768
398k
        res
769
398k
    }
<wast::parser::Parser>::parens::<wast::core::types::StorageType, <wast::core::types::ArrayType as wast::parser::Parse>::parse::{closure#0}>
Line
Count
Source
744
240k
    pub fn parens<T>(self, f: impl FnOnce(Parser<'a>) -> Result<T>) -> Result<T> {
745
240k
        self.buf.depth.set(self.buf.depth.get() + 1);
746
240k
        let before = self.buf.cur.get();
747
240k
        let res = self.step(|cursor| {
748
            let mut cursor = match cursor.lparen()? {
749
                Some(rest) => rest,
750
                None => return Err(cursor.error("expected `(`")),
751
            };
752
            cursor.parser.buf.cur.set(cursor.pos);
753
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
            cursor.pos = cursor.parser.buf.cur.get();
758
759
            match cursor.rparen()? {
760
                Some(rest) => Ok((result, rest)),
761
                None => Err(cursor.error("expected `)`")),
762
            }
763
240k
        });
764
240k
        self.buf.depth.set(self.buf.depth.get() - 1);
765
240k
        if res.is_err() {
766
0
            self.buf.cur.set(before);
767
240k
        }
768
240k
        res
769
240k
    }
<wast::parser::Parser>::parens::<wast::core::types::Type, <wast::core::types::Rec as wast::parser::Parse>::parse::{closure#0}>
Line
Count
Source
744
469k
    pub fn parens<T>(self, f: impl FnOnce(Parser<'a>) -> Result<T>) -> Result<T> {
745
469k
        self.buf.depth.set(self.buf.depth.get() + 1);
746
469k
        let before = self.buf.cur.get();
747
469k
        let res = self.step(|cursor| {
748
            let mut cursor = match cursor.lparen()? {
749
                Some(rest) => rest,
750
                None => return Err(cursor.error("expected `(`")),
751
            };
752
            cursor.parser.buf.cur.set(cursor.pos);
753
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
            cursor.pos = cursor.parser.buf.cur.get();
758
759
            match cursor.rparen()? {
760
                Some(rest) => Ok((result, rest)),
761
                None => Err(cursor.error("expected `)`")),
762
            }
763
469k
        });
764
469k
        self.buf.depth.set(self.buf.depth.get() - 1);
765
469k
        if res.is_err() {
766
2
            self.buf.cur.set(before);
767
469k
        }
768
469k
        res
769
469k
    }
<wast::parser::Parser>::parens::<wast::core::types::RefType, <wast::core::types::RefType as wast::parser::Parse>::parse::{closure#0}>
Line
Count
Source
744
313k
    pub fn parens<T>(self, f: impl FnOnce(Parser<'a>) -> Result<T>) -> Result<T> {
745
313k
        self.buf.depth.set(self.buf.depth.get() + 1);
746
313k
        let before = self.buf.cur.get();
747
313k
        let res = self.step(|cursor| {
748
            let mut cursor = match cursor.lparen()? {
749
                Some(rest) => rest,
750
                None => return Err(cursor.error("expected `(`")),
751
            };
752
            cursor.parser.buf.cur.set(cursor.pos);
753
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
            cursor.pos = cursor.parser.buf.cur.get();
758
759
            match cursor.rparen()? {
760
                Some(rest) => Ok((result, rest)),
761
                None => Err(cursor.error("expected `)`")),
762
            }
763
313k
        });
764
313k
        self.buf.depth.set(self.buf.depth.get() - 1);
765
313k
        if res.is_err() {
766
0
            self.buf.cur.set(before);
767
313k
        }
768
313k
        res
769
313k
    }
<wast::parser::Parser>::parens::<wast::core::types::TypeDef, <wast::core::types::Type as wast::parser::Parse>::parse::{closure#0}>
Line
Count
Source
744
495k
    pub fn parens<T>(self, f: impl FnOnce(Parser<'a>) -> Result<T>) -> Result<T> {
745
495k
        self.buf.depth.set(self.buf.depth.get() + 1);
746
495k
        let before = self.buf.cur.get();
747
495k
        let res = self.step(|cursor| {
748
            let mut cursor = match cursor.lparen()? {
749
                Some(rest) => rest,
750
                None => return Err(cursor.error("expected `(`")),
751
            };
752
            cursor.parser.buf.cur.set(cursor.pos);
753
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
            cursor.pos = cursor.parser.buf.cur.get();
758
759
            match cursor.rparen()? {
760
                Some(rest) => Ok((result, rest)),
761
                None => Err(cursor.error("expected `)`")),
762
            }
763
495k
        });
764
495k
        self.buf.depth.set(self.buf.depth.get() - 1);
765
495k
        if res.is_err() {
766
0
            self.buf.cur.set(before);
767
495k
        }
768
495k
        res
769
495k
    }
<wast::parser::Parser>::parens::<wast::core::types::HeapType, <wast::core::types::HeapType as wast::parser::Parse>::parse::{closure#0}>
Line
Count
Source
744
47.3k
    pub fn parens<T>(self, f: impl FnOnce(Parser<'a>) -> Result<T>) -> Result<T> {
745
47.3k
        self.buf.depth.set(self.buf.depth.get() + 1);
746
47.3k
        let before = self.buf.cur.get();
747
47.3k
        let res = self.step(|cursor| {
748
            let mut cursor = match cursor.lparen()? {
749
                Some(rest) => rest,
750
                None => return Err(cursor.error("expected `(`")),
751
            };
752
            cursor.parser.buf.cur.set(cursor.pos);
753
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
            cursor.pos = cursor.parser.buf.cur.get();
758
759
            match cursor.rparen()? {
760
                Some(rest) => Ok((result, rest)),
761
                None => Err(cursor.error("expected `)`")),
762
            }
763
47.3k
        });
764
47.3k
        self.buf.depth.set(self.buf.depth.get() - 1);
765
47.3k
        if res.is_err() {
766
0
            self.buf.cur.set(before);
767
47.3k
        }
768
47.3k
        res
769
47.3k
    }
Unexecuted instantiation: <wast::parser::Parser>::parens::<wast::core::custom::CustomPlace, <wast::core::custom::RawCustomSection as wast::parser::Parse>::parse::{closure#0}>
Unexecuted instantiation: <wast::parser::Parser>::parens::<wast::core::import::InlineImport, <wast::core::import::InlineImport as wast::parser::Parse>::parse::{closure#0}>
<wast::parser::Parser>::parens::<wast::core::import::ItemSig, <wast::core::import::Import as wast::parser::Parse>::parse::{closure#0}>
Line
Count
Source
744
76.4k
    pub fn parens<T>(self, f: impl FnOnce(Parser<'a>) -> Result<T>) -> Result<T> {
745
76.4k
        self.buf.depth.set(self.buf.depth.get() + 1);
746
76.4k
        let before = self.buf.cur.get();
747
76.4k
        let res = self.step(|cursor| {
748
            let mut cursor = match cursor.lparen()? {
749
                Some(rest) => rest,
750
                None => return Err(cursor.error("expected `(`")),
751
            };
752
            cursor.parser.buf.cur.set(cursor.pos);
753
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
            cursor.pos = cursor.parser.buf.cur.get();
758
759
            match cursor.rparen()? {
760
                Some(rest) => Ok((result, rest)),
761
                None => Err(cursor.error("expected `)`")),
762
            }
763
76.4k
        });
764
76.4k
        self.buf.depth.set(self.buf.depth.get() - 1);
765
76.4k
        if res.is_err() {
766
0
            self.buf.cur.set(before);
767
76.4k
        }
768
76.4k
        res
769
76.4k
    }
Unexecuted instantiation: <wast::parser::Parser>::parens::<wast::core::import::ItemSig, <wast::core::types::ExportType as wast::parser::Parse>::parse::{closure#0}>
<wast::parser::Parser>::parens::<wast::core::memory::DataVal, <wast::core::memory::DataVal as wast::parser::Parse>::parse::{closure#0}>
Line
Count
Source
744
4
    pub fn parens<T>(self, f: impl FnOnce(Parser<'a>) -> Result<T>) -> Result<T> {
745
4
        self.buf.depth.set(self.buf.depth.get() + 1);
746
4
        let before = self.buf.cur.get();
747
4
        let res = self.step(|cursor| {
748
            let mut cursor = match cursor.lparen()? {
749
                Some(rest) => rest,
750
                None => return Err(cursor.error("expected `(`")),
751
            };
752
            cursor.parser.buf.cur.set(cursor.pos);
753
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
            cursor.pos = cursor.parser.buf.cur.get();
758
759
            match cursor.rparen()? {
760
                Some(rest) => Ok((result, rest)),
761
                None => Err(cursor.error("expected `)`")),
762
            }
763
4
        });
764
4
        self.buf.depth.set(self.buf.depth.get() - 1);
765
4
        if res.is_err() {
766
4
            self.buf.cur.set(before);
767
4
        }
768
4
        res
769
4
    }
<wast::parser::Parser>::parens::<wast::core::module::ModuleField, <wast::core::module::ModuleField as wast::parser::Parse>::parse>
Line
Count
Source
744
547k
    pub fn parens<T>(self, f: impl FnOnce(Parser<'a>) -> Result<T>) -> Result<T> {
745
547k
        self.buf.depth.set(self.buf.depth.get() + 1);
746
547k
        let before = self.buf.cur.get();
747
547k
        let res = self.step(|cursor| {
748
            let mut cursor = match cursor.lparen()? {
749
                Some(rest) => rest,
750
                None => return Err(cursor.error("expected `(`")),
751
            };
752
            cursor.parser.buf.cur.set(cursor.pos);
753
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
            cursor.pos = cursor.parser.buf.cur.get();
758
759
            match cursor.rparen()? {
760
                Some(rest) => Ok((result, rest)),
761
                None => Err(cursor.error("expected `)`")),
762
            }
763
547k
        });
764
547k
        self.buf.depth.set(self.buf.depth.get() - 1);
765
547k
        if res.is_err() {
766
1.02k
            self.buf.cur.set(before);
767
546k
        }
768
547k
        res
769
547k
    }
<wast::parser::Parser>::parens::<wast::core::module::Module, <wast::wat::Wat as wast::parser::Parse>::parse::{closure#0}::{closure#0}>
Line
Count
Source
744
11.3k
    pub fn parens<T>(self, f: impl FnOnce(Parser<'a>) -> Result<T>) -> Result<T> {
745
11.3k
        self.buf.depth.set(self.buf.depth.get() + 1);
746
11.3k
        let before = self.buf.cur.get();
747
11.3k
        let res = self.step(|cursor| {
748
            let mut cursor = match cursor.lparen()? {
749
                Some(rest) => rest,
750
                None => return Err(cursor.error("expected `(`")),
751
            };
752
            cursor.parser.buf.cur.set(cursor.pos);
753
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
            cursor.pos = cursor.parser.buf.cur.get();
758
759
            match cursor.rparen()? {
760
                Some(rest) => Ok((result, rest)),
761
                None => Err(cursor.error("expected `)`")),
762
            }
763
11.3k
        });
764
11.3k
        self.buf.depth.set(self.buf.depth.get() - 1);
765
11.3k
        if res.is_err() {
766
0
            self.buf.cur.set(before);
767
11.3k
        }
768
11.3k
        res
769
11.3k
    }
<wast::parser::Parser>::parens::<&str, <wast::core::export::InlineExport as wast::parser::Parse>::parse::{closure#0}>
Line
Count
Source
744
62.8k
    pub fn parens<T>(self, f: impl FnOnce(Parser<'a>) -> Result<T>) -> Result<T> {
745
62.8k
        self.buf.depth.set(self.buf.depth.get() + 1);
746
62.8k
        let before = self.buf.cur.get();
747
62.8k
        let res = self.step(|cursor| {
748
            let mut cursor = match cursor.lparen()? {
749
                Some(rest) => rest,
750
                None => return Err(cursor.error("expected `(`")),
751
            };
752
            cursor.parser.buf.cur.set(cursor.pos);
753
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
            cursor.pos = cursor.parser.buf.cur.get();
758
759
            match cursor.rparen()? {
760
                Some(rest) => Ok((result, rest)),
761
                None => Err(cursor.error("expected `)`")),
762
            }
763
62.8k
        });
764
62.8k
        self.buf.depth.set(self.buf.depth.get() - 1);
765
62.8k
        if res.is_err() {
766
0
            self.buf.cur.set(before);
767
62.8k
        }
768
62.8k
        res
769
62.8k
    }
<wast::parser::Parser>::parens::<(wast::core::export::ExportKind, wast::token::Index), <wast::core::export::Export as wast::parser::Parse>::parse::{closure#0}>
Line
Count
Source
744
35.3k
    pub fn parens<T>(self, f: impl FnOnce(Parser<'a>) -> Result<T>) -> Result<T> {
745
35.3k
        self.buf.depth.set(self.buf.depth.get() + 1);
746
35.3k
        let before = self.buf.cur.get();
747
35.3k
        let res = self.step(|cursor| {
748
            let mut cursor = match cursor.lparen()? {
749
                Some(rest) => rest,
750
                None => return Err(cursor.error("expected `(`")),
751
            };
752
            cursor.parser.buf.cur.set(cursor.pos);
753
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
            cursor.pos = cursor.parser.buf.cur.get();
758
759
            match cursor.rparen()? {
760
                Some(rest) => Ok((result, rest)),
761
                None => Err(cursor.error("expected `)`")),
762
            }
763
35.3k
        });
764
35.3k
        self.buf.depth.set(self.buf.depth.get() - 1);
765
35.3k
        if res.is_err() {
766
0
            self.buf.cur.set(before);
767
35.3k
        }
768
35.3k
        res
769
35.3k
    }
<wast::parser::Parser>::parens::<(bool, wast::core::types::InnerTypeKind), <wast::core::types::TypeDef as wast::parser::Parse>::parse::{closure#0}::{closure#0}>
Line
Count
Source
744
55.5k
    pub fn parens<T>(self, f: impl FnOnce(Parser<'a>) -> Result<T>) -> Result<T> {
745
55.5k
        self.buf.depth.set(self.buf.depth.get() + 1);
746
55.5k
        let before = self.buf.cur.get();
747
55.5k
        let res = self.step(|cursor| {
748
            let mut cursor = match cursor.lparen()? {
749
                Some(rest) => rest,
750
                None => return Err(cursor.error("expected `(`")),
751
            };
752
            cursor.parser.buf.cur.set(cursor.pos);
753
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
            cursor.pos = cursor.parser.buf.cur.get();
758
759
            match cursor.rparen()? {
760
                Some(rest) => Ok((result, rest)),
761
                None => Err(cursor.error("expected `)`")),
762
            }
763
55.5k
        });
764
55.5k
        self.buf.depth.set(self.buf.depth.get() - 1);
765
55.5k
        if res.is_err() {
766
0
            self.buf.cur.set(before);
767
55.5k
        }
768
55.5k
        res
769
55.5k
    }
<wast::parser::Parser>::parens::<(bool, wast::core::types::InnerTypeKind), <wast::core::types::TypeDef as wast::parser::Parse>::parse::{closure#0}>
Line
Count
Source
744
158k
    pub fn parens<T>(self, f: impl FnOnce(Parser<'a>) -> Result<T>) -> Result<T> {
745
158k
        self.buf.depth.set(self.buf.depth.get() + 1);
746
158k
        let before = self.buf.cur.get();
747
158k
        let res = self.step(|cursor| {
748
            let mut cursor = match cursor.lparen()? {
749
                Some(rest) => rest,
750
                None => return Err(cursor.error("expected `(`")),
751
            };
752
            cursor.parser.buf.cur.set(cursor.pos);
753
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
            cursor.pos = cursor.parser.buf.cur.get();
758
759
            match cursor.rparen()? {
760
                Some(rest) => Ok((result, rest)),
761
                None => Err(cursor.error("expected `)`")),
762
            }
763
158k
        });
764
158k
        self.buf.depth.set(self.buf.depth.get() - 1);
765
158k
        if res.is_err() {
766
0
            self.buf.cur.set(before);
767
158k
        }
768
158k
        res
769
158k
    }
<wast::parser::Parser>::parens::<u32, wast::core::types::page_size::{closure#0}>
Line
Count
Source
744
16.9k
    pub fn parens<T>(self, f: impl FnOnce(Parser<'a>) -> Result<T>) -> Result<T> {
745
16.9k
        self.buf.depth.set(self.buf.depth.get() + 1);
746
16.9k
        let before = self.buf.cur.get();
747
16.9k
        let res = self.step(|cursor| {
748
            let mut cursor = match cursor.lparen()? {
749
                Some(rest) => rest,
750
                None => return Err(cursor.error("expected `(`")),
751
            };
752
            cursor.parser.buf.cur.set(cursor.pos);
753
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
            cursor.pos = cursor.parser.buf.cur.get();
758
759
            match cursor.rparen()? {
760
                Some(rest) => Ok((result, rest)),
761
                None => Err(cursor.error("expected `)`")),
762
            }
763
16.9k
        });
764
16.9k
        self.buf.depth.set(self.buf.depth.get() - 1);
765
16.9k
        if res.is_err() {
766
0
            self.buf.cur.set(before);
767
16.9k
        }
768
16.9k
        res
769
16.9k
    }
<wast::parser::Parser>::parens::<(), <wast::core::func::Local>::parse_remainder::{closure#0}>
Line
Count
Source
744
21.7k
    pub fn parens<T>(self, f: impl FnOnce(Parser<'a>) -> Result<T>) -> Result<T> {
745
21.7k
        self.buf.depth.set(self.buf.depth.get() + 1);
746
21.7k
        let before = self.buf.cur.get();
747
21.7k
        let res = self.step(|cursor| {
748
            let mut cursor = match cursor.lparen()? {
749
                Some(rest) => rest,
750
                None => return Err(cursor.error("expected `(`")),
751
            };
752
            cursor.parser.buf.cur.set(cursor.pos);
753
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
            cursor.pos = cursor.parser.buf.cur.get();
758
759
            match cursor.rparen()? {
760
                Some(rest) => Ok((result, rest)),
761
                None => Err(cursor.error("expected `)`")),
762
            }
763
21.7k
        });
764
21.7k
        self.buf.depth.set(self.buf.depth.get() - 1);
765
21.7k
        if res.is_err() {
766
0
            self.buf.cur.set(before);
767
21.7k
        }
768
21.7k
        res
769
21.7k
    }
Unexecuted instantiation: <wast::parser::Parser>::parens::<(), <wast::core::custom::Dylink0>::parse_next::{closure#0}>
Unexecuted instantiation: <wast::parser::Parser>::parens::<(), <wast::core::custom::Dylink0>::parse_next::{closure#1}>
<wast::parser::Parser>::parens::<(), <wast::core::types::FunctionType>::finish_parse::{closure#0}>
Line
Count
Source
744
698k
    pub fn parens<T>(self, f: impl FnOnce(Parser<'a>) -> Result<T>) -> Result<T> {
745
698k
        self.buf.depth.set(self.buf.depth.get() + 1);
746
698k
        let before = self.buf.cur.get();
747
698k
        let res = self.step(|cursor| {
748
            let mut cursor = match cursor.lparen()? {
749
                Some(rest) => rest,
750
                None => return Err(cursor.error("expected `(`")),
751
            };
752
            cursor.parser.buf.cur.set(cursor.pos);
753
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
            cursor.pos = cursor.parser.buf.cur.get();
758
759
            match cursor.rparen()? {
760
                Some(rest) => Ok((result, rest)),
761
                None => Err(cursor.error("expected `)`")),
762
            }
763
698k
        });
764
698k
        self.buf.depth.set(self.buf.depth.get() - 1);
765
698k
        if res.is_err() {
766
0
            self.buf.cur.set(before);
767
698k
        }
768
698k
        res
769
698k
    }
Unexecuted instantiation: <wast::parser::Parser>::parens::<(), <wast::core::custom::Producers as wast::parser::Parse>::parse::{closure#0}>
Unexecuted instantiation: <wast::parser::Parser>::parens::<(), <wast::core::custom::Dylink0 as wast::parser::Parse>::parse::{closure#0}>
<wast::parser::Parser>::parens::<(), <wast::core::expr::SelectTypes as wast::parser::Parse>::parse::{closure#0}>
Line
Count
Source
744
36
    pub fn parens<T>(self, f: impl FnOnce(Parser<'a>) -> Result<T>) -> Result<T> {
745
36
        self.buf.depth.set(self.buf.depth.get() + 1);
746
36
        let before = self.buf.cur.get();
747
36
        let res = self.step(|cursor| {
748
            let mut cursor = match cursor.lparen()? {
749
                Some(rest) => rest,
750
                None => return Err(cursor.error("expected `(`")),
751
            };
752
            cursor.parser.buf.cur.set(cursor.pos);
753
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
            cursor.pos = cursor.parser.buf.cur.get();
758
759
            match cursor.rparen()? {
760
                Some(rest) => Ok((result, rest)),
761
                None => Err(cursor.error("expected `)`")),
762
            }
763
36
        });
764
36
        self.buf.depth.set(self.buf.depth.get() - 1);
765
36
        if res.is_err() {
766
0
            self.buf.cur.set(before);
767
36
        }
768
36
        res
769
36
    }
<wast::parser::Parser>::parens::<(), <wast::core::types::StructType as wast::parser::Parse>::parse::{closure#0}>
Line
Count
Source
744
570k
    pub fn parens<T>(self, f: impl FnOnce(Parser<'a>) -> Result<T>) -> Result<T> {
745
570k
        self.buf.depth.set(self.buf.depth.get() + 1);
746
570k
        let before = self.buf.cur.get();
747
570k
        let res = self.step(|cursor| {
748
            let mut cursor = match cursor.lparen()? {
749
                Some(rest) => rest,
750
                None => return Err(cursor.error("expected `(`")),
751
            };
752
            cursor.parser.buf.cur.set(cursor.pos);
753
            let result = f(cursor.parser)?;
754
755
            // Reset our cursor's state to whatever the current state of the
756
            // parser is.
757
            cursor.pos = cursor.parser.buf.cur.get();
758
759
            match cursor.rparen()? {
760
                Some(rest) => Ok((result, rest)),
761
                None => Err(cursor.error("expected `)`")),
762
            }
763
570k
        });
764
570k
        self.buf.depth.set(self.buf.depth.get() - 1);
765
570k
        if res.is_err() {
766
0
            self.buf.cur.set(before);
767
570k
        }
768
570k
        res
769
570k
    }
770
771
    /// Return the depth of nested parens we've parsed so far.
772
    ///
773
    /// This is a low-level method that is only useful for implementing
774
    /// recursion limits in custom parsers.
775
0
    pub fn parens_depth(&self) -> usize {
776
0
        self.buf.depth.get()
777
0
    }
778
779
    /// Checks that the parser parens depth hasn't exceeded the maximum depth.
780
    #[cfg(feature = "wasm-module")]
781
0
    pub(crate) fn depth_check(&self) -> Result<()> {
782
0
        if self.parens_depth() > MAX_PARENS_DEPTH {
783
0
            Err(self.error("item nesting too deep"))
784
        } else {
785
0
            Ok(())
786
        }
787
0
    }
788
789
134M
    fn cursor(self) -> Cursor<'a> {
790
134M
        Cursor {
791
134M
            parser: self,
792
134M
            pos: self.buf.cur.get(),
793
134M
        }
794
134M
    }
795
796
    /// A low-level parsing method you probably won't use.
797
    ///
798
    /// This is used to implement parsing of the most primitive types in the
799
    /// [`core`](crate::core) module. You probably don't want to use this, but
800
    /// probably want to use something like [`Parser::parse`] or
801
    /// [`Parser::parens`].
802
43.7M
    pub fn step<F, T>(self, f: F) -> Result<T>
803
43.7M
    where
804
43.7M
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
43.7M
    {
806
43.7M
        let (result, cursor) = f(self.cursor())?;
807
43.7M
        self.buf.cur.set(cursor.pos);
808
43.7M
        Ok(result)
809
43.7M
    }
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::parser::Parser>::parens<alloc::vec::Vec<wast::core::memory::DataVal>, <wast::core::memory::Memory as wast::parser::Parse>::parse::{closure#0}>::{closure#0}, alloc::vec::Vec<wast::core::memory::DataVal>>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::parser::Parser>::parens<wast::wat::Wat, wast::wast::parse_wat>::{closure#0}, wast::wat::Wat>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::parser::Parser>::parens<wast::wast::WastInvoke, <wast::wast::WastDirective as wast::parser::Parse>::parse::{closure#5}>::{closure#0}, wast::wast::WastInvoke>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::parser::Parser>::parens<wast::wast::WastExecute, <wast::wast::WastDirective as wast::parser::Parse>::parse::{closure#2}>::{closure#0}, wast::wast::WastExecute>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::parser::Parser>::parens<wast::wast::WastExecute, <wast::wast::WastDirective as wast::parser::Parse>::parse::{closure#3}>::{closure#0}, wast::wast::WastExecute>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::parser::Parser>::parens<wast::wast::WastExecute, <wast::wast::WastDirective as wast::parser::Parse>::parse::{closure#6}>::{closure#0}, wast::wast::WastExecute>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::parser::Parser>::parens<wast::wast::WastExecute, <wast::wast::WastDirective as wast::parser::Parse>::parse::{closure#7}>::{closure#0}, wast::wast::WastExecute>
<wast::parser::Parser>::step::<<wast::parser::Parser>::parens<wast::wast::WastDirective, <wast::wast::Wast as wast::parser::Parse>::parse::{closure#0}::{closure#0}>::{closure#0}, wast::wast::WastDirective>
Line
Count
Source
802
1
    pub fn step<F, T>(self, f: F) -> Result<T>
803
1
    where
804
1
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
1
    {
806
1
        let (result, cursor) = f(self.cursor())?;
807
0
        self.buf.cur.set(cursor.pos);
808
0
        Ok(result)
809
1
    }
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::parser::Parser>::parens<wast::wast::WastDirective, <wast::wast::WastThread as wast::parser::Parse>::parse::{closure#1}>::{closure#0}, wast::wast::WastDirective>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::parser::Parser>::parens<wast::wast::WastArg, <wast::wast::WastInvoke as wast::parser::Parse>::parse::{closure#0}>::{closure#0}, wast::wast::WastArg>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::parser::Parser>::parens<wast::wast::WastRet, <wast::wast::WastDirective as wast::parser::Parse>::parse::{closure#4}>::{closure#0}, wast::wast::WastRet>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::parser::Parser>::parens<wast::wast::QuoteWat, <wast::wast::WastDirective as wast::parser::Parse>::parse::{closure#0}>::{closure#0}, wast::wast::QuoteWat>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::parser::Parser>::parens<wast::wast::QuoteWat, <wast::wast::WastDirective as wast::parser::Parse>::parse::{closure#1}>::{closure#0}, wast::wast::QuoteWat>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::parser::Parser>::parens<wast::token::NameAnnotation, <core::option::Option<wast::token::NameAnnotation> as wast::parser::Parse>::parse::{closure#0}>::{closure#0}, wast::token::NameAnnotation>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::parser::Parser>::parens<wast::token::Id, <wast::wast::WastThread as wast::parser::Parse>::parse::{closure#0}::{closure#0}>::{closure#0}, wast::token::Id>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::parser::Parser>::parens<wast::token::Id, <wast::wast::WastThread as wast::parser::Parse>::parse::{closure#0}>::{closure#0}, wast::token::Id>
<wast::parser::Parser>::step::<<wast::parser::Parser>::parens<wast::token::Index, <wast::core::table::Elem as wast::parser::Parse>::parse::{closure#0}>::{closure#0}, wast::token::Index>
Line
Count
Source
802
7.95k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
7.95k
    where
804
7.95k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
7.95k
    {
806
7.95k
        let (result, cursor) = f(self.cursor())?;
807
7.95k
        self.buf.cur.set(cursor.pos);
808
7.95k
        Ok(result)
809
7.95k
    }
<wast::parser::Parser>::step::<<wast::parser::Parser>::parens<wast::token::Index, <wast::core::memory::Data as wast::parser::Parse>::parse::{closure#0}>::{closure#0}, wast::token::Index>
Line
Count
Source
802
3.49k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
3.49k
    where
804
3.49k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
3.49k
    {
806
3.49k
        let (result, cursor) = f(self.cursor())?;
807
3.49k
        self.buf.cur.set(cursor.pos);
808
3.49k
        Ok(result)
809
3.49k
    }
<wast::parser::Parser>::step::<<wast::parser::Parser>::parens<wast::token::Index, <wast::core::types::TypeUse<wast::core::types::FunctionType> as wast::parser::Parse>::parse::{closure#0}>::{closure#0}, wast::token::Index>
Line
Count
Source
802
170k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
170k
    where
804
170k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
170k
    {
806
170k
        let (result, cursor) = f(self.cursor())?;
807
170k
        self.buf.cur.set(cursor.pos);
808
170k
        Ok(result)
809
170k
    }
<wast::parser::Parser>::step::<<wast::parser::Parser>::parens<wast::token::Index, <wast::core::types::TypeUse<wast::core::types::FunctionTypeNoNames> as wast::parser::Parse>::parse::{closure#0}>::{closure#0}, wast::token::Index>
Line
Count
Source
802
55.1k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
55.1k
    where
804
55.1k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
55.1k
    {
806
55.1k
        let (result, cursor) = f(self.cursor())?;
807
55.1k
        self.buf.cur.set(cursor.pos);
808
55.1k
        Ok(result)
809
55.1k
    }
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::parser::Parser>::parens<wast::component::Component, <wast::wat::Wat as wast::parser::Parse>::parse::{closure#0}::{closure#1}>::{closure#0}, wast::component::Component>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::parser::Parser>::parens<wast::core::expr::Expression, wast::core::table::parse_expr_or_single_instr<wast::kw::item>::{closure#0}>::{closure#0}, wast::core::expr::Expression>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::parser::Parser>::parens<wast::core::expr::Expression, wast::core::table::parse_expr_or_single_instr<wast::kw::offset>::{closure#0}>::{closure#0}, wast::core::expr::Expression>
<wast::parser::Parser>::step::<<wast::parser::Parser>::parens<wast::core::expr::Expression, <wast::core::memory::Data as wast::parser::Parse>::parse::{closure#1}>::{closure#0}, wast::core::expr::Expression>
Line
Count
Source
802
4.75k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
4.75k
    where
804
4.75k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
4.75k
    {
806
4.75k
        let (result, cursor) = f(self.cursor())?;
807
4.73k
        self.buf.cur.set(cursor.pos);
808
4.73k
        Ok(result)
809
4.75k
    }
<wast::parser::Parser>::step::<<wast::parser::Parser>::parens<wast::core::expr::TryTableCatch, <wast::core::expr::TryTable as wast::parser::Parse>::parse::{closure#0}>::{closure#0}, wast::core::expr::TryTableCatch>
Line
Count
Source
802
241k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
241k
    where
804
241k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
241k
    {
806
241k
        let (result, cursor) = f(self.cursor())?;
807
241k
        self.buf.cur.set(cursor.pos);
808
241k
        Ok(result)
809
241k
    }
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::parser::Parser>::parens<wast::core::expr::Handle, <wast::core::expr::ResumeTable as wast::parser::Parse>::parse::{closure#0}>::{closure#0}, wast::core::expr::Handle>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::parser::Parser>::parens<wast::core::wast::WastRetCore, wast::core::wast::RETS::{closure#15}::{closure#0}>::{closure#0}, wast::core::wast::WastRetCore>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::parser::Parser>::parens<wast::core::table::ElemPayload, <wast::core::table::Table as wast::parser::Parse>::parse::{closure#0}>::{closure#0}, wast::core::table::ElemPayload>
<wast::parser::Parser>::step::<<wast::parser::Parser>::parens<wast::core::types::GlobalType, <wast::core::types::GlobalType as wast::parser::Parse>::parse::{closure#0}>::{closure#0}, wast::core::types::GlobalType>
Line
Count
Source
802
57.4k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
57.4k
    where
804
57.4k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
57.4k
    {
806
57.4k
        let (result, cursor) = f(self.cursor())?;
807
57.4k
        self.buf.cur.set(cursor.pos);
808
57.4k
        Ok(result)
809
57.4k
    }
<wast::parser::Parser>::step::<<wast::parser::Parser>::parens<wast::core::types::StorageType, <wast::core::types::StructField>::parse::{closure#0}>::{closure#0}, wast::core::types::StorageType>
Line
Count
Source
802
398k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
398k
    where
804
398k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
398k
    {
806
398k
        let (result, cursor) = f(self.cursor())?;
807
398k
        self.buf.cur.set(cursor.pos);
808
398k
        Ok(result)
809
398k
    }
<wast::parser::Parser>::step::<<wast::parser::Parser>::parens<wast::core::types::StorageType, <wast::core::types::ArrayType as wast::parser::Parse>::parse::{closure#0}>::{closure#0}, wast::core::types::StorageType>
Line
Count
Source
802
240k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
240k
    where
804
240k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
240k
    {
806
240k
        let (result, cursor) = f(self.cursor())?;
807
240k
        self.buf.cur.set(cursor.pos);
808
240k
        Ok(result)
809
240k
    }
<wast::parser::Parser>::step::<<wast::parser::Parser>::parens<wast::core::types::Type, <wast::core::types::Rec as wast::parser::Parse>::parse::{closure#0}>::{closure#0}, wast::core::types::Type>
Line
Count
Source
802
469k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
469k
    where
804
469k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
469k
    {
806
469k
        let (result, cursor) = f(self.cursor())?;
807
469k
        self.buf.cur.set(cursor.pos);
808
469k
        Ok(result)
809
469k
    }
<wast::parser::Parser>::step::<<wast::parser::Parser>::parens<wast::core::types::RefType, <wast::core::types::RefType as wast::parser::Parse>::parse::{closure#0}>::{closure#0}, wast::core::types::RefType>
Line
Count
Source
802
313k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
313k
    where
804
313k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
313k
    {
806
313k
        let (result, cursor) = f(self.cursor())?;
807
313k
        self.buf.cur.set(cursor.pos);
808
313k
        Ok(result)
809
313k
    }
<wast::parser::Parser>::step::<<wast::parser::Parser>::parens<wast::core::types::TypeDef, <wast::core::types::Type as wast::parser::Parse>::parse::{closure#0}>::{closure#0}, wast::core::types::TypeDef>
Line
Count
Source
802
495k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
495k
    where
804
495k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
495k
    {
806
495k
        let (result, cursor) = f(self.cursor())?;
807
495k
        self.buf.cur.set(cursor.pos);
808
495k
        Ok(result)
809
495k
    }
<wast::parser::Parser>::step::<<wast::parser::Parser>::parens<wast::core::types::HeapType, <wast::core::types::HeapType as wast::parser::Parse>::parse::{closure#0}>::{closure#0}, wast::core::types::HeapType>
Line
Count
Source
802
47.3k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
47.3k
    where
804
47.3k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
47.3k
    {
806
47.3k
        let (result, cursor) = f(self.cursor())?;
807
47.3k
        self.buf.cur.set(cursor.pos);
808
47.3k
        Ok(result)
809
47.3k
    }
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::parser::Parser>::parens<wast::core::custom::CustomPlace, <wast::core::custom::RawCustomSection as wast::parser::Parse>::parse::{closure#0}>::{closure#0}, wast::core::custom::CustomPlace>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::parser::Parser>::parens<wast::core::import::InlineImport, <wast::core::import::InlineImport as wast::parser::Parse>::parse::{closure#0}>::{closure#0}, wast::core::import::InlineImport>
<wast::parser::Parser>::step::<<wast::parser::Parser>::parens<wast::core::import::ItemSig, <wast::core::import::Import as wast::parser::Parse>::parse::{closure#0}>::{closure#0}, wast::core::import::ItemSig>
Line
Count
Source
802
76.4k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
76.4k
    where
804
76.4k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
76.4k
    {
806
76.4k
        let (result, cursor) = f(self.cursor())?;
807
76.4k
        self.buf.cur.set(cursor.pos);
808
76.4k
        Ok(result)
809
76.4k
    }
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::parser::Parser>::parens<wast::core::import::ItemSig, <wast::core::types::ExportType as wast::parser::Parse>::parse::{closure#0}>::{closure#0}, wast::core::import::ItemSig>
<wast::parser::Parser>::step::<<wast::parser::Parser>::parens<wast::core::memory::DataVal, <wast::core::memory::DataVal as wast::parser::Parse>::parse::{closure#0}>::{closure#0}, wast::core::memory::DataVal>
Line
Count
Source
802
4
    pub fn step<F, T>(self, f: F) -> Result<T>
803
4
    where
804
4
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
4
    {
806
4
        let (result, cursor) = f(self.cursor())?;
807
0
        self.buf.cur.set(cursor.pos);
808
0
        Ok(result)
809
4
    }
<wast::parser::Parser>::step::<<wast::parser::Parser>::parens<wast::core::module::ModuleField, <wast::core::module::ModuleField as wast::parser::Parse>::parse>::{closure#0}, wast::core::module::ModuleField>
Line
Count
Source
802
547k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
547k
    where
804
547k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
547k
    {
806
547k
        let (result, cursor) = f(self.cursor())?;
807
546k
        self.buf.cur.set(cursor.pos);
808
546k
        Ok(result)
809
547k
    }
<wast::parser::Parser>::step::<<wast::parser::Parser>::parens<wast::core::module::Module, <wast::wat::Wat as wast::parser::Parse>::parse::{closure#0}::{closure#0}>::{closure#0}, wast::core::module::Module>
Line
Count
Source
802
11.3k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
11.3k
    where
804
11.3k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
11.3k
    {
806
11.3k
        let (result, cursor) = f(self.cursor())?;
807
11.3k
        self.buf.cur.set(cursor.pos);
808
11.3k
        Ok(result)
809
11.3k
    }
<wast::parser::Parser>::step::<<wast::parser::Parser>::parens<&str, <wast::core::export::InlineExport as wast::parser::Parse>::parse::{closure#0}>::{closure#0}, &str>
Line
Count
Source
802
62.8k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
62.8k
    where
804
62.8k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
62.8k
    {
806
62.8k
        let (result, cursor) = f(self.cursor())?;
807
62.8k
        self.buf.cur.set(cursor.pos);
808
62.8k
        Ok(result)
809
62.8k
    }
<wast::parser::Parser>::step::<<wast::parser::Parser>::parens<(wast::core::export::ExportKind, wast::token::Index), <wast::core::export::Export as wast::parser::Parse>::parse::{closure#0}>::{closure#0}, (wast::core::export::ExportKind, wast::token::Index)>
Line
Count
Source
802
35.3k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
35.3k
    where
804
35.3k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
35.3k
    {
806
35.3k
        let (result, cursor) = f(self.cursor())?;
807
35.3k
        self.buf.cur.set(cursor.pos);
808
35.3k
        Ok(result)
809
35.3k
    }
<wast::parser::Parser>::step::<<wast::parser::Parser>::parens<(bool, wast::core::types::InnerTypeKind), <wast::core::types::TypeDef as wast::parser::Parse>::parse::{closure#0}::{closure#0}>::{closure#0}, (bool, wast::core::types::InnerTypeKind)>
Line
Count
Source
802
55.5k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
55.5k
    where
804
55.5k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
55.5k
    {
806
55.5k
        let (result, cursor) = f(self.cursor())?;
807
55.5k
        self.buf.cur.set(cursor.pos);
808
55.5k
        Ok(result)
809
55.5k
    }
<wast::parser::Parser>::step::<<wast::parser::Parser>::parens<(bool, wast::core::types::InnerTypeKind), <wast::core::types::TypeDef as wast::parser::Parse>::parse::{closure#0}>::{closure#0}, (bool, wast::core::types::InnerTypeKind)>
Line
Count
Source
802
158k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
158k
    where
804
158k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
158k
    {
806
158k
        let (result, cursor) = f(self.cursor())?;
807
158k
        self.buf.cur.set(cursor.pos);
808
158k
        Ok(result)
809
158k
    }
<wast::parser::Parser>::step::<<wast::parser::Parser>::parens<u32, wast::core::types::page_size::{closure#0}>::{closure#0}, u32>
Line
Count
Source
802
16.9k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
16.9k
    where
804
16.9k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
16.9k
    {
806
16.9k
        let (result, cursor) = f(self.cursor())?;
807
16.9k
        self.buf.cur.set(cursor.pos);
808
16.9k
        Ok(result)
809
16.9k
    }
<wast::parser::Parser>::step::<<wast::parser::Parser>::parens<(), <wast::core::func::Local>::parse_remainder::{closure#0}>::{closure#0}, ()>
Line
Count
Source
802
21.7k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
21.7k
    where
804
21.7k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
21.7k
    {
806
21.7k
        let (result, cursor) = f(self.cursor())?;
807
21.7k
        self.buf.cur.set(cursor.pos);
808
21.7k
        Ok(result)
809
21.7k
    }
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::parser::Parser>::parens<(), <wast::core::custom::Dylink0>::parse_next::{closure#0}>::{closure#0}, ()>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::parser::Parser>::parens<(), <wast::core::custom::Dylink0>::parse_next::{closure#1}>::{closure#0}, ()>
<wast::parser::Parser>::step::<<wast::parser::Parser>::parens<(), <wast::core::types::FunctionType>::finish_parse::{closure#0}>::{closure#0}, ()>
Line
Count
Source
802
698k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
698k
    where
804
698k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
698k
    {
806
698k
        let (result, cursor) = f(self.cursor())?;
807
698k
        self.buf.cur.set(cursor.pos);
808
698k
        Ok(result)
809
698k
    }
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::parser::Parser>::parens<(), <wast::core::custom::Producers as wast::parser::Parse>::parse::{closure#0}>::{closure#0}, ()>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::parser::Parser>::parens<(), <wast::core::custom::Dylink0 as wast::parser::Parse>::parse::{closure#0}>::{closure#0}, ()>
<wast::parser::Parser>::step::<<wast::parser::Parser>::parens<(), <wast::core::expr::SelectTypes as wast::parser::Parse>::parse::{closure#0}>::{closure#0}, ()>
Line
Count
Source
802
36
    pub fn step<F, T>(self, f: F) -> Result<T>
803
36
    where
804
36
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
36
    {
806
36
        let (result, cursor) = f(self.cursor())?;
807
36
        self.buf.cur.set(cursor.pos);
808
36
        Ok(result)
809
36
    }
<wast::parser::Parser>::step::<<wast::parser::Parser>::parens<(), <wast::core::types::StructType as wast::parser::Parse>::parse::{closure#0}>::{closure#0}, ()>
Line
Count
Source
802
570k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
570k
    where
804
570k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
570k
    {
806
570k
        let (result, cursor) = f(self.cursor())?;
807
570k
        self.buf.cur.set(cursor.pos);
808
570k
        Ok(result)
809
570k
    }
<wast::parser::Parser>::step::<<wast::core::expr::MemArg>::parse::parse_field<u32, <wast::core::expr::MemArg>::parse::parse_u32::{closure#0}>::{closure#0}, core::option::Option<u32>>
Line
Count
Source
802
95.0k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
95.0k
    where
804
95.0k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
95.0k
    {
806
95.0k
        let (result, cursor) = f(self.cursor())?;
807
95.0k
        self.buf.cur.set(cursor.pos);
808
95.0k
        Ok(result)
809
95.0k
    }
<wast::parser::Parser>::step::<<wast::core::expr::MemArg>::parse::parse_field<u64, <wast::core::expr::MemArg>::parse::parse_u64::{closure#0}>::{closure#0}, core::option::Option<u64>>
Line
Count
Source
802
95.0k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
95.0k
    where
804
95.0k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
95.0k
    {
806
95.0k
        let (result, cursor) = f(self.cursor())?;
807
95.0k
        self.buf.cur.set(cursor.pos);
808
95.0k
        Ok(result)
809
95.0k
    }
<wast::parser::Parser>::step::<<wast::core::expr::ExpressionParser>::paren::{closure#0}, wast::core::expr::Paren>
Line
Count
Source
802
12.1M
    pub fn step<F, T>(self, f: F) -> Result<T>
803
12.1M
    where
804
12.1M
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
12.1M
    {
806
12.1M
        let (result, cursor) = f(self.cursor())?;
807
12.1M
        self.buf.cur.set(cursor.pos);
808
12.1M
        Ok(result)
809
12.1M
    }
<wast::parser::Parser>::step::<<wast::core::expr::LoadOrStoreLane>::parse::{closure#0}, bool>
Line
Count
Source
802
338
    pub fn step<F, T>(self, f: F) -> Result<T>
803
338
    where
804
338
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
338
    {
806
338
        let (result, cursor) = f(self.cursor())?;
807
338
        self.buf.cur.set(cursor.pos);
808
338
        Ok(result)
809
338
    }
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::annotation::custom as wast::parser::Parse>::parse::{closure#0}, wast::annotation::custom>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::after as wast::parser::Parse>::parse::{closure#0}, wast::kw::after>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::core::wast::WastArgCore as wast::parser::Parse>::parse::{closure#0}, for<'a> fn(wast::parser::Parser<'a>) -> core::result::Result<wast::core::wast::WastArgCore<'a>, wast::error::Error>>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::core::custom::parse_sym_flags::flag as wast::parser::Parse>::parse::{closure#0}, wast::core::custom::parse_sym_flags::flag>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::core::wast::WastRetCore as wast::parser::Parse>::parse::{closure#0}, for<'a> fn(wast::parser::Parser<'a>) -> core::result::Result<wast::core::wast::WastRetCore<'a>, wast::error::Error>>
Unexecuted instantiation: <wast::parser::Parser>::step::<<(i16, wast::token::Span) as wast::parser::Parse>::parse::{closure#0}, (i16, wast::token::Span)>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::assert_unlinkable as wast::parser::Parse>::parse::{closure#0}, wast::kw::assert_unlinkable>
<wast::parser::Parser>::step::<<(i32, wast::token::Span) as wast::parser::Parse>::parse::{closure#0}, (i32, wast::token::Span)>
Line
Count
Source
802
590k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
590k
    where
804
590k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
590k
    {
806
590k
        let (result, cursor) = f(self.cursor())?;
807
590k
        self.buf.cur.set(cursor.pos);
808
590k
        Ok(result)
809
590k
    }
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::assert_suspension as wast::parser::Parse>::parse::{closure#0}, wast::kw::assert_suspension>
<wast::parser::Parser>::step::<<(i64, wast::token::Span) as wast::parser::Parse>::parse::{closure#0}, (i64, wast::token::Span)>
Line
Count
Source
802
1.06M
    pub fn step<F, T>(self, f: F) -> Result<T>
803
1.06M
    where
804
1.06M
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
1.06M
    {
806
1.06M
        let (result, cursor) = f(self.cursor())?;
807
1.06M
        self.buf.cur.set(cursor.pos);
808
1.06M
        Ok(result)
809
1.06M
    }
<wast::parser::Parser>::step::<<wast::token::F32 as wast::parser::Parse>::parse::{closure#0}, wast::token::F32>
Line
Count
Source
802
176k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
176k
    where
804
176k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
176k
    {
806
176k
        let (result, cursor) = f(self.cursor())?;
807
176k
        self.buf.cur.set(cursor.pos);
808
176k
        Ok(result)
809
176k
    }
<wast::parser::Parser>::step::<<wast::token::F64 as wast::parser::Parse>::parse::{closure#0}, wast::token::F64>
Line
Count
Source
802
568k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
568k
    where
804
568k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
568k
    {
806
568k
        let (result, cursor) = f(self.cursor())?;
807
568k
        self.buf.cur.set(cursor.pos);
808
568k
        Ok(result)
809
568k
    }
<wast::parser::Parser>::step::<<wast::kw::catch_ref as wast::parser::Parse>::parse::{closure#0}, wast::kw::catch_ref>
Line
Count
Source
802
6
    pub fn step<F, T>(self, f: F) -> Result<T>
803
6
    where
804
6
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
6
    {
806
6
        let (result, cursor) = f(self.cursor())?;
807
6
        self.buf.cur.set(cursor.pos);
808
6
        Ok(result)
809
6
    }
<wast::parser::Parser>::step::<<wast::kw::catch_all as wast::parser::Parse>::parse::{closure#0}, wast::kw::catch_all>
Line
Count
Source
802
212k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
212k
    where
804
212k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
212k
    {
806
212k
        let (result, cursor) = f(self.cursor())?;
807
212k
        self.buf.cur.set(cursor.pos);
808
212k
        Ok(result)
809
212k
    }
<wast::parser::Parser>::step::<<wast::kw::catch_all_ref as wast::parser::Parse>::parse::{closure#0}, wast::kw::catch_all_ref>
Line
Count
Source
802
546
    pub fn step<F, T>(self, f: F) -> Result<T>
803
546
    where
804
546
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
546
    {
806
546
        let (result, cursor) = f(self.cursor())?;
807
546
        self.buf.cur.set(cursor.pos);
808
546
        Ok(result)
809
546
    }
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::code as wast::parser::Parse>::parse::{closure#0}, wast::kw::code>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::cont as wast::parser::Parse>::parse::{closure#0}, wast::kw::cont>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::contref as wast::parser::Parse>::parse::{closure#0}, wast::kw::contref>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::annotation::name as wast::parser::Parse>::parse::{closure#0}, wast::annotation::name>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::before as wast::parser::Parse>::parse::{closure#0}, wast::kw::before>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::binary as wast::parser::Parse>::parse::{closure#0}, wast::kw::binary>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::block as wast::parser::Parse>::parse::{closure#0}, wast::kw::block>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::borrow as wast::parser::Parse>::parse::{closure#0}, wast::kw::borrow>
<wast::parser::Parser>::step::<<wast::kw::catch as wast::parser::Parse>::parse::{closure#0}, wast::kw::catch>
Line
Count
Source
802
28.6k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
28.6k
    where
804
28.6k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
28.6k
    {
806
28.6k
        let (result, cursor) = f(self.cursor())?;
807
28.6k
        self.buf.cur.set(cursor.pos);
808
28.6k
        Ok(result)
809
28.6k
    }
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::component as wast::parser::Parse>::parse::{closure#0}, wast::kw::component>
<wast::parser::Parser>::step::<<wast::kw::data as wast::parser::Parse>::parse::{closure#0}, wast::kw::data>
Line
Count
Source
802
16.4k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
16.4k
    where
804
16.4k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
16.4k
    {
806
16.4k
        let (result, cursor) = f(self.cursor())?;
807
16.4k
        self.buf.cur.set(cursor.pos);
808
16.4k
        Ok(result)
809
16.4k
    }
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::end as wast::parser::Parse>::parse::{closure#0}, wast::kw::end>
<wast::parser::Parser>::step::<<wast::kw::tag as wast::parser::Parse>::parse::{closure#0}, wast::kw::tag>
Line
Count
Source
802
28.8k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
28.8k
    where
804
28.8k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
28.8k
    {
806
28.8k
        let (result, cursor) = f(self.cursor())?;
807
28.8k
        self.buf.cur.set(cursor.pos);
808
28.8k
        Ok(result)
809
28.8k
    }
<wast::parser::Parser>::step::<<wast::kw::exn as wast::parser::Parse>::parse::{closure#0}, wast::kw::exn>
Line
Count
Source
802
11.8k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
11.8k
    where
804
11.8k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
11.8k
    {
806
11.8k
        let (result, cursor) = f(self.cursor())?;
807
11.8k
        self.buf.cur.set(cursor.pos);
808
11.8k
        Ok(result)
809
11.8k
    }
<wast::parser::Parser>::step::<<wast::kw::exnref as wast::parser::Parse>::parse::{closure#0}, wast::kw::exnref>
Line
Count
Source
802
23.2k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
23.2k
    where
804
23.2k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
23.2k
    {
806
23.2k
        let (result, cursor) = f(self.cursor())?;
807
23.2k
        self.buf.cur.set(cursor.pos);
808
23.2k
        Ok(result)
809
23.2k
    }
<wast::parser::Parser>::step::<<wast::kw::export as wast::parser::Parse>::parse::{closure#0}, wast::kw::export>
Line
Count
Source
802
98.1k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
98.1k
    where
804
98.1k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
98.1k
    {
806
98.1k
        let (result, cursor) = f(self.cursor())?;
807
98.1k
        self.buf.cur.set(cursor.pos);
808
98.1k
        Ok(result)
809
98.1k
    }
<wast::parser::Parser>::step::<<wast::kw::declare as wast::parser::Parse>::parse::{closure#0}, wast::kw::declare>
Line
Count
Source
802
3.71k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
3.71k
    where
804
3.71k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
3.71k
    {
806
3.71k
        let (result, cursor) = f(self.cursor())?;
807
3.71k
        self.buf.cur.set(cursor.pos);
808
3.71k
        Ok(result)
809
3.71k
    }
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::delegate as wast::parser::Parse>::parse::{closure#0}, wast::kw::delegate>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::do as wast::parser::Parse>::parse::{closure#0}, wast::kw::do>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::dtor as wast::parser::Parse>::parse::{closure#0}, wast::kw::dtor>
<wast::parser::Parser>::step::<<wast::kw::elem as wast::parser::Parse>::parse::{closure#0}, wast::kw::elem>
Line
Count
Source
802
15.9k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
15.9k
    where
804
15.9k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
15.9k
    {
806
15.9k
        let (result, cursor) = f(self.cursor())?;
807
15.9k
        self.buf.cur.set(cursor.pos);
808
15.9k
        Ok(result)
809
15.9k
    }
<wast::parser::Parser>::step::<<wast::kw::extern as wast::parser::Parse>::parse::{closure#0}, wast::kw::extern>
Line
Count
Source
802
9.44k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
9.44k
    where
804
9.44k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
9.44k
    {
806
9.44k
        let (result, cursor) = f(self.cursor())?;
807
9.44k
        self.buf.cur.set(cursor.pos);
808
9.44k
        Ok(result)
809
9.44k
    }
<wast::parser::Parser>::step::<<wast::kw::externref as wast::parser::Parse>::parse::{closure#0}, wast::kw::externref>
Line
Count
Source
802
27.8k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
27.8k
    where
804
27.8k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
27.8k
    {
806
27.8k
        let (result, cursor) = f(self.cursor())?;
807
27.8k
        self.buf.cur.set(cursor.pos);
808
27.8k
        Ok(result)
809
27.8k
    }
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::f64x2 as wast::parser::Parse>::parse::{closure#0}, wast::kw::f64x2>
<wast::parser::Parser>::step::<<wast::kw::field as wast::parser::Parse>::parse::{closure#0}, wast::kw::field>
Line
Count
Source
802
570k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
570k
    where
804
570k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
570k
    {
806
570k
        let (result, cursor) = f(self.cursor())?;
807
570k
        self.buf.cur.set(cursor.pos);
808
570k
        Ok(result)
809
570k
    }
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::first as wast::parser::Parse>::parse::{closure#0}, wast::kw::first>
<wast::parser::Parser>::step::<<wast::kw::func as wast::parser::Parse>::parse::{closure#0}, wast::kw::func>
Line
Count
Source
802
377k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
377k
    where
804
377k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
377k
    {
806
377k
        let (result, cursor) = f(self.cursor())?;
807
377k
        self.buf.cur.set(cursor.pos);
808
377k
        Ok(result)
809
377k
    }
<wast::parser::Parser>::step::<<wast::kw::funcref as wast::parser::Parse>::parse::{closure#0}, wast::kw::funcref>
Line
Count
Source
802
30.5k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
30.5k
    where
804
30.5k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
30.5k
    {
806
30.5k
        let (result, cursor) = f(self.cursor())?;
807
30.5k
        self.buf.cur.set(cursor.pos);
808
30.5k
        Ok(result)
809
30.5k
    }
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::alias as wast::parser::Parse>::parse::{closure#0}, wast::kw::alias>
<wast::parser::Parser>::step::<<wast::token::Id as wast::parser::Parse>::parse::{closure#0}, wast::token::Id>
Line
Count
Source
802
6
    pub fn step<F, T>(self, f: F) -> Result<T>
803
6
    where
804
6
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
6
    {
806
6
        let (result, cursor) = f(self.cursor())?;
807
6
        self.buf.cur.set(cursor.pos);
808
6
        Ok(result)
809
6
    }
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::core::custom::parse_sym_flags::flag as wast::parser::Parse>::parse::{closure#0}, wast::core::custom::parse_sym_flags::flag>
<wast::parser::Parser>::step::<<wast::kw::eq as wast::parser::Parse>::parse::{closure#0}, wast::kw::eq>
Line
Count
Source
802
6.65k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
6.65k
    where
804
6.65k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
6.65k
    {
806
6.65k
        let (result, cursor) = f(self.cursor())?;
807
6.65k
        self.buf.cur.set(cursor.pos);
808
6.65k
        Ok(result)
809
6.65k
    }
<wast::parser::Parser>::step::<<wast::kw::eqref as wast::parser::Parse>::parse::{closure#0}, wast::kw::eqref>
Line
Count
Source
802
7.82k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
7.82k
    where
804
7.82k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
7.82k
    {
806
7.82k
        let (result, cursor) = f(self.cursor())?;
807
7.82k
        self.buf.cur.set(cursor.pos);
808
7.82k
        Ok(result)
809
7.82k
    }
<wast::parser::Parser>::step::<<wast::kw::f32 as wast::parser::Parse>::parse::{closure#0}, wast::kw::f32>
Line
Count
Source
802
504k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
504k
    where
804
504k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
504k
    {
806
504k
        let (result, cursor) = f(self.cursor())?;
807
504k
        self.buf.cur.set(cursor.pos);
808
504k
        Ok(result)
809
504k
    }
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::f32x4 as wast::parser::Parse>::parse::{closure#0}, wast::kw::f32x4>
<wast::parser::Parser>::step::<<wast::kw::f64 as wast::parser::Parse>::parse::{closure#0}, wast::kw::f64>
Line
Count
Source
802
1.43M
    pub fn step<F, T>(self, f: F) -> Result<T>
803
1.43M
    where
804
1.43M
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
1.43M
    {
806
1.43M
        let (result, cursor) = f(self.cursor())?;
807
1.43M
        self.buf.cur.set(cursor.pos);
808
1.43M
        Ok(result)
809
1.43M
    }
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::get as wast::parser::Parse>::parse::{closure#0}, wast::kw::get>
<wast::parser::Parser>::step::<<wast::kw::global as wast::parser::Parse>::parse::{closure#0}, wast::kw::global>
Line
Count
Source
802
77.6k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
77.6k
    where
804
77.6k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
77.6k
    {
806
77.6k
        let (result, cursor) = f(self.cursor())?;
807
77.6k
        self.buf.cur.set(cursor.pos);
808
77.6k
        Ok(result)
809
77.6k
    }
<wast::parser::Parser>::step::<<wast::kw::i64 as wast::parser::Parse>::parse::{closure#0}, wast::kw::i64>
Line
Count
Source
802
3.13M
    pub fn step<F, T>(self, f: F) -> Result<T>
803
3.13M
    where
804
3.13M
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
3.13M
    {
806
3.13M
        let (result, cursor) = f(self.cursor())?;
807
3.13M
        self.buf.cur.set(cursor.pos);
808
3.13M
        Ok(result)
809
3.13M
    }
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::i64x2 as wast::parser::Parse>::parse::{closure#0}, wast::kw::i64x2>
<wast::parser::Parser>::step::<<wast::kw::i8 as wast::parser::Parse>::parse::{closure#0}, wast::kw::i8>
Line
Count
Source
802
522k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
522k
    where
804
522k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
522k
    {
806
522k
        let (result, cursor) = f(self.cursor())?;
807
522k
        self.buf.cur.set(cursor.pos);
808
522k
        Ok(result)
809
522k
    }
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::i8x16 as wast::parser::Parse>::parse::{closure#0}, wast::kw::i8x16>
<wast::parser::Parser>::step::<<wast::kw::import as wast::parser::Parse>::parse::{closure#0}, wast::kw::import>
Line
Count
Source
802
76.4k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
76.4k
    where
804
76.4k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
76.4k
    {
806
76.4k
        let (result, cursor) = f(self.cursor())?;
807
76.4k
        self.buf.cur.set(cursor.pos);
808
76.4k
        Ok(result)
809
76.4k
    }
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::annotation::producers as wast::parser::Parse>::parse::{closure#0}, wast::annotation::producers>
<wast::parser::Parser>::step::<<wast::kw::i16 as wast::parser::Parse>::parse::{closure#0}, wast::kw::i16>
Line
Count
Source
802
118k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
118k
    where
804
118k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
118k
    {
806
118k
        let (result, cursor) = f(self.cursor())?;
807
118k
        self.buf.cur.set(cursor.pos);
808
118k
        Ok(result)
809
118k
    }
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::i16x8 as wast::parser::Parse>::parse::{closure#0}, wast::kw::i16x8>
<wast::parser::Parser>::step::<<wast::kw::i31 as wast::parser::Parse>::parse::{closure#0}, wast::kw::i31>
Line
Count
Source
802
4.87k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
4.87k
    where
804
4.87k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
4.87k
    {
806
4.87k
        let (result, cursor) = f(self.cursor())?;
807
4.87k
        self.buf.cur.set(cursor.pos);
808
4.87k
        Ok(result)
809
4.87k
    }
<wast::parser::Parser>::step::<<wast::kw::i31ref as wast::parser::Parse>::parse::{closure#0}, wast::kw::i31ref>
Line
Count
Source
802
32.3k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
32.3k
    where
804
32.3k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
32.3k
    {
806
32.3k
        let (result, cursor) = f(self.cursor())?;
807
32.3k
        self.buf.cur.set(cursor.pos);
808
32.3k
        Ok(result)
809
32.3k
    }
<wast::parser::Parser>::step::<<wast::kw::i32 as wast::parser::Parse>::parse::{closure#0}, wast::kw::i32>
Line
Count
Source
802
573k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
573k
    where
804
573k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
573k
    {
806
573k
        let (result, cursor) = f(self.cursor())?;
807
573k
        self.buf.cur.set(cursor.pos);
808
573k
        Ok(result)
809
573k
    }
<wast::parser::Parser>::step::<<wast::kw::i32x4 as wast::parser::Parse>::parse::{closure#0}, wast::kw::i32x4>
Line
Count
Source
802
84.2k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
84.2k
    where
804
84.2k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
84.2k
    {
806
84.2k
        let (result, cursor) = f(self.cursor())?;
807
84.2k
        self.buf.cur.set(cursor.pos);
808
84.2k
        Ok(result)
809
84.2k
    }
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::instance as wast::parser::Parse>::parse::{closure#0}, wast::kw::instance>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::instantiate as wast::parser::Parse>::parse::{closure#0}, wast::kw::instantiate>
<wast::parser::Parser>::step::<<wast::kw::memory as wast::parser::Parse>::parse::{closure#0}, wast::kw::memory>
Line
Count
Source
802
34.0k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
34.0k
    where
804
34.0k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
34.0k
    {
806
34.0k
        let (result, cursor) = f(self.cursor())?;
807
34.0k
        self.buf.cur.set(cursor.pos);
808
34.0k
        Ok(result)
809
34.0k
    }
<wast::parser::Parser>::step::<<wast::kw::module as wast::parser::Parse>::parse::{closure#0}, wast::kw::module>
Line
Count
Source
802
11.3k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
11.3k
    where
804
11.3k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
11.3k
    {
806
11.3k
        let (result, cursor) = f(self.cursor())?;
807
11.3k
        self.buf.cur.set(cursor.pos);
808
11.3k
        Ok(result)
809
11.3k
    }
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::modulecode as wast::parser::Parse>::parse::{closure#0}, wast::kw::modulecode>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::nan_arithmetic as wast::parser::Parse>::parse::{closure#0}, wast::kw::nan_arithmetic>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::nan_canonical as wast::parser::Parse>::parse::{closure#0}, wast::kw::nan_canonical>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::interface as wast::parser::Parse>::parse::{closure#0}, wast::kw::interface>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::invoke as wast::parser::Parse>::parse::{closure#0}, wast::kw::invoke>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::item as wast::parser::Parse>::parse::{closure#0}, wast::kw::item>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::last as wast::parser::Parse>::parse::{closure#0}, wast::kw::last>
<wast::parser::Parser>::step::<<wast::kw::local as wast::parser::Parse>::parse::{closure#0}, wast::kw::local>
Line
Count
Source
802
21.7k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
21.7k
    where
804
21.7k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
21.7k
    {
806
21.7k
        let (result, cursor) = f(self.cursor())?;
807
21.7k
        self.buf.cur.set(cursor.pos);
808
21.7k
        Ok(result)
809
21.7k
    }
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::nocont as wast::parser::Parse>::parse::{closure#0}, wast::kw::nocont>
<wast::parser::Parser>::step::<<wast::kw::nofunc as wast::parser::Parse>::parse::{closure#0}, wast::kw::nofunc>
Line
Count
Source
802
33.8k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
33.8k
    where
804
33.8k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
33.8k
    {
806
33.8k
        let (result, cursor) = f(self.cursor())?;
807
33.8k
        self.buf.cur.set(cursor.pos);
808
33.8k
        Ok(result)
809
33.8k
    }
<wast::parser::Parser>::step::<<wast::kw::nullfuncref as wast::parser::Parse>::parse::{closure#0}, wast::kw::nullfuncref>
Line
Count
Source
802
9.17k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
9.17k
    where
804
9.17k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
9.17k
    {
806
9.17k
        let (result, cursor) = f(self.cursor())?;
807
9.17k
        self.buf.cur.set(cursor.pos);
808
9.17k
        Ok(result)
809
9.17k
    }
<wast::parser::Parser>::step::<<wast::kw::nullexternref as wast::parser::Parse>::parse::{closure#0}, wast::kw::nullexternref>
Line
Count
Source
802
13.5k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
13.5k
    where
804
13.5k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
13.5k
    {
806
13.5k
        let (result, cursor) = f(self.cursor())?;
807
13.5k
        self.buf.cur.set(cursor.pos);
808
13.5k
        Ok(result)
809
13.5k
    }
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::nullexnref as wast::parser::Parse>::parse::{closure#0}, wast::kw::nullexnref>
<wast::parser::Parser>::step::<<wast::kw::nullref as wast::parser::Parse>::parse::{closure#0}, wast::kw::nullref>
Line
Count
Source
802
11.0k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
11.0k
    where
804
11.0k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
11.0k
    {
806
11.0k
        let (result, cursor) = f(self.cursor())?;
807
11.0k
        self.buf.cur.set(cursor.pos);
808
11.0k
        Ok(result)
809
11.0k
    }
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::offset as wast::parser::Parse>::parse::{closure#0}, wast::kw::offset>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::on as wast::parser::Parse>::parse::{closure#0}, wast::kw::on>
<wast::parser::Parser>::step::<<wast::kw::noextern as wast::parser::Parse>::parse::{closure#0}, wast::kw::noextern>
Line
Count
Source
802
28.7k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
28.7k
    where
804
28.7k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
28.7k
    {
806
28.7k
        let (result, cursor) = f(self.cursor())?;
807
28.7k
        self.buf.cur.set(cursor.pos);
808
28.7k
        Ok(result)
809
28.7k
    }
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::noexn as wast::parser::Parse>::parse::{closure#0}, wast::kw::noexn>
<wast::parser::Parser>::step::<<wast::kw::none as wast::parser::Parse>::parse::{closure#0}, wast::kw::none>
Line
Count
Source
802
91.5k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
91.5k
    where
804
91.5k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
91.5k
    {
806
91.5k
        let (result, cursor) = f(self.cursor())?;
807
91.5k
        self.buf.cur.set(cursor.pos);
808
91.5k
        Ok(result)
809
91.5k
    }
<wast::parser::Parser>::step::<<wast::kw::null as wast::parser::Parse>::parse::{closure#0}, wast::kw::null>
Line
Count
Source
802
308k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
308k
    where
804
308k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
308k
    {
806
308k
        let (result, cursor) = f(self.cursor())?;
807
308k
        self.buf.cur.set(cursor.pos);
808
308k
        Ok(result)
809
308k
    }
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::nullcontref as wast::parser::Parse>::parse::{closure#0}, wast::kw::nullcontref>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::outer as wast::parser::Parse>::parse::{closure#0}, wast::kw::outer>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::own as wast::parser::Parse>::parse::{closure#0}, wast::kw::own>
<wast::parser::Parser>::step::<<wast::kw::else as wast::parser::Parse>::parse::{closure#0}, wast::kw::else>
Line
Count
Source
802
3.93k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
3.93k
    where
804
3.93k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
3.93k
    {
806
3.93k
        let (result, cursor) = f(self.cursor())?;
807
3.93k
        self.buf.cur.set(cursor.pos);
808
3.93k
        Ok(result)
809
3.93k
    }
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::if as wast::parser::Parse>::parse::{closure#0}, wast::kw::if>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::loop as wast::parser::Parse>::parse::{closure#0}, wast::kw::loop>
<wast::parser::Parser>::step::<<wast::kw::mut as wast::parser::Parse>::parse::{closure#0}, wast::kw::mut>
Line
Count
Source
802
696k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
696k
    where
804
696k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
696k
    {
806
696k
        let (result, cursor) = f(self.cursor())?;
807
696k
        self.buf.cur.set(cursor.pos);
808
696k
        Ok(result)
809
696k
    }
<wast::parser::Parser>::step::<<wast::kw::type as wast::parser::Parse>::parse::{closure#0}, wast::kw::type>
Line
Count
Source
802
721k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
721k
    where
804
721k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
721k
    {
806
721k
        let (result, cursor) = f(self.cursor())?;
807
721k
        self.buf.cur.set(cursor.pos);
808
721k
        Ok(result)
809
721k
    }
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::annotation::dylink_0 as wast::parser::Parse>::parse::{closure#0}, wast::annotation::dylink_0>
<wast::parser::Parser>::step::<<wast::kw::pagesize as wast::parser::Parse>::parse::{closure#0}, wast::kw::pagesize>
Line
Count
Source
802
16.9k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
16.9k
    where
804
16.9k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
16.9k
    {
806
16.9k
        let (result, cursor) = f(self.cursor())?;
807
16.9k
        self.buf.cur.set(cursor.pos);
808
16.9k
        Ok(result)
809
16.9k
    }
<wast::parser::Parser>::step::<<wast::kw::param as wast::parser::Parse>::parse::{closure#0}, wast::kw::param>
Line
Count
Source
802
289k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
289k
    where
804
289k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
289k
    {
806
289k
        let (result, cursor) = f(self.cursor())?;
807
289k
        self.buf.cur.set(cursor.pos);
808
289k
        Ok(result)
809
289k
    }
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::parent as wast::parser::Parse>::parse::{closure#0}, wast::kw::parent>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::passive as wast::parser::Parse>::parse::{closure#0}, wast::kw::passive>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::quote as wast::parser::Parse>::parse::{closure#0}, wast::kw::quote>
<wast::parser::Parser>::step::<<wast::kw::ref as wast::parser::Parse>::parse::{closure#0}, wast::kw::ref>
Line
Count
Source
802
313k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
313k
    where
804
313k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
313k
    {
806
313k
        let (result, cursor) = f(self.cursor())?;
807
313k
        self.buf.cur.set(cursor.pos);
808
313k
        Ok(result)
809
313k
    }
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::ref_func as wast::parser::Parse>::parse::{closure#0}, wast::kw::ref_func>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::resource as wast::parser::Parse>::parse::{closure#0}, wast::kw::resource>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::resource_new as wast::parser::Parse>::parse::{closure#0}, wast::kw::resource_new>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::resource_drop as wast::parser::Parse>::parse::{closure#0}, wast::kw::resource_drop>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::resource_rep as wast::parser::Parse>::parse::{closure#0}, wast::kw::resource_rep>
<wast::parser::Parser>::step::<<wast::kw::result as wast::parser::Parse>::parse::{closure#0}, wast::kw::result>
Line
Count
Source
802
408k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
408k
    where
804
408k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
408k
    {
806
408k
        let (result, cursor) = f(self.cursor())?;
807
408k
        self.buf.cur.set(cursor.pos);
808
408k
        Ok(result)
809
408k
    }
<wast::parser::Parser>::step::<<wast::kw::any as wast::parser::Parse>::parse::{closure#0}, wast::kw::any>
Line
Count
Source
802
2.82k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
2.82k
    where
804
2.82k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
2.82k
    {
806
2.82k
        let (result, cursor) = f(self.cursor())?;
807
2.82k
        self.buf.cur.set(cursor.pos);
808
2.82k
        Ok(result)
809
2.82k
    }
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::core::custom::parse_sym_flags::flag as wast::parser::Parse>::parse::{closure#0}, wast::core::custom::parse_sym_flags::flag>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::ref_null as wast::parser::Parse>::parse::{closure#0}, wast::kw::ref_null>
<wast::parser::Parser>::step::<<wast::kw::register as wast::parser::Parse>::parse::{closure#0}, wast::kw::register>
Line
Count
Source
802
1
    pub fn step<F, T>(self, f: F) -> Result<T>
803
1
    where
804
1
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
1
    {
806
1
        let (result, cursor) = f(self.cursor())?;
807
1
        self.buf.cur.set(cursor.pos);
808
1
        Ok(result)
809
1
    }
<wast::parser::Parser>::step::<<wast::kw::rec as wast::parser::Parse>::parse::{closure#0}, wast::kw::rec>
Line
Count
Source
802
75.7k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
75.7k
    where
804
75.7k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
75.7k
    {
806
75.7k
        let (result, cursor) = f(self.cursor())?;
807
75.7k
        self.buf.cur.set(cursor.pos);
808
75.7k
        Ok(result)
809
75.7k
    }
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::acq_rel as wast::parser::Parse>::parse::{closure#0}, wast::kw::acq_rel>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::rep as wast::parser::Parse>::parse::{closure#0}, wast::kw::rep>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::seq_cst as wast::parser::Parse>::parse::{closure#0}, wast::kw::seq_cst>
<wast::parser::Parser>::step::<<wast::kw::shared as wast::parser::Parse>::parse::{closure#0}, wast::kw::shared>
Line
Count
Source
802
109k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
109k
    where
804
109k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
109k
    {
806
109k
        let (result, cursor) = f(self.cursor())?;
807
109k
        self.buf.cur.set(cursor.pos);
808
109k
        Ok(result)
809
109k
    }
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::try as wast::parser::Parse>::parse::{closure#0}, wast::kw::try>
<wast::parser::Parser>::step::<<wast::kw::v128 as wast::parser::Parse>::parse::{closure#0}, wast::kw::v128>
Line
Count
Source
802
133k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
133k
    where
804
133k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
133k
    {
806
133k
        let (result, cursor) = f(self.cursor())?;
807
133k
        self.buf.cur.set(cursor.pos);
808
133k
        Ok(result)
809
133k
    }
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::value as wast::parser::Parse>::parse::{closure#0}, wast::kw::value>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::s8 as wast::parser::Parse>::parse::{closure#0}, wast::kw::s8>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::s16 as wast::parser::Parse>::parse::{closure#0}, wast::kw::s16>
<wast::parser::Parser>::step::<<wast::kw::start as wast::parser::Parse>::parse::{closure#0}, wast::kw::start>
Line
Count
Source
802
254
    pub fn step<F, T>(self, f: F) -> Result<T>
803
254
    where
804
254
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
254
    {
806
254
        let (result, cursor) = f(self.cursor())?;
807
254
        self.buf.cur.set(cursor.pos);
808
254
        Ok(result)
809
254
    }
<wast::parser::Parser>::step::<<wast::kw::sub as wast::parser::Parse>::parse::{closure#0}, wast::kw::sub>
Line
Count
Source
802
158k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
158k
    where
804
158k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
158k
    {
806
158k
        let (result, cursor) = f(self.cursor())?;
807
158k
        self.buf.cur.set(cursor.pos);
808
158k
        Ok(result)
809
158k
    }
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::switch as wast::parser::Parse>::parse::{closure#0}, wast::kw::switch>
<wast::parser::Parser>::step::<<wast::kw::final as wast::parser::Parse>::parse::{closure#0}, wast::kw::final>
Line
Count
Source
802
18.8k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
18.8k
    where
804
18.8k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
18.8k
    {
806
18.8k
        let (result, cursor) = f(self.cursor())?;
807
18.8k
        self.buf.cur.set(cursor.pos);
808
18.8k
        Ok(result)
809
18.8k
    }
<wast::parser::Parser>::step::<<wast::kw::table as wast::parser::Parse>::parse::{closure#0}, wast::kw::table>
Line
Count
Source
802
48.9k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
48.9k
    where
804
48.9k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
48.9k
    {
806
48.9k
        let (result, cursor) = f(self.cursor())?;
807
48.9k
        self.buf.cur.set(cursor.pos);
808
48.9k
        Ok(result)
809
48.9k
    }
<wast::parser::Parser>::step::<<wast::kw::then as wast::parser::Parse>::parse::{closure#0}, wast::kw::then>
Line
Count
Source
802
29.2k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
29.2k
    where
804
29.2k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
29.2k
    {
806
29.2k
        let (result, cursor) = f(self.cursor())?;
807
29.2k
        self.buf.cur.set(cursor.pos);
808
29.2k
        Ok(result)
809
29.2k
    }
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::assert_exhaustion as wast::parser::Parse>::parse::{closure#0}, wast::kw::assert_exhaustion>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::core::custom::parse_sym_flags::flag as wast::parser::Parse>::parse::{closure#0}, wast::core::custom::parse_sym_flags::flag>
<wast::parser::Parser>::step::<<wast::core::expr::Instruction as wast::parser::Parse>::parse::{closure#0}, fn(wast::parser::Parser) -> core::result::Result<wast::core::expr::Instruction, wast::error::Error>>
Line
Count
Source
802
8.08M
    pub fn step<F, T>(self, f: F) -> Result<T>
803
8.08M
    where
804
8.08M
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
8.08M
    {
806
8.08M
        let (result, cursor) = f(self.cursor())?;
807
8.08M
        self.buf.cur.set(cursor.pos);
808
8.08M
        Ok(result)
809
8.08M
    }
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::assert_invalid as wast::parser::Parse>::parse::{closure#0}, wast::kw::assert_invalid>
<wast::parser::Parser>::step::<<(u8, wast::token::Span) as wast::parser::Parse>::parse::{closure#0}, (u8, wast::token::Span)>
Line
Count
Source
802
72
    pub fn step<F, T>(self, f: F) -> Result<T>
803
72
    where
804
72
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
72
    {
806
72
        let (result, cursor) = f(self.cursor())?;
807
64
        self.buf.cur.set(cursor.pos);
808
64
        Ok(result)
809
72
    }
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::assert_malformed as wast::parser::Parse>::parse::{closure#0}, wast::kw::assert_malformed>
Unexecuted instantiation: <wast::parser::Parser>::step::<<(u16, wast::token::Span) as wast::parser::Parse>::parse::{closure#0}, (u16, wast::token::Span)>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::assert_return as wast::parser::Parse>::parse::{closure#0}, wast::kw::assert_return>
<wast::parser::Parser>::step::<<(u32, wast::token::Span) as wast::parser::Parse>::parse::{closure#0}, (u32, wast::token::Span)>
Line
Count
Source
802
3.68M
    pub fn step<F, T>(self, f: F) -> Result<T>
803
3.68M
    where
804
3.68M
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
3.68M
    {
806
3.68M
        let (result, cursor) = f(self.cursor())?;
807
3.68M
        self.buf.cur.set(cursor.pos);
808
3.68M
        Ok(result)
809
3.68M
    }
<wast::parser::Parser>::step::<<(u64, wast::token::Span) as wast::parser::Parse>::parse::{closure#0}, (u64, wast::token::Span)>
Line
Count
Source
802
110k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
110k
    where
804
110k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
110k
    {
806
110k
        let (result, cursor) = f(self.cursor())?;
807
110k
        self.buf.cur.set(cursor.pos);
808
110k
        Ok(result)
809
110k
    }
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::assert_trap as wast::parser::Parse>::parse::{closure#0}, wast::kw::assert_trap>
Unexecuted instantiation: <wast::parser::Parser>::step::<<(i8, wast::token::Span) as wast::parser::Parse>::parse::{closure#0}, (i8, wast::token::Span)>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::s32 as wast::parser::Parse>::parse::{closure#0}, wast::kw::s32>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::s64 as wast::parser::Parse>::parse::{closure#0}, wast::kw::s64>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::case as wast::parser::Parse>::parse::{closure#0}, wast::kw::case>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::refines as wast::parser::Parse>::parse::{closure#0}, wast::kw::refines>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::record as wast::parser::Parse>::parse::{closure#0}, wast::kw::record>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::string as wast::parser::Parse>::parse::{closure#0}, wast::kw::string>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::bool_ as wast::parser::Parse>::parse::{closure#0}, wast::kw::bool_>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::annotation::metadata_code_branch_hint as wast::parser::Parse>::parse::{closure#0}, wast::annotation::metadata_code_branch_hint>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::u8 as wast::parser::Parse>::parse::{closure#0}, wast::kw::u8>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::u16 as wast::parser::Parse>::parse::{closure#0}, wast::kw::u16>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::u32 as wast::parser::Parse>::parse::{closure#0}, wast::kw::u32>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::u64 as wast::parser::Parse>::parse::{closure#0}, wast::kw::u64>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::char as wast::parser::Parse>::parse::{closure#0}, wast::kw::char>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::float32 as wast::parser::Parse>::parse::{closure#0}, wast::kw::float32>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::float64 as wast::parser::Parse>::parse::{closure#0}, wast::kw::float64>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::error as wast::parser::Parse>::parse::{closure#0}, wast::kw::error>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::canon as wast::parser::Parse>::parse::{closure#0}, wast::kw::canon>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::lift as wast::parser::Parse>::parse::{closure#0}, wast::kw::lift>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::lower as wast::parser::Parse>::parse::{closure#0}, wast::kw::lower>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::enum_ as wast::parser::Parse>::parse::{closure#0}, wast::kw::enum_>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::string_utf8 as wast::parser::Parse>::parse::{closure#0}, wast::kw::string_utf8>
<wast::parser::Parser>::step::<<wast::core::expr::LaneArg as wast::parser::Parse>::parse::{closure#0}, u8>
Line
Count
Source
802
6.59k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
6.59k
    where
804
6.59k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
6.59k
    {
806
6.59k
        let (result, cursor) = f(self.cursor())?;
807
6.59k
        self.buf.cur.set(cursor.pos);
808
6.59k
        Ok(result)
809
6.59k
    }
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::variant as wast::parser::Parse>::parse::{closure#0}, wast::kw::variant>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::flags as wast::parser::Parse>::parse::{closure#0}, wast::kw::flags>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::option as wast::parser::Parse>::parse::{closure#0}, wast::kw::option>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::tuple as wast::parser::Parse>::parse::{closure#0}, wast::kw::tuple>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::list as wast::parser::Parse>::parse::{closure#0}, wast::kw::list>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::string_utf16 as wast::parser::Parse>::parse::{closure#0}, wast::kw::string_utf16>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::string_latin1_utf16 as wast::parser::Parse>::parse::{closure#0}, wast::kw::string_latin1_utf16>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::core as wast::parser::Parse>::parse::{closure#0}, wast::kw::core>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::true_ as wast::parser::Parse>::parse::{closure#0}, wast::kw::true_>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::false_ as wast::parser::Parse>::parse::{closure#0}, wast::kw::false_>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::language as wast::parser::Parse>::parse::{closure#0}, wast::kw::language>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::sdk as wast::parser::Parse>::parse::{closure#0}, wast::kw::sdk>
<wast::parser::Parser>::step::<<wast::kw::struct as wast::parser::Parse>::parse::{closure#0}, wast::kw::struct>
Line
Count
Source
802
85.9k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
85.9k
    where
804
85.9k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
85.9k
    {
806
85.9k
        let (result, cursor) = f(self.cursor())?;
807
85.9k
        self.buf.cur.set(cursor.pos);
808
85.9k
        Ok(result)
809
85.9k
    }
<wast::parser::Parser>::step::<<wast::kw::structref as wast::parser::Parse>::parse::{closure#0}, wast::kw::structref>
Line
Count
Source
802
17.7k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
17.7k
    where
804
17.7k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
17.7k
    {
806
17.7k
        let (result, cursor) = f(self.cursor())?;
807
17.7k
        self.buf.cur.set(cursor.pos);
808
17.7k
        Ok(result)
809
17.7k
    }
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::realloc as wast::parser::Parse>::parse::{closure#0}, wast::kw::realloc>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::post_return as wast::parser::Parse>::parse::{closure#0}, wast::kw::post_return>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::with as wast::parser::Parse>::parse::{closure#0}, wast::kw::with>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::processed_by as wast::parser::Parse>::parse::{closure#0}, wast::kw::processed_by>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::mem_info as wast::parser::Parse>::parse::{closure#0}, wast::kw::mem_info>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::thread_hw_concurrency as wast::parser::Parse>::parse::{closure#0}, wast::kw::thread_hw_concurrency>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::task_backpressure as wast::parser::Parse>::parse::{closure#0}, wast::kw::task_backpressure>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::task_return as wast::parser::Parse>::parse::{closure#0}, wast::kw::task_return>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::task_wait as wast::parser::Parse>::parse::{closure#0}, wast::kw::task_wait>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::task_poll as wast::parser::Parse>::parse::{closure#0}, wast::kw::task_poll>
<wast::parser::Parser>::step::<<wast::kw::anyref as wast::parser::Parse>::parse::{closure#0}, wast::kw::anyref>
Line
Count
Source
802
9.40k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
9.40k
    where
804
9.40k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
9.40k
    {
806
9.40k
        let (result, cursor) = f(self.cursor())?;
807
9.40k
        self.buf.cur.set(cursor.pos);
808
9.40k
        Ok(result)
809
9.40k
    }
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::core::custom::parse_sym_flags::flag as wast::parser::Parse>::parse::{closure#0}, wast::core::custom::parse_sym_flags::flag>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::needed as wast::parser::Parse>::parse::{closure#0}, wast::kw::needed>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::export_info as wast::parser::Parse>::parse::{closure#0}, wast::kw::export_info>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::import_info as wast::parser::Parse>::parse::{closure#0}, wast::kw::import_info>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::thread as wast::parser::Parse>::parse::{closure#0}, wast::kw::thread>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::thread_spawn as wast::parser::Parse>::parse::{closure#0}, wast::kw::thread_spawn>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::task_yield as wast::parser::Parse>::parse::{closure#0}, wast::kw::task_yield>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::subtask_drop as wast::parser::Parse>::parse::{closure#0}, wast::kw::subtask_drop>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::stream_close_writable as wast::parser::Parse>::parse::{closure#0}, wast::kw::stream_close_writable>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::future_new as wast::parser::Parse>::parse::{closure#0}, wast::kw::future_new>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::future_read as wast::parser::Parse>::parse::{closure#0}, wast::kw::future_read>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::future_write as wast::parser::Parse>::parse::{closure#0}, wast::kw::future_write>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::future_cancel_read as wast::parser::Parse>::parse::{closure#0}, wast::kw::future_cancel_read>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::stream_new as wast::parser::Parse>::parse::{closure#0}, wast::kw::stream_new>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::stream_read as wast::parser::Parse>::parse::{closure#0}, wast::kw::stream_read>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::stream_write as wast::parser::Parse>::parse::{closure#0}, wast::kw::stream_write>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::stream_cancel_read as wast::parser::Parse>::parse::{closure#0}, wast::kw::stream_cancel_read>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::stream_cancel_write as wast::parser::Parse>::parse::{closure#0}, wast::kw::stream_cancel_write>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::stream_close_readable as wast::parser::Parse>::parse::{closure#0}, wast::kw::stream_close_readable>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::future_cancel_write as wast::parser::Parse>::parse::{closure#0}, wast::kw::future_cancel_write>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::future_close_readable as wast::parser::Parse>::parse::{closure#0}, wast::kw::future_close_readable>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::definition as wast::parser::Parse>::parse::{closure#0}, wast::kw::definition>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::async as wast::parser::Parse>::parse::{closure#0}, wast::kw::async>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::callback as wast::parser::Parse>::parse::{closure#0}, wast::kw::callback>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::stream as wast::parser::Parse>::parse::{closure#0}, wast::kw::stream>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::future as wast::parser::Parse>::parse::{closure#0}, wast::kw::future>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::future_close_writable as wast::parser::Parse>::parse::{closure#0}, wast::kw::future_close_writable>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::error_context_new as wast::parser::Parse>::parse::{closure#0}, wast::kw::error_context_new>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::error_context_debug_message as wast::parser::Parse>::parse::{closure#0}, wast::kw::error_context_debug_message>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::error_context_drop as wast::parser::Parse>::parse::{closure#0}, wast::kw::error_context_drop>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::wait as wast::parser::Parse>::parse::{closure#0}, wast::kw::wait>
<wast::parser::Parser>::step::<<&[u8] as wast::parser::Parse>::parse::{closure#0}, &[u8]>
Line
Count
Source
802
267k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
267k
    where
804
267k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
267k
    {
806
267k
        let (result, cursor) = f(self.cursor())?;
807
267k
        self.buf.cur.set(cursor.pos);
808
267k
        Ok(result)
809
267k
    }
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::arg as wast::parser::Parse>::parse::{closure#0}, wast::kw::arg>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::core::custom::parse_sym_flags::flag as wast::parser::Parse>::parse::{closure#0}, wast::core::custom::parse_sym_flags::flag>
<wast::parser::Parser>::step::<<wast::kw::array as wast::parser::Parse>::parse::{closure#0}, wast::kw::array>
Line
Count
Source
802
310k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
310k
    where
804
310k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
310k
    {
806
310k
        let (result, cursor) = f(self.cursor())?;
807
310k
        self.buf.cur.set(cursor.pos);
808
310k
        Ok(result)
809
310k
    }
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::core::custom::parse_sym_flags::flag as wast::parser::Parse>::parse::{closure#0}, wast::core::custom::parse_sym_flags::flag>
<wast::parser::Parser>::step::<<wast::kw::arrayref as wast::parser::Parse>::parse::{closure#0}, wast::kw::arrayref>
Line
Count
Source
802
28.9k
    pub fn step<F, T>(self, f: F) -> Result<T>
803
28.9k
    where
804
28.9k
        F: FnOnce(Cursor<'a>) -> Result<(T, Cursor<'a>)>,
805
28.9k
    {
806
28.9k
        let (result, cursor) = f(self.cursor())?;
807
28.9k
        self.buf.cur.set(cursor.pos);
808
28.9k
        Ok(result)
809
28.9k
    }
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::core::custom::parse_sym_flags::flag as wast::parser::Parse>::parse::{closure#0}, wast::core::custom::parse_sym_flags::flag>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::kw::assert_exception as wast::parser::Parse>::parse::{closure#0}, wast::kw::assert_exception>
Unexecuted instantiation: <wast::parser::Parser>::step::<<wast::core::custom::parse_sym_flags::flag as wast::parser::Parse>::parse::{closure#0}, wast::core::custom::parse_sym_flags::flag>
810
811
    /// Creates an error whose line/column information is pointing at the
812
    /// current token.
813
    ///
814
    /// This is used to produce human-readable error messages which point to the
815
    /// right location in the input stream, and the `msg` here is arbitrary text
816
    /// used to associate with the error and indicate why it was generated.
817
235
    pub fn error(self, msg: impl fmt::Display) -> Error {
818
235
        self.error_at(self.cursor().cur_span(), msg)
819
235
    }
Unexecuted instantiation: <wast::parser::Parser>::error::<alloc::string::String>
<wast::parser::Parser>::error::<&alloc::string::String>
Line
Count
Source
817
16
    pub fn error(self, msg: impl fmt::Display) -> Error {
818
16
        self.error_at(self.cursor().cur_span(), msg)
819
16
    }
<wast::parser::Parser>::error::<&str>
Line
Count
Source
817
219
    pub fn error(self, msg: impl fmt::Display) -> Error {
818
219
        self.error_at(self.cursor().cur_span(), msg)
819
219
    }
820
821
    /// Creates an error whose line/column information is pointing at the
822
    /// given span.
823
1.08k
    pub fn error_at(self, span: Span, msg: impl fmt::Display) -> Error {
824
1.08k
        Error::parse(span, self.buf.lexer.input(), msg.to_string())
825
1.08k
    }
Unexecuted instantiation: <wast::parser::Parser>::error_at::<alloc::string::String>
<wast::parser::Parser>::error_at::<&alloc::string::String>
Line
Count
Source
823
16
    pub fn error_at(self, span: Span, msg: impl fmt::Display) -> Error {
824
16
        Error::parse(span, self.buf.lexer.input(), msg.to_string())
825
16
    }
<wast::parser::Parser>::error_at::<&str>
Line
Count
Source
823
1.06k
    pub fn error_at(self, span: Span, msg: impl fmt::Display) -> Error {
824
1.06k
        Error::parse(span, self.buf.lexer.input(), msg.to_string())
825
1.06k
    }
826
827
    /// Returns the span of the current token
828
8.10M
    pub fn cur_span(&self) -> Span {
829
8.10M
        self.cursor().cur_span()
830
8.10M
    }
831
832
    /// Returns the span of the previous token
833
40.2k
    pub fn prev_span(&self) -> Span {
834
40.2k
        self.cursor()
835
40.2k
            .prev_span()
836
40.2k
            .unwrap_or_else(|| Span::from_offset(0))
837
40.2k
    }
838
839
    /// Registers a new known annotation with this parser to allow parsing
840
    /// annotations with this name.
841
    ///
842
    /// [WebAssembly annotations][annotation] are a proposal for the text format
843
    /// which allows decorating the text format with custom structured
844
    /// information. By default all annotations are ignored when parsing, but
845
    /// the whole purpose of them is to sometimes parse them!
846
    ///
847
    /// To support parsing text annotations this method is used to allow
848
    /// annotations and their tokens to *not* be skipped. Once an annotation is
849
    /// registered with this method, then while the return value has not been
850
    /// dropped (e.g. the scope of where this function is called) annotations
851
    /// with the name `annotation` will be parse of the token stream and not
852
    /// implicitly skipped.
853
    ///
854
    /// # Skipping annotations
855
    ///
856
    /// The behavior of skipping unknown/unregistered annotations can be
857
    /// somewhat subtle and surprising, so if you're interested in parsing
858
    /// annotations it's important to point out the importance of this method
859
    /// and where to call it.
860
    ///
861
    /// Generally when parsing tokens you'll be bottoming out in various
862
    /// `Cursor` methods. These are all documented as advancing the stream as
863
    /// much as possible to the next token, skipping "irrelevant stuff" like
864
    /// comments, whitespace, etc. The `Cursor` methods will also skip unknown
865
    /// annotations. This means that if you parse *any* token, it will skip over
866
    /// any number of annotations that are unknown at all times.
867
    ///
868
    /// To parse an annotation you must, before parsing any token of the
869
    /// annotation, register the annotation via this method. This includes the
870
    /// beginning `(` token, which is otherwise skipped if the annotation isn't
871
    /// marked as registered. Typically parser parse the *contents* of an
872
    /// s-expression, so this means that the outer parser of an s-expression
873
    /// must register the custom annotation name, rather than the inner parser.
874
    ///
875
    /// # Return
876
    ///
877
    /// This function returns an RAII guard which, when dropped, will unregister
878
    /// the `annotation` given. Parsing `annotation` is only supported while the
879
    /// returned value is still alive, and once dropped the parser will go back
880
    /// to skipping annotations with the name `annotation`.
881
    ///
882
    /// # Example
883
    ///
884
    /// Let's see an example of how the `@name` annotation is parsed for modules
885
    /// to get an idea of how this works:
886
    ///
887
    /// ```
888
    /// # use wast::kw;
889
    /// # use wast::token::NameAnnotation;
890
    /// # use wast::parser::*;
891
    /// struct Module<'a> {
892
    ///     name: Option<NameAnnotation<'a>>,
893
    /// }
894
    ///
895
    /// impl<'a> Parse<'a> for Module<'a> {
896
    ///     fn parse(parser: Parser<'a>) -> Result<Self> {
897
    ///         // Modules start out with a `module` keyword
898
    ///         parser.parse::<kw::module>()?;
899
    ///
900
    ///         // Next may be `(@name "foo")`. Typically this annotation would
901
    ///         // skipped, but we don't want it skipped, so we register it.
902
    ///         // Note that the parse implementation of
903
    ///         // `Option<NameAnnotation>` is the one that consumes the
904
    ///         // parentheses here.
905
    ///         let _r = parser.register_annotation("name");
906
    ///         let name = parser.parse()?;
907
    ///
908
    ///         // ... and normally you'd otherwise parse module fields here ...
909
    ///
910
    ///         Ok(Module { name })
911
    ///     }
912
    /// }
913
    /// ```
914
    ///
915
    /// Another example is how we parse the `@custom` annotation. Note that this
916
    /// is parsed as part of `ModuleField`, so note how the annotation is
917
    /// registered *before* we parse the parentheses of the annotation.
918
    ///
919
    /// ```
920
    /// # use wast::{kw, annotation};
921
    /// # use wast::core::Custom;
922
    /// # use wast::parser::*;
923
    /// struct Module<'a> {
924
    ///     fields: Vec<ModuleField<'a>>,
925
    /// }
926
    ///
927
    /// impl<'a> Parse<'a> for Module<'a> {
928
    ///     fn parse(parser: Parser<'a>) -> Result<Self> {
929
    ///         // Modules start out with a `module` keyword
930
    ///         parser.parse::<kw::module>()?;
931
    ///
932
    ///         // register the `@custom` annotation *first* before we start
933
    ///         // parsing fields, because each field is contained in
934
    ///         // parentheses and to parse the parentheses of an annotation we
935
    ///         // have to known to not skip it.
936
    ///         let _r = parser.register_annotation("custom");
937
    ///
938
    ///         let mut fields = Vec::new();
939
    ///         while !parser.is_empty() {
940
    ///             fields.push(parser.parens(|p| p.parse())?);
941
    ///         }
942
    ///         Ok(Module { fields })
943
    ///     }
944
    /// }
945
    ///
946
    /// enum ModuleField<'a> {
947
    ///     Custom(Custom<'a>),
948
    ///     // ...
949
    /// }
950
    ///
951
    /// impl<'a> Parse<'a> for ModuleField<'a> {
952
    ///     fn parse(parser: Parser<'a>) -> Result<Self> {
953
    ///         // Note that because we have previously registered the `@custom`
954
    ///         // annotation with the parser we known that `peek` methods like
955
    ///         // this, working on the annotation token, are enabled to ever
956
    ///         // return `true`.
957
    ///         if parser.peek::<annotation::custom>()? {
958
    ///             return Ok(ModuleField::Custom(parser.parse()?));
959
    ///         }
960
    ///
961
    ///         // .. typically we'd parse other module fields here...
962
    ///
963
    ///         Err(parser.error("unknown module field"))
964
    ///     }
965
    /// }
966
    /// ```
967
    ///
968
    /// [annotation]: https://github.com/WebAssembly/annotations
969
127k
    pub fn register_annotation<'b>(self, annotation: &'b str) -> impl Drop + 'b
970
127k
    where
971
127k
        'a: 'b,
972
127k
    {
973
127k
        let mut annotations = self.buf.known_annotations.borrow_mut();
974
127k
        if !annotations.contains_key(annotation) {
975
67.8k
            annotations.insert(annotation.to_string(), 0);
976
67.8k
        }
977
127k
        *annotations.get_mut(annotation).unwrap() += 1;
978
127k
979
127k
        return RemoveOnDrop(self, annotation);
980
981
        struct RemoveOnDrop<'a>(Parser<'a>, &'a str);
982
983
        impl Drop for RemoveOnDrop<'_> {
984
127k
            fn drop(&mut self) {
985
127k
                let mut annotations = self.0.buf.known_annotations.borrow_mut();
986
127k
                let slot = annotations.get_mut(self.1).unwrap();
987
127k
                *slot -= 1;
988
127k
            }
989
        }
990
127k
    }
991
992
    #[cfg(feature = "wasm-module")]
993
363k
    pub(crate) fn track_instr_spans(&self) -> bool {
994
363k
        self.buf.track_instr_spans
995
363k
    }
996
997
    #[cfg(feature = "wasm-module")]
998
25.4k
    pub(crate) fn with_standard_annotations_registered<R>(
999
25.4k
        self,
1000
25.4k
        f: impl FnOnce(Self) -> Result<R>,
1001
25.4k
    ) -> Result<R> {
1002
25.4k
        let _r = self.register_annotation("custom");
1003
25.4k
        let _r = self.register_annotation("producers");
1004
25.4k
        let _r = self.register_annotation("name");
1005
25.4k
        let _r = self.register_annotation("dylink.0");
1006
25.4k
        let _r = self.register_annotation("metadata.code.branch_hint");
1007
25.4k
        f(self)
1008
25.4k
    }
<wast::parser::Parser>::with_standard_annotations_registered::<wast::wat::Wat, <wast::wat::Wat as wast::parser::Parse>::parse::{closure#0}>
Line
Count
Source
998
12.9k
    pub(crate) fn with_standard_annotations_registered<R>(
999
12.9k
        self,
1000
12.9k
        f: impl FnOnce(Self) -> Result<R>,
1001
12.9k
    ) -> Result<R> {
1002
12.9k
        let _r = self.register_annotation("custom");
1003
12.9k
        let _r = self.register_annotation("producers");
1004
12.9k
        let _r = self.register_annotation("name");
1005
12.9k
        let _r = self.register_annotation("dylink.0");
1006
12.9k
        let _r = self.register_annotation("metadata.code.branch_hint");
1007
12.9k
        f(self)
1008
12.9k
    }
<wast::parser::Parser>::with_standard_annotations_registered::<wast::wast::Wast, <wast::wast::Wast as wast::parser::Parse>::parse::{closure#0}>
Line
Count
Source
998
1.15k
    pub(crate) fn with_standard_annotations_registered<R>(
999
1.15k
        self,
1000
1.15k
        f: impl FnOnce(Self) -> Result<R>,
1001
1.15k
    ) -> Result<R> {
1002
1.15k
        let _r = self.register_annotation("custom");
1003
1.15k
        let _r = self.register_annotation("producers");
1004
1.15k
        let _r = self.register_annotation("name");
1005
1.15k
        let _r = self.register_annotation("dylink.0");
1006
1.15k
        let _r = self.register_annotation("metadata.code.branch_hint");
1007
1.15k
        f(self)
1008
1.15k
    }
<wast::parser::Parser>::with_standard_annotations_registered::<wast::core::module::Module, <wast::core::module::Module as wast::parser::Parse>::parse::{closure#0}>
Line
Count
Source
998
11.3k
    pub(crate) fn with_standard_annotations_registered<R>(
999
11.3k
        self,
1000
11.3k
        f: impl FnOnce(Self) -> Result<R>,
1001
11.3k
    ) -> Result<R> {
1002
11.3k
        let _r = self.register_annotation("custom");
1003
11.3k
        let _r = self.register_annotation("producers");
1004
11.3k
        let _r = self.register_annotation("name");
1005
11.3k
        let _r = self.register_annotation("dylink.0");
1006
11.3k
        let _r = self.register_annotation("metadata.code.branch_hint");
1007
11.3k
        f(self)
1008
11.3k
    }
1009
}
1010
1011
impl<'a> Cursor<'a> {
1012
    /// Returns the span of the next `Token` token.
1013
    ///
1014
    /// Does not take into account whitespace or comments.
1015
29.6M
    pub fn cur_span(&self) -> Span {
1016
29.6M
        let offset = match self.token() {
1017
29.6M
            Ok(Some(t)) => t.offset,
1018
98
            Ok(None) => self.parser.buf.lexer.input().len(),
1019
0
            Err(_) => self.pos.offset,
1020
        };
1021
29.6M
        Span { offset }
1022
29.6M
    }
1023
1024
    /// Returns the span of the previous `Token` token.
1025
    ///
1026
    /// Does not take into account whitespace or comments.
1027
40.2k
    pub(crate) fn prev_span(&self) -> Option<Span> {
1028
40.2k
        // TODO
1029
40.2k
        Some(Span {
1030
40.2k
            offset: self.pos.offset,
1031
40.2k
        })
1032
40.2k
        // let (token, _) = self.parser.buf.tokens.get(self.cur.checked_sub(1)?)?;
1033
40.2k
        // Some(Span {
1034
40.2k
        //     offset: token.offset,
1035
40.2k
        // })
1036
40.2k
    }
1037
1038
    /// Same as [`Parser::error`], but works with the current token in this
1039
    /// [`Cursor`] instead.
1040
845
    pub fn error(&self, msg: impl fmt::Display) -> Error {
1041
845
        self.parser.error_at(self.cur_span(), msg)
1042
845
    }
1043
1044
    /// Tests whether the next token is an lparen
1045
1.73M
    pub fn peek_lparen(self) -> Result<bool> {
1046
325k
        Ok(matches!(
1047
1.73M
            self.token()?,
1048
            Some(Token {
1049
                kind: TokenKind::LParen,
1050
                ..
1051
            })
1052
        ))
1053
1.73M
    }
1054
1055
    /// Tests whether the next token is an rparen
1056
4.75k
    pub fn peek_rparen(self) -> Result<bool> {
1057
4.75k
        Ok(matches!(
1058
4.75k
            self.token()?,
1059
            Some(Token {
1060
                kind: TokenKind::RParen,
1061
                ..
1062
            })
1063
        ))
1064
4.75k
    }
1065
1066
    /// Tests whether the next token is an id
1067
6.33M
    pub fn peek_id(self) -> Result<bool> {
1068
6.33M
        Ok(matches!(
1069
6.33M
            self.token()?,
1070
            Some(Token {
1071
                kind: TokenKind::Id,
1072
                ..
1073
            })
1074
        ))
1075
6.33M
    }
1076
1077
    /// Tests whether the next token is reserved
1078
0
    pub fn peek_reserved(self) -> Result<bool> {
1079
0
        Ok(matches!(
1080
0
            self.token()?,
1081
            Some(Token {
1082
                kind: TokenKind::Reserved,
1083
                ..
1084
            })
1085
        ))
1086
0
    }
1087
1088
    /// Tests whether the next token is a keyword
1089
0
    pub fn peek_keyword(self) -> Result<bool> {
1090
0
        Ok(matches!(
1091
0
            self.token()?,
1092
            Some(Token {
1093
                kind: TokenKind::Keyword,
1094
                ..
1095
            })
1096
        ))
1097
0
    }
1098
1099
    /// Tests whether the next token is an integer
1100
4.87M
    pub fn peek_integer(self) -> Result<bool> {
1101
366k
        Ok(matches!(
1102
4.87M
            self.token()?,
1103
            Some(Token {
1104
                kind: TokenKind::Integer(_),
1105
                ..
1106
            })
1107
        ))
1108
4.87M
    }
1109
1110
    /// Tests whether the next token is a float
1111
0
    pub fn peek_float(self) -> Result<bool> {
1112
0
        Ok(matches!(
1113
0
            self.token()?,
1114
            Some(Token {
1115
                kind: TokenKind::Float(_),
1116
                ..
1117
            })
1118
        ))
1119
0
    }
1120
1121
    /// Tests whether the next token is a string
1122
16.4k
    pub fn peek_string(self) -> Result<bool> {
1123
4.75k
        Ok(matches!(
1124
16.4k
            self.token()?,
1125
            Some(Token {
1126
                kind: TokenKind::String,
1127
                ..
1128
            })
1129
        ))
1130
16.4k
    }
1131
1132
    /// Attempts to advance this cursor if the current token is a `(`.
1133
    ///
1134
    /// If the current token is `(`, returns a new [`Cursor`] pointing at the
1135
    /// rest of the tokens in the stream. Otherwise returns `None`.
1136
    ///
1137
    /// This function will automatically skip over any comments, whitespace, or
1138
    /// unknown annotations.
1139
18.1M
    pub fn lparen(mut self) -> Result<Option<Self>> {
1140
18.1M
        let token = match self.token()? {
1141
18.1M
            Some(token) => token,
1142
2
            None => return Ok(None),
1143
        };
1144
18.1M
        match token.kind {
1145
9.82M
            TokenKind::LParen => {}
1146
8.34M
            _ => return Ok(None),
1147
        }
1148
9.82M
        self.advance_past(&token);
1149
9.82M
        Ok(Some(self))
1150
18.1M
    }
1151
1152
    /// Attempts to advance this cursor if the current token is a `)`.
1153
    ///
1154
    /// If the current token is `)`, returns a new [`Cursor`] pointing at the
1155
    /// rest of the tokens in the stream. Otherwise returns `None`.
1156
    ///
1157
    /// This function will automatically skip over any comments, whitespace, or
1158
    /// unknown annotations.
1159
8.84M
    pub fn rparen(mut self) -> Result<Option<Self>> {
1160
8.84M
        let token = match self.token()? {
1161
8.84M
            Some(token) => token,
1162
2
            None => return Ok(None),
1163
        };
1164
8.84M
        match token.kind {
1165
8.84M
            TokenKind::RParen => {}
1166
4
            _ => return Ok(None),
1167
        }
1168
8.84M
        self.advance_past(&token);
1169
8.84M
        Ok(Some(self))
1170
8.84M
    }
1171
1172
    /// Attempts to advance this cursor if the current token is a
1173
    /// [`Token::Id`](crate::lexer::Token)
1174
    ///
1175
    /// If the current token is `Id`, returns the identifier minus the leading
1176
    /// `$` character as well as a new [`Cursor`] pointing at the rest of the
1177
    /// tokens in the stream. Otherwise returns `None`.
1178
    ///
1179
    /// This function will automatically skip over any comments, whitespace, or
1180
    /// unknown annotations.
1181
6
    pub fn id(mut self) -> Result<Option<(&'a str, Self)>> {
1182
6
        let token = match self.token()? {
1183
6
            Some(token) => token,
1184
0
            None => return Ok(None),
1185
        };
1186
6
        match token.kind {
1187
6
            TokenKind::Id => {}
1188
0
            _ => return Ok(None),
1189
        }
1190
6
        self.advance_past(&token);
1191
6
        let id = match token.id(self.parser.buf.lexer.input())? {
1192
6
            Cow::Borrowed(id) => id,
1193
            // Our `self.parser.buf` only retains `Vec<u8>` so briefly convert
1194
            // this owned string to `Vec<u8>` and then convert it back to `&str`
1195
            // out the other end.
1196
0
            Cow::Owned(s) => std::str::from_utf8(self.parser.buf.push_str(s.into_bytes())).unwrap(),
1197
        };
1198
6
        Ok(Some((id, self)))
1199
6
    }
1200
1201
    /// Attempts to advance this cursor if the current token is a
1202
    /// [`Token::Keyword`](crate::lexer::Token)
1203
    ///
1204
    /// If the current token is `Keyword`, returns the keyword as well as a new
1205
    /// [`Cursor`] pointing at the rest of the tokens in the stream. Otherwise
1206
    /// returns `None`.
1207
    ///
1208
    /// This function will automatically skip over any comments, whitespace, or
1209
    /// unknown annotations.
1210
72.7M
    pub fn keyword(mut self) -> Result<Option<(&'a str, Self)>> {
1211
72.7M
        let token = match self.token()? {
1212
72.7M
            Some(token) => token,
1213
1.28k
            None => return Ok(None),
1214
        };
1215
72.7M
        match token.kind {
1216
60.1M
            TokenKind::Keyword => {}
1217
12.6M
            _ => return Ok(None),
1218
        }
1219
60.1M
        self.advance_past(&token);
1220
60.1M
        Ok(Some((token.keyword(self.parser.buf.lexer.input()), self)))
1221
72.7M
    }
1222
1223
    /// Attempts to advance this cursor if the current token is a
1224
    /// [`Token::Annotation`](crate::lexer::Token)
1225
    ///
1226
    /// If the current token is `Annotation`, returns the annotation token as well
1227
    /// as a new [`Cursor`] pointing at the rest of the tokens in the stream.
1228
    /// Otherwise returns `None`.
1229
    ///
1230
    /// This function will automatically skip over any comments, whitespace, or
1231
    /// unknown annotations.
1232
5.42M
    pub fn annotation(mut self) -> Result<Option<(&'a str, Self)>> {
1233
5.42M
        let token = match self.token()? {
1234
5.42M
            Some(token) => token,
1235
142
            None => return Ok(None),
1236
        };
1237
5.42M
        match token.kind {
1238
8
            TokenKind::Annotation => {}
1239
5.42M
            _ => return Ok(None),
1240
        }
1241
8
        self.advance_past(&token);
1242
8
        let annotation = match token.annotation(self.parser.buf.lexer.input())? {
1243
6
            Cow::Borrowed(id) => id,
1244
            // Our `self.parser.buf` only retains `Vec<u8>` so briefly convert
1245
            // this owned string to `Vec<u8>` and then convert it back to `&str`
1246
            // out the other end.
1247
0
            Cow::Owned(s) => std::str::from_utf8(self.parser.buf.push_str(s.into_bytes())).unwrap(),
1248
        };
1249
6
        Ok(Some((annotation, self)))
1250
5.42M
    }
1251
1252
    /// Attempts to advance this cursor if the current token is a
1253
    /// [`Token::Reserved`](crate::lexer::Token)
1254
    ///
1255
    /// If the current token is `Reserved`, returns the reserved token as well
1256
    /// as a new [`Cursor`] pointing at the rest of the tokens in the stream.
1257
    /// Otherwise returns `None`.
1258
    ///
1259
    /// This function will automatically skip over any comments, whitespace, or
1260
    /// unknown annotations.
1261
0
    pub fn reserved(mut self) -> Result<Option<(&'a str, Self)>> {
1262
0
        let token = match self.token()? {
1263
0
            Some(token) => token,
1264
0
            None => return Ok(None),
1265
        };
1266
0
        match token.kind {
1267
0
            TokenKind::Reserved => {}
1268
0
            _ => return Ok(None),
1269
        }
1270
0
        self.advance_past(&token);
1271
0
        Ok(Some((token.reserved(self.parser.buf.lexer.input()), self)))
1272
0
    }
1273
1274
    /// Attempts to advance this cursor if the current token is a
1275
    /// [`Token::Integer`](crate::lexer::Token)
1276
    ///
1277
    /// If the current token is `Integer`, returns the integer as well as a new
1278
    /// [`Cursor`] pointing at the rest of the tokens in the stream. Otherwise
1279
    /// returns `None`.
1280
    ///
1281
    /// This function will automatically skip over any comments, whitespace, or
1282
    /// unknown annotations.
1283
5.45M
    pub fn integer(mut self) -> Result<Option<(Integer<'a>, Self)>> {
1284
5.45M
        let token = match self.token()? {
1285
5.45M
            Some(token) => token,
1286
2
            None => return Ok(None),
1287
        };
1288
5.45M
        let i = match token.kind {
1289
5.45M
            TokenKind::Integer(i) => i,
1290
318
            _ => return Ok(None),
1291
        };
1292
5.45M
        self.advance_past(&token);
1293
5.45M
        Ok(Some((
1294
5.45M
            token.integer(self.parser.buf.lexer.input(), i),
1295
5.45M
            self,
1296
5.45M
        )))
1297
5.45M
    }
1298
1299
    /// Attempts to advance this cursor if the current token is a
1300
    /// [`Token::Float`](crate::lexer::Token)
1301
    ///
1302
    /// If the current token is `Float`, returns the float as well as a new
1303
    /// [`Cursor`] pointing at the rest of the tokens in the stream. Otherwise
1304
    /// returns `None`.
1305
    ///
1306
    /// This function will automatically skip over any comments, whitespace, or
1307
    /// unknown annotations.
1308
744k
    pub fn float(mut self) -> Result<Option<(Float<'a>, Self)>> {
1309
744k
        let token = match self.token()? {
1310
744k
            Some(token) => token,
1311
0
            None => return Ok(None),
1312
        };
1313
744k
        let f = match token.kind {
1314
744k
            TokenKind::Float(f) => f,
1315
8
            _ => return Ok(None),
1316
        };
1317
744k
        self.advance_past(&token);
1318
744k
        Ok(Some((token.float(self.parser.buf.lexer.input(), f), self)))
1319
744k
    }
1320
1321
    /// Attempts to advance this cursor if the current token is a
1322
    /// [`Token::String`](crate::lexer::Token)
1323
    ///
1324
    /// If the current token is `String`, returns the byte value of the string
1325
    /// as well as a new [`Cursor`] pointing at the rest of the tokens in the
1326
    /// stream. Otherwise returns `None`.
1327
    ///
1328
    /// This function will automatically skip over any comments, whitespace, or
1329
    /// unknown annotations.
1330
330k
    pub fn string(mut self) -> Result<Option<(&'a [u8], Self)>> {
1331
330k
        let token = match self.token()? {
1332
330k
            Some(token) => token,
1333
0
            None => return Ok(None),
1334
        };
1335
330k
        match token.kind {
1336
330k
            TokenKind::String => {}
1337
1
            _ => return Ok(None),
1338
        }
1339
330k
        let string = match token.string(self.parser.buf.lexer.input()) {
1340
307k
            Cow::Borrowed(s) => s,
1341
22.6k
            Cow::Owned(s) => self.parser.buf.push_str(s),
1342
        };
1343
330k
        self.advance_past(&token);
1344
330k
        Ok(Some((string, self)))
1345
330k
    }
1346
1347
    /// Attempts to advance this cursor if the current token is a
1348
    /// [`Token::LineComment`](crate::lexer::Token) or a
1349
    /// [`Token::BlockComment`](crate::lexer::Token)
1350
    ///
1351
    /// This function will only skip whitespace, no other tokens.
1352
0
    pub fn comment(mut self) -> Result<Option<(&'a str, Self)>> {
1353
0
        let start = self.pos.offset;
1354
0
        self.pos.token = None;
1355
0
        let comment = loop {
1356
0
            let token = match self.parser.buf.lexer.parse(&mut self.pos.offset)? {
1357
0
                Some(token) => token,
1358
0
                None => return Ok(None),
1359
            };
1360
0
            match token.kind {
1361
                TokenKind::LineComment | TokenKind::BlockComment => {
1362
0
                    break token.src(self.parser.buf.lexer.input());
1363
                }
1364
0
                TokenKind::Whitespace => {}
1365
                _ => {
1366
0
                    self.pos.offset = start;
1367
0
                    return Ok(None);
1368
                }
1369
            }
1370
        };
1371
0
        Ok(Some((comment, self)))
1372
0
    }
1373
1374
183M
    fn token(&self) -> Result<Option<Token>> {
1375
183M
        match self.pos.token {
1376
183M
            Some(token) => Ok(Some(token)),
1377
42.6k
            None => self.parser.buf.advance_token(self.pos.offset),
1378
        }
1379
183M
    }
1380
1381
93.0M
    fn advance_past(&mut self, token: &Token) {
1382
93.0M
        self.pos.offset = token.offset + (token.len as usize);
1383
93.0M
        self.pos.token = self
1384
93.0M
            .parser
1385
93.0M
            .buf
1386
93.0M
            .advance_token(self.pos.offset)
1387
93.0M
            .unwrap_or(None);
1388
93.0M
    }
1389
}
1390
1391
impl Lookahead1<'_> {
1392
    /// Attempts to see if `T` is the next token in the [`Parser`] this
1393
    /// [`Lookahead1`] references.
1394
    ///
1395
    /// For more information see [`Parser::lookahead1`] and [`Parser::peek`]
1396
32.6M
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
32.6M
        Ok(if self.parser.peek::<T>()? {
1398
10.3M
            true
1399
        } else {
1400
22.2M
            self.attempts.push(T::display());
1401
22.2M
            false
1402
        })
1403
32.6M
    }
<wast::parser::Lookahead1>::peek::<wast::kw::nullexnref>
Line
Count
Source
1396
335k
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
335k
        Ok(if self.parser.peek::<T>()? {
1398
0
            true
1399
        } else {
1400
335k
            self.attempts.push(T::display());
1401
335k
            false
1402
        })
1403
335k
    }
Unexecuted instantiation: <wast::parser::Lookahead1>::peek::<wast::kw::assert_trap>
Unexecuted instantiation: <wast::parser::Lookahead1>::peek::<wast::kw::export_info>
Unexecuted instantiation: <wast::parser::Lookahead1>::peek::<wast::kw::import_info>
<wast::parser::Lookahead1>::peek::<wast::kw::nullcontref>
Line
Count
Source
1396
324k
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
324k
        Ok(if self.parser.peek::<T>()? {
1398
0
            true
1399
        } else {
1400
324k
            self.attempts.push(T::display());
1401
324k
            false
1402
        })
1403
324k
    }
<wast::parser::Lookahead1>::peek::<wast::kw::nullfuncref>
Line
Count
Source
1396
380k
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
380k
        Ok(if self.parser.peek::<T>()? {
1398
18.3k
            true
1399
        } else {
1400
362k
            self.attempts.push(T::display());
1401
362k
            false
1402
        })
1403
380k
    }
Unexecuted instantiation: <wast::parser::Lookahead1>::peek::<wast::kw::processed_by>
Unexecuted instantiation: <wast::parser::Lookahead1>::peek::<wast::kw::assert_return>
<wast::parser::Lookahead1>::peek::<wast::kw::nullexternref>
Line
Count
Source
1396
362k
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
362k
        Ok(if self.parser.peek::<T>()? {
1398
27.0k
            true
1399
        } else {
1400
335k
            self.attempts.push(T::display());
1401
335k
            false
1402
        })
1403
362k
    }
<wast::parser::Lookahead1>::peek::<wast::kw::assert_invalid>
Line
Count
Source
1396
1
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
1
        Ok(if self.parser.peek::<T>()? {
1398
0
            true
1399
        } else {
1400
1
            self.attempts.push(T::display());
1401
1
            false
1402
        })
1403
1
    }
Unexecuted instantiation: <wast::parser::Lookahead1>::peek::<wast::kw::assert_exception>
<wast::parser::Lookahead1>::peek::<wast::kw::assert_malformed>
Line
Count
Source
1396
1
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
1
        Ok(if self.parser.peek::<T>()? {
1398
0
            true
1399
        } else {
1400
1
            self.attempts.push(T::display());
1401
1
            false
1402
        })
1403
1
    }
Unexecuted instantiation: <wast::parser::Lookahead1>::peek::<wast::kw::assert_exhaustion>
Unexecuted instantiation: <wast::parser::Lookahead1>::peek::<wast::kw::assert_suspension>
Unexecuted instantiation: <wast::parser::Lookahead1>::peek::<wast::kw::assert_unlinkable>
<wast::parser::Lookahead1>::peek::<wast::kw::eq>
Line
Count
Source
1396
195k
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
195k
        Ok(if self.parser.peek::<T>()? {
1398
6.65k
            true
1399
        } else {
1400
188k
            self.attempts.push(T::display());
1401
188k
            false
1402
        })
1403
195k
    }
<wast::parser::Lookahead1>::peek::<wast::kw::i8>
Line
Count
Source
1396
860k
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
860k
        Ok(if self.parser.peek::<T>()? {
1398
522k
            true
1399
        } else {
1400
338k
            self.attempts.push(T::display());
1401
338k
            false
1402
        })
1403
860k
    }
<wast::parser::Lookahead1>::peek::<wast::kw::any>
Line
Count
Source
1396
197k
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
197k
        Ok(if self.parser.peek::<T>()? {
1398
2.82k
            true
1399
        } else {
1400
195k
            self.attempts.push(T::display());
1401
195k
            false
1402
        })
1403
197k
    }
<wast::parser::Lookahead1>::peek::<wast::kw::exn>
Line
Count
Source
1396
209k
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
209k
        Ok(if self.parser.peek::<T>()? {
1398
11.8k
            true
1399
        } else {
1400
197k
            self.attempts.push(T::display());
1401
197k
            false
1402
        })
1403
209k
    }
<wast::parser::Lookahead1>::peek::<wast::kw::f32>
Line
Count
Source
1396
2.54M
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
2.54M
        Ok(if self.parser.peek::<T>()? {
1398
504k
            true
1399
        } else {
1400
2.04M
            self.attempts.push(T::display());
1401
2.04M
            false
1402
        })
1403
2.54M
    }
<wast::parser::Lookahead1>::peek::<wast::kw::f64>
Line
Count
Source
1396
2.04M
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
2.04M
        Ok(if self.parser.peek::<T>()? {
1398
1.43M
            true
1399
        } else {
1400
609k
            self.attempts.push(T::display());
1401
609k
            false
1402
        })
1403
2.04M
    }
Unexecuted instantiation: <wast::parser::Lookahead1>::peek::<wast::kw::get>
<wast::parser::Lookahead1>::peek::<wast::kw::i16>
Line
Count
Source
1396
338k
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
338k
        Ok(if self.parser.peek::<T>()? {
1398
118k
            true
1399
        } else {
1400
219k
            self.attempts.push(T::display());
1401
219k
            false
1402
        })
1403
338k
    }
<wast::parser::Lookahead1>::peek::<wast::kw::i31>
Line
Count
Source
1396
159k
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
159k
        Ok(if self.parser.peek::<T>()? {
1398
4.87k
            true
1399
        } else {
1400
154k
            self.attempts.push(T::display());
1401
154k
            false
1402
        })
1403
159k
    }
<wast::parser::Lookahead1>::peek::<wast::kw::i32>
Line
Count
Source
1396
6.24M
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
6.24M
        Ok(if self.parser.peek::<T>()? {
1398
573k
            true
1399
        } else {
1400
5.66M
            self.attempts.push(T::display());
1401
5.66M
            false
1402
        })
1403
6.24M
    }
<wast::parser::Lookahead1>::peek::<wast::kw::i64>
Line
Count
Source
1396
5.66M
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
5.66M
        Ok(if self.parser.peek::<T>()? {
1398
3.11M
            true
1399
        } else {
1400
2.55M
            self.attempts.push(T::display());
1401
2.55M
            false
1402
        })
1403
5.66M
    }
<wast::parser::Lookahead1>::peek::<wast::kw::ref>
Line
Count
Source
1396
313k
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
313k
        Ok(if self.parser.peek::<T>()? {
1398
313k
            true
1399
        } else {
1400
0
            self.attempts.push(T::display());
1401
0
            false
1402
        })
1403
313k
    }
Unexecuted instantiation: <wast::parser::Lookahead1>::peek::<wast::kw::sdk>
<wast::parser::Lookahead1>::peek::<wast::kw::tag>
Line
Count
Source
1396
6.37k
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
6.37k
        Ok(if self.parser.peek::<T>()? {
1398
6.37k
            true
1399
        } else {
1400
0
            self.attempts.push(T::display());
1401
0
            false
1402
        })
1403
6.37k
    }
<wast::parser::Lookahead1>::peek::<wast::kw::cont>
Line
Count
Source
1396
197k
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
197k
        Ok(if self.parser.peek::<T>()? {
1398
0
            true
1399
        } else {
1400
197k
            self.attempts.push(T::display());
1401
197k
            false
1402
        })
1403
197k
    }
<wast::parser::Lookahead1>::peek::<wast::kw::func>
Line
Count
Source
1396
837k
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
837k
        Ok(if self.parser.peek::<T>()? {
1398
185k
            true
1399
        } else {
1400
651k
            self.attempts.push(T::display());
1401
651k
            false
1402
        })
1403
837k
    }
Unexecuted instantiation: <wast::parser::Lookahead1>::peek::<wast::kw::last>
<wast::parser::Lookahead1>::peek::<wast::kw::none>
Line
Count
Source
1396
91.5k
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
91.5k
        Ok(if self.parser.peek::<T>()? {
1398
91.5k
            true
1399
        } else {
1400
0
            self.attempts.push(T::display());
1401
0
            false
1402
        })
1403
91.5k
    }
<wast::parser::Lookahead1>::peek::<wast::kw::v128>
Line
Count
Source
1396
609k
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
609k
        Ok(if self.parser.peek::<T>()? {
1398
133k
            true
1399
        } else {
1400
476k
            self.attempts.push(T::display());
1401
476k
            false
1402
        })
1403
609k
    }
Unexecuted instantiation: <wast::parser::Lookahead1>::peek::<wast::kw::wait>
Unexecuted instantiation: <wast::parser::Lookahead1>::peek::<wast::kw::after>
<wast::parser::Lookahead1>::peek::<wast::kw::array>
Line
Count
Source
1396
469k
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
469k
        Ok(if self.parser.peek::<T>()? {
1398
310k
            true
1399
        } else {
1400
159k
            self.attempts.push(T::display());
1401
159k
            false
1402
        })
1403
469k
    }
<wast::parser::Lookahead1>::peek::<wast::kw::eqref>
Line
Count
Source
1396
554k
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
554k
        Ok(if self.parser.peek::<T>()? {
1398
15.6k
            true
1399
        } else {
1400
538k
            self.attempts.push(T::display());
1401
538k
            false
1402
        })
1403
554k
    }
Unexecuted instantiation: <wast::parser::Lookahead1>::peek::<wast::kw::f32x4>
Unexecuted instantiation: <wast::parser::Lookahead1>::peek::<wast::kw::f64x2>
Unexecuted instantiation: <wast::parser::Lookahead1>::peek::<wast::kw::first>
<wast::parser::Lookahead1>::peek::<wast::kw::i16x8>
Line
Count
Source
1396
84.2k
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
84.2k
        Ok(if self.parser.peek::<T>()? {
1398
0
            true
1399
        } else {
1400
84.2k
            self.attempts.push(T::display());
1401
84.2k
            false
1402
        })
1403
84.2k
    }
<wast::parser::Lookahead1>::peek::<wast::kw::i32x4>
Line
Count
Source
1396
84.2k
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
84.2k
        Ok(if self.parser.peek::<T>()? {
1398
84.2k
            true
1399
        } else {
1400
0
            self.attempts.push(T::display());
1401
0
            false
1402
        })
1403
84.2k
    }
Unexecuted instantiation: <wast::parser::Lookahead1>::peek::<wast::kw::i64x2>
<wast::parser::Lookahead1>::peek::<wast::kw::i8x16>
Line
Count
Source
1396
84.2k
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
84.2k
        Ok(if self.parser.peek::<T>()? {
1398
0
            true
1399
        } else {
1400
84.2k
            self.attempts.push(T::display());
1401
84.2k
            false
1402
        })
1403
84.2k
    }
<wast::parser::Lookahead1>::peek::<wast::kw::noexn>
Line
Count
Source
1396
91.5k
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
91.5k
        Ok(if self.parser.peek::<T>()? {
1398
0
            true
1399
        } else {
1400
91.5k
            self.attempts.push(T::display());
1401
91.5k
            false
1402
        })
1403
91.5k
    }
<wast::parser::Lookahead1>::peek::<wast::kw::param>
Line
Count
Source
1396
698k
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
698k
        Ok(if self.parser.peek::<T>()? {
1398
289k
            true
1399
        } else {
1400
408k
            self.attempts.push(T::display());
1401
408k
            false
1402
        })
1403
698k
    }
<wast::parser::Lookahead1>::peek::<wast::kw::table>
Line
Count
Source
1396
65.3k
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
65.3k
        Ok(if self.parser.peek::<T>()? {
1398
26.3k
            true
1399
        } else {
1400
39.0k
            self.attempts.push(T::display());
1401
39.0k
            false
1402
        })
1403
65.3k
    }
<wast::parser::Lookahead1>::peek::<wast::kw::anyref>
Line
Count
Source
1396
573k
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
573k
        Ok(if self.parser.peek::<T>()? {
1398
18.8k
            true
1399
        } else {
1400
554k
            self.attempts.push(T::display());
1401
554k
            false
1402
        })
1403
573k
    }
Unexecuted instantiation: <wast::parser::Lookahead1>::peek::<wast::kw::before>
<wast::parser::Lookahead1>::peek::<wast::kw::exnref>
Line
Count
Source
1396
619k
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
619k
        Ok(if self.parser.peek::<T>()? {
1398
46.5k
            true
1399
        } else {
1400
573k
            self.attempts.push(T::display());
1401
573k
            false
1402
        })
1403
619k
    }
<wast::parser::Lookahead1>::peek::<wast::kw::extern>
Line
Count
Source
1396
219k
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
219k
        Ok(if self.parser.peek::<T>()? {
1398
9.44k
            true
1399
        } else {
1400
209k
            self.attempts.push(T::display());
1401
209k
            false
1402
        })
1403
219k
    }
<wast::parser::Lookahead1>::peek::<wast::kw::global>
Line
Count
Source
1396
32.7k
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
32.7k
        Ok(if self.parser.peek::<T>()? {
1398
26.3k
            true
1399
        } else {
1400
6.37k
            self.attempts.push(T::display());
1401
6.37k
            false
1402
        })
1403
32.7k
    }
<wast::parser::Lookahead1>::peek::<wast::kw::i31ref>
Line
Count
Source
1396
445k
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
445k
        Ok(if self.parser.peek::<T>()? {
1398
64.6k
            true
1399
        } else {
1400
380k
            self.attempts.push(T::display());
1401
380k
            false
1402
        })
1403
445k
    }
Unexecuted instantiation: <wast::parser::Lookahead1>::peek::<wast::kw::invoke>
<wast::parser::Lookahead1>::peek::<wast::kw::memory>
Line
Count
Source
1396
39.0k
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
39.0k
        Ok(if self.parser.peek::<T>()? {
1398
6.26k
            true
1399
        } else {
1400
32.7k
            self.attempts.push(T::display());
1401
32.7k
            false
1402
        })
1403
39.0k
    }
<wast::parser::Lookahead1>::peek::<wast::kw::module>
Line
Count
Source
1396
1
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
1
        Ok(if self.parser.peek::<T>()? {
1398
0
            true
1399
        } else {
1400
1
            self.attempts.push(T::display());
1401
1
            false
1402
        })
1403
1
    }
Unexecuted instantiation: <wast::parser::Lookahead1>::peek::<wast::kw::needed>
<wast::parser::Lookahead1>::peek::<wast::kw::nocont>
Line
Count
Source
1396
91.5k
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
91.5k
        Ok(if self.parser.peek::<T>()? {
1398
0
            true
1399
        } else {
1400
91.5k
            self.attempts.push(T::display());
1401
91.5k
            false
1402
        })
1403
91.5k
    }
<wast::parser::Lookahead1>::peek::<wast::kw::nofunc>
Line
Count
Source
1396
154k
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
154k
        Ok(if self.parser.peek::<T>()? {
1398
33.8k
            true
1399
        } else {
1400
120k
            self.attempts.push(T::display());
1401
120k
            false
1402
        })
1403
154k
    }
<wast::parser::Lookahead1>::peek::<wast::kw::result>
Line
Count
Source
1396
408k
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
408k
        Ok(if self.parser.peek::<T>()? {
1398
408k
            true
1399
        } else {
1400
0
            self.attempts.push(T::display());
1401
0
            false
1402
        })
1403
408k
    }
<wast::parser::Lookahead1>::peek::<wast::kw::shared>
Line
Count
Source
1396
14.6k
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
14.6k
        Ok(if self.parser.peek::<T>()? {
1398
962
            true
1399
        } else {
1400
13.6k
            self.attempts.push(T::display());
1401
13.6k
            false
1402
        })
1403
14.6k
    }
<wast::parser::Lookahead1>::peek::<wast::kw::struct>
Line
Count
Source
1396
555k
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
555k
        Ok(if self.parser.peek::<T>()? {
1398
85.9k
            true
1399
        } else {
1400
469k
            self.attempts.push(T::display());
1401
469k
            false
1402
        })
1403
555k
    }
Unexecuted instantiation: <wast::parser::Lookahead1>::peek::<wast::kw::thread>
<wast::parser::Lookahead1>::peek::<wast::kw::contref>
Line
Count
Source
1396
477k
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
477k
        Ok(if self.parser.peek::<T>()? {
1398
0
            true
1399
        } else {
1400
477k
            self.attempts.push(T::display());
1401
477k
            false
1402
        })
1403
477k
    }
<wast::parser::Lookahead1>::peek::<wast::kw::funcref>
Line
Count
Source
1396
736k
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
736k
        Ok(if self.parser.peek::<T>()? {
1398
61.0k
            true
1399
        } else {
1400
675k
            self.attempts.push(T::display());
1401
675k
            false
1402
        })
1403
736k
    }
<wast::parser::Lookahead1>::peek::<wast::kw::nullref>
Line
Count
Source
1396
335k
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
335k
        Ok(if self.parser.peek::<T>()? {
1398
22.1k
            true
1399
        } else {
1400
313k
            self.attempts.push(T::display());
1401
313k
            false
1402
        })
1403
335k
    }
<wast::parser::Lookahead1>::peek::<wast::kw::arrayref>
Line
Count
Source
1396
503k
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
503k
        Ok(if self.parser.peek::<T>()? {
1398
57.8k
            true
1399
        } else {
1400
445k
            self.attempts.push(T::display());
1401
445k
            false
1402
        })
1403
503k
    }
Unexecuted instantiation: <wast::parser::Lookahead1>::peek::<wast::kw::language>
Unexecuted instantiation: <wast::parser::Lookahead1>::peek::<wast::kw::mem_info>
<wast::parser::Lookahead1>::peek::<wast::kw::noextern>
Line
Count
Source
1396
120k
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
120k
        Ok(if self.parser.peek::<T>()? {
1398
28.7k
            true
1399
        } else {
1400
91.5k
            self.attempts.push(T::display());
1401
91.5k
            false
1402
        })
1403
120k
    }
<wast::parser::Lookahead1>::peek::<wast::kw::register>
Line
Count
Source
1396
1
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
1
        Ok(if self.parser.peek::<T>()? {
1398
1
            true
1399
        } else {
1400
0
            self.attempts.push(T::display());
1401
0
            false
1402
        })
1403
1
    }
<wast::parser::Lookahead1>::peek::<wast::kw::component>
Line
Count
Source
1396
1
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
1
        Ok(if self.parser.peek::<T>()? {
1398
0
            true
1399
        } else {
1400
1
            self.attempts.push(T::display());
1401
1
            false
1402
        })
1403
1
    }
<wast::parser::Lookahead1>::peek::<wast::kw::externref>
Line
Count
Source
1396
675k
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
675k
        Ok(if self.parser.peek::<T>()? {
1398
55.6k
            true
1399
        } else {
1400
619k
            self.attempts.push(T::display());
1401
619k
            false
1402
        })
1403
675k
    }
<wast::parser::Lookahead1>::peek::<wast::kw::structref>
Line
Count
Source
1396
538k
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
538k
        Ok(if self.parser.peek::<T>()? {
1398
35.5k
            true
1399
        } else {
1400
503k
            self.attempts.push(T::display());
1401
503k
            false
1402
        })
1403
538k
    }
<wast::parser::Lookahead1>::peek::<wast::token::Index>
Line
Count
Source
1396
561k
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
561k
        Ok(if self.parser.peek::<T>()? {
1398
331k
            true
1399
        } else {
1400
229k
            self.attempts.push(T::display());
1401
229k
            false
1402
        })
1403
561k
    }
<wast::parser::Lookahead1>::peek::<wast::token::LParen>
Line
Count
Source
1396
567k
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
567k
        Ok(if self.parser.peek::<T>()? {
1398
360k
            true
1399
        } else {
1400
206k
            self.attempts.push(T::display());
1401
206k
            false
1402
        })
1403
567k
    }
<wast::parser::Lookahead1>::peek::<wast::core::types::AbstractHeapType>
Line
Count
Source
1396
182k
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
182k
        Ok(if self.parser.peek::<T>()? {
1398
182k
            true
1399
        } else {
1400
0
            self.attempts.push(T::display());
1401
0
            false
1402
        })
1403
182k
    }
<wast::parser::Lookahead1>::peek::<wast::core::types::RefType>
Line
Count
Source
1396
490k
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
490k
        Ok(if self.parser.peek::<T>()? {
1398
476k
            true
1399
        } else {
1400
14.6k
            self.attempts.push(T::display());
1401
14.6k
            false
1402
        })
1403
490k
    }
<wast::parser::Lookahead1>::peek::<wast::core::types::ValType>
Line
Count
Source
1396
219k
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
219k
        Ok(if self.parser.peek::<T>()? {
1398
219k
            true
1399
        } else {
1400
0
            self.attempts.push(T::display());
1401
0
            false
1402
        })
1403
219k
    }
Unexecuted instantiation: <wast::parser::Lookahead1>::peek::<wast::core::custom::parse_sym_flags::flag>
Unexecuted instantiation: <wast::parser::Lookahead1>::peek::<wast::core::custom::parse_sym_flags::flag>
Unexecuted instantiation: <wast::parser::Lookahead1>::peek::<wast::core::custom::parse_sym_flags::flag>
Unexecuted instantiation: <wast::parser::Lookahead1>::peek::<wast::core::custom::parse_sym_flags::flag>
Unexecuted instantiation: <wast::parser::Lookahead1>::peek::<wast::core::custom::parse_sym_flags::flag>
Unexecuted instantiation: <wast::parser::Lookahead1>::peek::<wast::core::custom::parse_sym_flags::flag>
Unexecuted instantiation: <wast::parser::Lookahead1>::peek::<wast::core::custom::parse_sym_flags::flag>
Unexecuted instantiation: <wast::parser::Lookahead1>::peek::<wast::core::custom::parse_sym_flags::flag>
Unexecuted instantiation: <wast::parser::Lookahead1>::peek::<wast::core::custom::parse_sym_flags::flag>
<wast::parser::Lookahead1>::peek::<u32>
Line
Count
Source
1396
24.3k
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
24.3k
        Ok(if self.parser.peek::<T>()? {
1398
11.1k
            true
1399
        } else {
1400
13.1k
            self.attempts.push(T::display());
1401
13.1k
            false
1402
        })
1403
24.3k
    }
<wast::parser::Lookahead1>::peek::<u64>
Line
Count
Source
1396
5.49k
    pub fn peek<T: Peek>(&mut self) -> Result<bool> {
1397
5.49k
        Ok(if self.parser.peek::<T>()? {
1398
5.49k
            true
1399
        } else {
1400
0
            self.attempts.push(T::display());
1401
0
            false
1402
        })
1403
5.49k
    }
1404
1405
    /// Generates an error message saying that one of the tokens passed to
1406
    /// [`Lookahead1::peek`] method was expected.
1407
    ///
1408
    /// Before calling this method you should call [`Lookahead1::peek`] for all
1409
    /// possible tokens you'd like to parse.
1410
16
    pub fn error(self) -> Error {
1411
16
        match self.attempts.len() {
1412
            0 => {
1413
0
                if self.parser.is_empty() {
1414
0
                    self.parser.error("unexpected end of input")
1415
                } else {
1416
0
                    self.parser.error("unexpected token")
1417
                }
1418
            }
1419
            1 => {
1420
0
                let message = format!("unexpected token, expected {}", self.attempts[0]);
1421
0
                self.parser.error(&message)
1422
            }
1423
            2 => {
1424
0
                let message = format!(
1425
0
                    "unexpected token, expected {} or {}",
1426
0
                    self.attempts[0], self.attempts[1]
1427
0
                );
1428
0
                self.parser.error(&message)
1429
            }
1430
            _ => {
1431
16
                let join = self.attempts.join(", ");
1432
16
                let message = format!("unexpected token, expected one of: {}", join);
1433
16
                self.parser.error(&message)
1434
            }
1435
        }
1436
16
    }
1437
}
1438
1439
impl<'a, T: Peek + Parse<'a>> Parse<'a> for Option<T> {
1440
3.09M
    fn parse(parser: Parser<'a>) -> Result<Option<T>> {
1441
3.09M
        if parser.peek::<T>()? {
1442
673k
            Ok(Some(parser.parse()?))
1443
        } else {
1444
2.42M
            Ok(None)
1445
        }
1446
3.09M
    }
Unexecuted instantiation: <core::option::Option<wast::kw::i32> as wast::parser::Parse>::parse
Unexecuted instantiation: <core::option::Option<wast::kw::i64> as wast::parser::Parse>::parse
<core::option::Option<wast::kw::shared> as wast::parser::Parse>::parse
Line
Count
Source
1440
59.6k
    fn parse(parser: Parser<'a>) -> Result<Option<T>> {
1441
59.6k
        if parser.peek::<T>()? {
1442
4.59k
            Ok(Some(parser.parse()?))
1443
        } else {
1444
55.0k
            Ok(None)
1445
        }
1446
59.6k
    }
<core::option::Option<wast::token::Id> as wast::parser::Parse>::parse
Line
Count
Source
1440
1.78M
    fn parse(parser: Parser<'a>) -> Result<Option<T>> {
1441
1.78M
        if parser.peek::<T>()? {
1442
6
            Ok(Some(parser.parse()?))
1443
        } else {
1444
1.78M
            Ok(None)
1445
        }
1446
1.78M
    }
<core::option::Option<wast::token::Index> as wast::parser::Parse>::parse
Line
Count
Source
1440
345k
    fn parse(parser: Parser<'a>) -> Result<Option<T>> {
1441
345k
        if parser.peek::<T>()? {
1442
305k
            Ok(Some(parser.parse()?))
1443
        } else {
1444
40.1k
            Ok(None)
1445
        }
1446
345k
    }
<core::option::Option<wast::core::types::FunctionType> as wast::parser::Parse>::parse
Line
Count
Source
1440
254k
    fn parse(parser: Parser<'a>) -> Result<Option<T>> {
1441
254k
        if parser.peek::<T>()? {
1442
221k
            Ok(Some(parser.parse()?))
1443
        } else {
1444
33.6k
            Ok(None)
1445
        }
1446
254k
    }
<core::option::Option<wast::core::types::FunctionTypeNoNames> as wast::parser::Parse>::parse
Line
Count
Source
1440
370k
    fn parse(parser: Parser<'a>) -> Result<Option<T>> {
1441
370k
        if parser.peek::<T>()? {
1442
141k
            Ok(Some(parser.parse()?))
1443
        } else {
1444
228k
            Ok(None)
1445
        }
1446
370k
    }
Unexecuted instantiation: <core::option::Option<wast::core::types::HeapType> as wast::parser::Parse>::parse
<core::option::Option<wast::core::import::InlineImport> as wast::parser::Parse>::parse
Line
Count
Source
1440
285k
    fn parse(parser: Parser<'a>) -> Result<Option<T>> {
1441
285k
        if parser.peek::<T>()? {
1442
0
            Ok(Some(parser.parse()?))
1443
        } else {
1444
285k
            Ok(None)
1445
        }
1446
285k
    }
Unexecuted instantiation: <core::option::Option<u32> as wast::parser::Parse>::parse
1447
}