This commit is contained in:
Andreas Rumpf 2021-02-18 12:15:21 +01:00 • committed by GitHub
commit 8fd1ed6dfe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -55,7 +55,9 @@ proc beautifyName(s: string, k: TSymKind): string =
inc i inc i
while i < s.len: while i < s.len:
if s[i] == '_': 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' # don't skip '_' as it's essential for e.g. 'GC_disable'
result.add('_') result.add('_')
inc i inc i