summaryrefslogtreecommitdiffstats
path: root/third_party/rust/wast/src/token.rs
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/rust/wast/src/token.rs')
-rw-r--r--third_party/rust/wast/src/token.rs20
1 files changed, 18 insertions, 2 deletions
diff --git a/third_party/rust/wast/src/token.rs b/third_party/rust/wast/src/token.rs
index 9dd15f97a8..b296341096 100644
--- a/third_party/rust/wast/src/token.rs
+++ b/third_party/rust/wast/src/token.rs
@@ -639,13 +639,13 @@ macro_rules! float {
}
float! {
- Float32 => {
+ F32 => {
bits: u32,
float: f32,
exponent_bits: 8,
name: strtof,
}
- Float64 => {
+ F64 => {
bits: u64,
float: f64,
exponent_bits: 11,
@@ -677,6 +677,22 @@ impl Peek for LParen {
}
}
+/// A convenience type to use with [`Parser::peek`](crate::parser::Parser::peek)
+/// to see if the next token is the end of an s-expression.
+pub struct RParen {
+ _priv: (),
+}
+
+impl Peek for RParen {
+ fn peek(cursor: Cursor<'_>) -> Result<bool> {
+ cursor.peek_rparen()
+ }
+
+ fn display() -> &'static str {
+ "right paren"
+ }
+}
+
#[cfg(test)]
mod tests {
#[test]