sway_parse/
submodule.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::{Parse, ParseResult, Parser};

use sway_ast::submodule::Submodule;

impl Parse for Submodule {
    fn parse(parser: &mut Parser) -> ParseResult<Submodule> {
        let visibility = parser.take();
        let mod_token = parser.parse()?;
        let name = parser.parse()?;
        let semicolon_token = parser.parse()?;
        Ok(Submodule {
            mod_token,
            name,
            semicolon_token,
            visibility,
        })
    }
}