Skip to main content

luaur_analysis/functions/
parse_mode.rs

1use luaur_ast::enums::mode::Mode;
2use luaur_ast::records::hot_comment::HotComment;
3
4pub fn parse_mode(hotcomments: &[HotComment]) -> Option<Mode> {
5    for hc in hotcomments {
6        if !hc.header {
7            continue;
8        }
9
10        if hc.content == "nocheck" {
11            return Some(Mode::NoCheck);
12        }
13
14        if hc.content == "nonstrict" {
15            return Some(Mode::Nonstrict);
16        }
17
18        if hc.content == "strict" {
19            return Some(Mode::Strict);
20        }
21    }
22
23    None
24}