lexariel 0.1.0

Lexical analyzer for Asmodeus language
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! keyword and directive recognition

/// recognized keyword (instruction)
pub(crate) fn is_keyword(word: &str) -> bool {
    matches!(word.to_uppercase().as_str(),
        "DOD" | "ODE" | "ŁAD" | "LAD" | "POB" | "SOB" | "SOM" | "SOZ" | "STP" | 
        "DNS" | "PZS" | "SDP" | "CZM" | "MSK" | "PWR" | "WPR" | "WEJSCIE" | "WYJSCIE" | "WYJ" |
        "MNO" | "DZI" | "MOD"
    )
}

/// recognized directive
pub(crate) fn is_directive(word: &str) -> bool {
    matches!(word.to_uppercase().as_str(),
        "RST" | "RPA" | "MAKRO" | "KONM" | "NAZWA_LOKALNA"
    )
}