ptx_parser/parser/instruction/
ret.rs

1//! Original PTX specification:
2//!
3//! ret{.uni};
4
5#![allow(unused)]
6
7use crate::lexer::PtxToken;
8use crate::parser::{PtxParseError, PtxParser, PtxTokenStream, Span};
9use crate::r#type::common::*;
10
11pub mod section_0 {
12    use super::*;
13    use crate::r#type::instruction::ret::section_0::*;
14
15    impl PtxParser for RetUni {
16        fn parse(stream: &mut PtxTokenStream) -> Result<Self, PtxParseError> {
17            stream.expect_string("ret")?;
18            let saved_pos = stream.position();
19            let uni = stream.expect_string(".uni").is_ok();
20            if !uni {
21                stream.set_position(saved_pos);
22            }
23            stream.expect_complete()?;
24            stream.expect_complete()?;
25            stream.expect(&PtxToken::Semicolon)?;
26            Ok(RetUni {
27                uni,
28            })
29        }
30    }
31
32
33}
34