module

Obelisk::ContextConditions

Utilities for creating common context conditions

Class methods

all_of(*conditions : Proc(ParsingContext, Bool)) : Proc(ParsingContext, Bool)

Combine multiple conditions with AND logic

Source
any_of(*conditions : Proc(ParsingContext, Bool)) : Proc(ParsingContext, Bool)

Combine multiple conditions with OR logic

Source
at_line_end

Create condition that checks if we're at line end

Source
at_line_start

Create condition that checks if we're at line start

Source
context_equals(key : String, value : String) : Proc(ParsingContext, Bool)

Create condition that checks context data

Source
followed_by(pattern : Regex) : Proc(ParsingContext, Bool)

Create condition that checks look-ahead text

Source
in_state(state_name : String) : Proc(ParsingContext, Bool)

Create condition that checks if we're in a specific state

Source
nesting_level_equals(level : Int32, open_types : Array(TokenType), close_types : Array(TokenType)) : Proc(ParsingContext, Bool)

Create condition that checks nesting level

Source
not(condition : Proc(ParsingContext, Bool)) : Proc(ParsingContext, Bool)

Negate a condition

Source
not_in_state(state_name : String) : Proc(ParsingContext, Bool)

Create condition that checks if NOT in a specific state

Source
preceded_by(pattern : Regex) : Proc(ParsingContext, Bool)

Create condition that checks look-behind text

Source
recent_token_type(type : TokenType, max_lookback = 5) : Proc(ParsingContext, Bool)

Create condition that checks recent token history

Source