This commit is contained in:
Andreas Rumpf
2021-02-18 12:15:21 +01:00
committed by GitHub
parent f400b5c26b
commit 8fd1ed6dfe

View File

@@ -55,7 +55,9 @@ proc beautifyName(s: string, k: TSymKind): string =
inc i
while i < s.len:
if s[i] == '_':
if i > 0 and s[i-1] in {'A'..'Z'}:
if i+1 >= s.len:
discard "trailing underscores should be stripped off"
elif i > 0 and s[i-1] in {'A'..'Z'}:
# don't skip '_' as it's essential for e.g. 'GC_disable'
result.add('_')
inc i