ripex 0.3.0

Multi-language structural parsing and fact extraction.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Python declarations are handled inline in statements.rs
// because function and class definitions are parsed directly.
use super::super::lexer::TokenKind;
use super::state::Parser;

impl Parser {
    pub fn parse_docstring(&mut self) -> Option<String> {
        if self.peek() == TokenKind::StringLit {
            let tok = self.advance();
            Some(tok.value.clone())
        } else {
            None
        }
    }
}