Skip to content

Commit 9c76638

Browse files
committed
Extra comments
1 parent 9482f6e commit 9c76638

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/name_mangle.nim

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,18 @@ proc stripEdgeUnderscores*(a: string): string =
4949
result = ""
5050
return
5151
i = 0
52-
while i < l and a[i] == '_':
52+
while i < l and a[i] == '_': # Skips all underscores in the beginning and sets i to the index where the actual identifier without the underscores starts.
5353
inc i
5454
if i >= l:
5555
result = ""
5656
return
5757
j = l - 1
58-
while j >= i and a[j] == '_':
58+
while j >= i and a[j] == '_': # Skips all underscores at the end and sets j to the index where the actual identifier without the underscores ends.
5959
dec j
6060
if j < i:
61-
result = ""
61+
result = ""
6262
else:
63-
result = a[i .. j]
63+
result = a[i .. j] # Return the slice of the string (only the middle part) leaving the underscores at the end and at the start out.
6464

6565
proc sanitizeIdent*(a: string, b: string): string =
6666
## a: original identifier

0 commit comments

Comments
 (0)