JsonRemedy.Layer3.ContextManager (json_remedy v0.1.3)

View Source

Context management functions for Layer 3 syntax normalization.

Handles parsing state, expectation tracking, and context transitions during character-by-character processing.

Summary

Functions

Determine what to expect after closing a delimiter.

Determine what to expect next based on current state.

Get position information for error reporting.

Check if a position in the input is inside a string literal. Used to avoid applying repairs to string content.

Functions

determine_expecting_after_close(stack)

@spec determine_expecting_after_close(list()) :: :comma_or_end | :value

Determine what to expect after closing a delimiter.

determine_next_expecting(state)

@spec determine_next_expecting(map()) :: atom()

Determine what to expect next based on current state.

get_position_info(input, position)

@spec get_position_info(String.t(), non_neg_integer()) :: %{
  line: pos_integer(),
  column: pos_integer(),
  context: String.t()
}

Get position information for error reporting.

inside_string?(input, position)

@spec inside_string?(String.t(), non_neg_integer()) :: boolean()

Check if a position in the input is inside a string literal. Used to avoid applying repairs to string content.