Obelisk::ContextRuleHelpers
Helper module for creating common context-aware rules
Class methods
bracket_tracking_rule(open_pattern : Regex, close_pattern : Regex, open_type : TokenType, close_type : TokenType, state_to_push : String | Nil = nil) : Array(ContextAwareRule)
Create rule for balanced bracket tracking
contextual_comment_rule(pattern : Regex, context_conditions : Hash(String, TokenType)) : ContextAwareRule
Create rule for comment that varies by language context
history_dependent_rule(pattern : Regex, required_recent_type : TokenType, success_type : TokenType, failure_type : TokenType, max_lookback = 5) : ContextAwareRule
Create rule that depends on recent token history