Skip to content

Commit b5c9e36

Browse files
committed
fix comments
1 parent b2a2a53 commit b5c9e36

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/json_mend/parser.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def parse_object
173173
# Attempts to parse a single key-value pair.
174174
# Returns [key, value] on success, or [nil, nil] if parsing should stop.
175175
def parse_object_pair(object)
176-
# --- 1. Parse the Key ---
176+
# Parse the Key
177177
# This step includes the complex logic for merging dangling arrays.
178178
pos_before_key = @scanner.pos
179179
key, was_array_merged, is_bracketed = parse_object_key(object)
@@ -192,7 +192,7 @@ def parse_object_pair(object)
192192
# If we get an empty key and the next character is a closing brace, we're done.
193193
return [nil, nil, false] if key.empty? && (peek_char.nil? || peek_char == '}' || @scanner.pos == pos_before_key)
194194

195-
# --- 2. Handle Duplicate Keys (Safer Method) ---
195+
# Handle Duplicate Keys (Safer Method)
196196
# This is a critical repair for lists of objects missing a comma separator.
197197
if object.key?(key)
198198
# Instead of rewriting the string, we safely rewind the scanner to the
@@ -203,11 +203,11 @@ def parse_object_pair(object)
203203
return [nil, nil, false] # Signal to stop parsing this object.
204204
end
205205

206-
# --- 3. Parse the Separator (:) ---
206+
# Parse the Separator (:)
207207
skip_whitespaces
208208
colon_found = @scanner.skip(/:/) # Leniently skip the colon if it exists.
209209

210-
# --- 4. Parse the Value ---
210+
# Parse the Value
211211
value = parse_object_value(colon_found: colon_found || is_bracketed)
212212

213213
if value == :inferred_true

0 commit comments

Comments
 (0)