microsoft / llguidance

Low-level Guidance Parser
MIT License
30 stars 7 forks source link

support non-contextual keywords #46

Open mmoskal opened 2 weeks ago

mmoskal commented 2 weeks ago
        // TODO
        // Find all non-contextual lexemes that are literals (we call them 'keywords')
        // This assumes that this is the only possible conflict in the lexer that we want to catch.
        // For every non literals lexeme, find all keywords that match it.
        // Replace the regex R for the lexeme with (R & ~(K1|K2|...)) where K1...
        // are the conflicting keywords.

    pub fn to_regex_vec(&self, limits: &mut ParserLimits) -> Result<RegexVec> {